From 1c43932205e66b4d04c4a2e78883c587d3e5f4a3 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 1 Aug 2020 10:40:00 +0800 Subject: [PATCH] cleanup/fix python-deps import --- artiq-fast/default.nix | 2 +- artiq-fast/pkgs/artiq.nix | 67 +++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/artiq-fast/default.nix b/artiq-fast/default.nix index f95aaa6..dbd21aa 100644 --- a/artiq-fast/default.nix +++ b/artiq-fast/default.nix @@ -33,7 +33,7 @@ let cargo-vendor = callPackage ./pkgs/rust/cargo-vendor.nix {}; llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; }; 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}"; }); openocd = callPackage ./pkgs/openocd.nix {}; }; diff --git a/artiq-fast/pkgs/artiq.nix b/artiq-fast/pkgs/artiq.nix index 520f885..144bd6e 100644 --- a/artiq-fast/pkgs/artiq.nix +++ b/artiq-fast/pkgs/artiq.nix @@ -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 - pythonDeps = callPackage ./python-deps.nix {}; -in - python3Packages.buildPythonPackage rec { - name = "artiq-${version}"; - version = import ./artiq-version.nix { inherit stdenv fetchgit git; }; - src = import ./artiq-src.nix { inherit fetchgit; }; +python3Packages.buildPythonPackage rec { + 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 ]; - propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ] - ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ]) - ++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ]) - ++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]); + nativeBuildInputs = [ qt5.wrapQtAppsHook ]; + propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ] + ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ]) + ++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ]) + ++ (with python3Packages; [ pygit2 numpy dateutil quamash scipy prettytable pyserial python-Levenshtein h5py pyqt5 ]); - dontWrapQtApps = true; - postFixup = '' - wrapQtApp "$out/bin/artiq_dashboard" - wrapQtApp "$out/bin/artiq_browser" - wrapQtApp "$out/bin/artiq_session" - ''; + dontWrapQtApps = true; + postFixup = '' + wrapQtApp "$out/bin/artiq_dashboard" + wrapQtApp "$out/bin/artiq_browser" + wrapQtApp "$out/bin/artiq_session" + ''; - checkInputs = [ binutils-or1k outputcheck ]; - checkPhase = - '' - python -m unittest discover -v artiq.test + checkInputs = [ binutils-or1k outputcheck ]; + checkPhase = + '' + python -m unittest discover -v artiq.test - TESTDIR=`mktemp -d` - cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR - LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit - ''; + TESTDIR=`mktemp -d` + cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR + LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit + ''; - meta = with stdenv.lib; { - description = "A leading-edge control system for quantum information experiments"; - homepage = https://m-labs/artiq; - license = licenses.lgpl3; - maintainers = [ maintainers.sb0 ]; - }; - } + meta = with stdenv.lib; { + description = "A leading-edge control system for quantum information experiments"; + homepage = https://m-labs/artiq; + license = licenses.lgpl3; + maintainers = [ maintainers.sb0 ]; + }; +}