From 23612c7418b290aaa5cfacc154a9482d5b69d16c Mon Sep 17 00:00:00 2001 From: Ada Date: Wed, 23 Feb 2022 19:18:19 -0700 Subject: [PATCH] add our custom packages to artiq environment, to correct commit --- artiq-fast/default.nix | 10 ++++- artiq-fast/pkgs/artiq.nix | 4 +- artiq-fast/pkgs/python-deps.nix | 21 +++++++++++ artiq-fast/shell-dev.nix | 67 +++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 3 deletions(-) diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index 20f4033..66b7a9c 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -21,7 +21,7 @@ let }) {} boards; mainPackages = rec { - inherit (pythonDeps) sipyco asyncserial pythonparser artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck qasync; + inherit (pythonDeps) sipyco artiq_tools asyncserial pythonparser artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck qasync pyqtgraph; binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; }; binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; }; llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {}; @@ -74,6 +74,14 @@ let inherit (pythonDeps.qasync) version src; }; }; + conda-pyqtgraph = import ./conda/build.nix { inherit pkgs; } { + pname = "conda-pyqtgraph"; + inherit (pythonDeps.pyqtgraph) version; + src = import ./conda/fake-source.nix { inherit pkgs; } { + name = "pyqtgraph"; + inherit (pythonDeps.pyqtgraph) version src; + }; + }; conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix { inherit pkgs; bscan_spi_bitstreams = "${mainPackages.openocd}/share/bscan-spi-bitstreams"; diff --git a/artiq-fast/pkgs/artiq.nix b/artiq-fast/pkgs/artiq.nix index 0f3d76b..484f112 100644 --- a/artiq-fast/pkgs/artiq.nix +++ b/artiq-fast/pkgs/artiq.nix @@ -10,8 +10,8 @@ python3Packages.buildPythonPackage rec { nativeBuildInputs = [ qt5.wrapQtAppsHook ]; propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ] ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ]) - ++ (with pythonDeps; [ sipyco pythonparser ]) - ++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 pyqtgraph ]) + ++ (with pythonDeps; [ sipyco pythonparser pyqtgraph]) + ++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]) ++ [(if (lib.strings.versionAtLeast version "6.0") then pythonDeps.qasync else python3Packages.quamash)]; dontWrapQtApps = true; diff --git a/artiq-fast/pkgs/python-deps.nix b/artiq-fast/pkgs/python-deps.nix index c9e0700..b105b5d 100644 --- a/artiq-fast/pkgs/python-deps.nix +++ b/artiq-fast/pkgs/python-deps.nix @@ -14,6 +14,13 @@ rec { propagatedBuildInputs = with python3Packages; [ numpy ]; }; + artiq_tools = python3Packages.buildPythonPackage rec { + pname = "artiq_tools"; + version = "0.2"; + src = /home/thomp/scratch/artiq_tools; + propagatedBuildInputs = with python3Packages; [ numpy typing ]; + }; + asyncserial = python3Packages.buildPythonPackage rec { pname = "asyncserial"; version = "0.1"; @@ -57,6 +64,20 @@ rec { ''; }; + pyqtgraph = python3Packages.buildPythonPackage rec { + pname = "pyqtgraph"; + version = "0.12.3"; + src = fetchFromGitHub { + rev = "123717df28ee91c0472ce939175c1b14bc1e4364"; + owner = "jkthompsonlab"; + repo = "pyqtgraph"; + sha256 = "sha256-8RO2rl0/isS2/Ad5oAcuvaabg/wSoXGsL3PJdmGCfk4="; + }; + propagatedBuildInputs = with python3Packages; [ numpy setuptools ]; + doCheck = false; + }; + + # Development/firmware dependencies artiq-netboot = python3Packages.buildPythonPackage rec { pname = "artiq-netboot"; diff --git a/artiq-fast/shell-dev.nix b/artiq-fast/shell-dev.nix index 6ef516a..88deddd 100644 --- a/artiq-fast/shell-dev.nix +++ b/artiq-fast/shell-dev.nix @@ -1,12 +1,69 @@ { pkgs ? import {}}: +with import {}; + let + set-scratch-dir = ./set-scratch-dir.sh; artiqpkgs = import ./default.nix { inherit pkgs; }; vivado = import ./vivado.nix { inherit pkgs; }; + sipyco = python3Packages.buildPythonPackage rec { + pname = "sipyco"; + version = "0.1"; + src = /home/thomp/scratch/sipyco; + propagatedBuildInputs = [ pkgs.python3Packages.statsmodels ]; + doCheck = false; + }; + artiq_tools = python3Packages.buildPythonPackage rec { + pname = "artiq_tools"; + version = "0.2"; + src = /home/thomp/scratch/artiq_tools; + propagatedBuildInputs = [ pkgs.python3Packages.numpy pkgs.python3Packages.typing artiqpkgs.artiq pkgs.python3Packages.pyzmq pkgs.python3Packages.matplotlib]; + }; + oitg = python3Packages.buildPythonPackage rec { + pname = "oitg"; + version = "0.1"; + src = /home/thomp/scratch/oitg; + propagatedBuildInputs = [ pkgs.python3Packages.statsmodels ]; + doCheck = false; + }; + python_library = python3Packages.buildPythonPackage rec { + pname = "python_library"; + version = "0.1"; + src = /home/thomp/scratch/python-library; + propagatedBuildInputs = [ pkgs.python3Packages.numpy pkgs.python3Packages.scipy pkgs.python3Packages.matplotlib ]; + }; + strontium_library = python3Packages.buildPythonPackage rec { + pname = "strontium_library"; + version = "0.1"; + src = /home/thomp/scratch/strontium-library; + propagatedBuildInputs = [ pkgs.python3Packages.numpy pkgs.python3Packages.scipy pkgs.python3Packages.matplotlib pkgs.python3Packages.influxdb]; + }; + ndscan = python3Packages.buildPythonPackage rec { + pname = "ndscan"; + version = "0.1"; + src = /home/thomp/scratch/ndscan; + propagatedBuildInputs = [ artiqpkgs.artiq oitg]; + doCheck = false; + }; + analysis_library = python3Packages.buildPythonPackage rec { + pname = "analysis_library"; + version = "0.1"; + src = /home/thomp/scratch/analysis-library; + propagatedBuildInputs = [ pkgs.python3Packages.h5py pkgs.python3Packages.matplotlib pkgs.python3Packages.scipy pkgs.python3Packages.numpy python_library strontium_library pkgs.python3Packages.uncertainties]; + doCheck = false; + }; + + in pkgs.mkShell { buildInputs = [ vivado + sipyco + artiq_tools + analysis_library + python_library + strontium_library + ndscan pkgs.gnumake (pkgs.python3.withPackages(ps: (with ps; [ jinja2 jsonschema numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ]))) artiqpkgs.cargo @@ -16,5 +73,15 @@ in artiqpkgs.llvm-or1k artiqpkgs.openocd ]; + shellHook = '' + source ${set-scratch-dir}; + export PYTHONPATH="$scratch_dir/artiq_tools:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/oitg:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/analysis-library:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/python-library:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/strontium-library:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/ndscan:$PYTHONPATH" + export PYTHONPATH="$scratch_dir/sipyco:$PYTHONPATH" + ''; TARGET_AR="or1k-linux-ar"; }