From 645b9b8c5fa1555eddec001d8845e2e36e9fa165 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 17 Dec 2023 13:41:49 +0800 Subject: [PATCH] flake: add executable wrappers for frontends to devshell --- flake.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/flake.nix b/flake.nix index 4219c44f5..f05bddb82 100644 --- a/flake.nix +++ b/flake.nix @@ -368,6 +368,20 @@ titlesec tabulary varwidth framed fancyvrb float wrapfig parskip 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 { packages.x86_64-linux = { inherit pythonparser qasync artiq; @@ -432,6 +446,8 @@ # 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. + # Additionally, executable wrappers that import the current ARTIQ sources for the ARTIQ frontends + # are added to PATH. devShells.x86_64-linux.default = pkgs.mkShell { name = "artiq-dev-shell"; buildInputs = [ @@ -442,6 +458,7 @@ pkgs.llvm_14 pkgs.lld_14 pkgs.git + artiq-frontend-dev-wrappers # To manually run compiler tests: pkgs.lit outputcheck