forked from M-Labs/artiq
1
0
Fork 0

flake: add executable wrappers for frontends to devshell

This commit is contained in:
Sebastien Bourdeauducq 2023-12-17 13:41:49 +08:00
parent 858f0479ba
commit 645b9b8c5f
1 changed files with 17 additions and 0 deletions

View File

@ -368,6 +368,20 @@
titlesec tabulary varwidth framed fancyvrb float wrapfig parskip titlesec tabulary varwidth framed fancyvrb float wrapfig parskip
upquote capt-of needspace etoolbox booktabs; upquote capt-of needspace etoolbox booktabs;
}; };
artiq-frontend-dev-wrappers = pkgs.runCommandNoCC "artiq-frontend-dev-wrappers" {}
''
mkdir -p $out/bin
for program in ${self}/artiq/frontend/*.py; do
if [ -x $program ]; then
progname=`basename -s .py $program`
outname=$out/bin/$progname
echo "#!${pkgs.bash}/bin/bash" >> $outname
echo "exec python3 -m artiq.frontend.$progname" >> $outname
chmod 755 $outname
fi
done
'';
in rec { in rec {
packages.x86_64-linux = { packages.x86_64-linux = {
inherit pythonparser qasync artiq; inherit pythonparser qasync artiq;
@ -432,6 +446,8 @@
# Main development shell with everything you need to develop ARTIQ on Linux. # Main development shell with everything you need to develop ARTIQ on Linux.
# The current copy of the ARTIQ sources is added to PYTHONPATH so changes can be tested instantly. # The current copy of the ARTIQ sources is added to PYTHONPATH so changes can be tested instantly.
# Additionally, executable wrappers that import the current ARTIQ sources for the ARTIQ frontends
# are added to PATH.
devShells.x86_64-linux.default = pkgs.mkShell { devShells.x86_64-linux.default = pkgs.mkShell {
name = "artiq-dev-shell"; name = "artiq-dev-shell";
buildInputs = [ buildInputs = [
@ -442,6 +458,7 @@
pkgs.llvm_14 pkgs.llvm_14
pkgs.lld_14 pkgs.lld_14
pkgs.git pkgs.git
artiq-frontend-dev-wrappers
# To manually run compiler tests: # To manually run compiler tests:
pkgs.lit pkgs.lit
outputcheck outputcheck