1
0
Fork 0

cleanup/fix python-deps import

This commit is contained in:
Sebastien Bourdeauducq 2020-08-01 10:40:00 +08:00
parent 60e554c501
commit 1c43932205
2 changed files with 33 additions and 36 deletions

View File

@ -33,7 +33,7 @@ let
cargo-vendor = callPackage ./pkgs/rust/cargo-vendor.nix {}; cargo-vendor = callPackage ./pkgs/rust/cargo-vendor.nix {};
llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; }; llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; };
libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; }; libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; };
artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; }; artiq = callPackage ./pkgs/artiq.nix { inherit pythonDeps binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; };
artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; }); artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; });
openocd = callPackage ./pkgs/openocd.nix {}; openocd = callPackage ./pkgs/openocd.nix {};
}; };

View File

@ -1,43 +1,40 @@
{ stdenv, lib, callPackage, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }: { stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
let python3Packages.buildPythonPackage rec {
pythonDeps = callPackage ./python-deps.nix {}; name = "artiq-${version}";
in version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
python3Packages.buildPythonPackage rec { src = import ./artiq-src.nix { inherit fetchgit; };
name = "artiq-${version}";
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; };
preBuild = "export VERSIONEER_OVERRIDE=${version}"; preBuild = "export VERSIONEER_OVERRIDE=${version}";
nativeBuildInputs = [ qt5.wrapQtAppsHook ]; nativeBuildInputs = [ qt5.wrapQtAppsHook ];
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ] propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ]
++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ]) ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ])
++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ]) ++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ])
++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]); ++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]);
dontWrapQtApps = true; dontWrapQtApps = true;
postFixup = '' postFixup = ''
wrapQtApp "$out/bin/artiq_dashboard" wrapQtApp "$out/bin/artiq_dashboard"
wrapQtApp "$out/bin/artiq_browser" wrapQtApp "$out/bin/artiq_browser"
wrapQtApp "$out/bin/artiq_session" wrapQtApp "$out/bin/artiq_session"
''; '';
checkInputs = [ binutils-or1k outputcheck ]; checkInputs = [ binutils-or1k outputcheck ];
checkPhase = checkPhase =
'' ''
python -m unittest discover -v artiq.test python -m unittest discover -v artiq.test
TESTDIR=`mktemp -d` TESTDIR=`mktemp -d`
cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR
LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A leading-edge control system for quantum information experiments"; description = "A leading-edge control system for quantum information experiments";
homepage = https://m-labs/artiq; homepage = https://m-labs/artiq;
license = licenses.lgpl3; license = licenses.lgpl3;
maintainers = [ maintainers.sb0 ]; maintainers = [ maintainers.sb0 ];
}; };
} }