From ee729213825fd554252f186aecd3538f64f59b8c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 14 Feb 2019 16:33:36 +0800 Subject: [PATCH] fix/cleanup previous attempts at using /nix/store entry --- artiq/artiq-board.nix | 2 +- artiq/pkgs/artiq.nix | 4 ++-- main.nix | 15 +++++---------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/artiq/artiq-board.nix b/artiq/artiq-board.nix index c535154..1bf228e 100644 --- a/artiq/artiq-board.nix +++ b/artiq/artiq-board.nix @@ -9,7 +9,7 @@ let fetchcargo = import ./fetchcargo.nix { inherit (pkgs) stdenv cacert git cargo cargo-vendor; }; - artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; }; + artiqSrc = import ./pkgs/artiq-src.nix; cargoDeps = fetchcargo rec { name = "artiq-firmware-cargo-deps"; src = "${artiqSrc}/artiq/firmware"; diff --git a/artiq/pkgs/artiq.nix b/artiq/pkgs/artiq.nix index 419d9d1..ac63e8a 100644 --- a/artiq/pkgs/artiq.nix +++ b/artiq/pkgs/artiq.nix @@ -1,4 +1,4 @@ -{ stdenv, git, fetchFromGitHub, fetchgit, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite, python3 }: +{ stdenv, git, fetchFromGitHub, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite, python3 }: let @@ -65,7 +65,7 @@ in python3Packages.buildPythonPackage rec { name = "artiq"; - src = import ./artiq-src.nix { inherit fetchgit; }; + src = import ./artiq-src.nix; buildInputs = [ git ]; propagatedBuildInputs = with python3Packages; [ binutils-or1k llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; checkPhase = "python -m unittest discover -v artiq.test"; diff --git a/main.nix b/main.nix index aa10921..bcc87bc 100644 --- a/main.nix +++ b/main.nix @@ -1,15 +1,10 @@ { pkgs ? import {}}: let - artiqSrc = ; - generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; } + artiqSrc = builtins.toString ; + generatedNix = pkgs.runCommand "generated-nix" { } '' cp --no-preserve=mode,ownership -R ${./artiq} $out - REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD` - HASH=`nix-hash --type sha256 --base32 ${artiqSrc}` - cat > $out/pkgs/artiq-src.nix << EOF - { fetchgit }: - ${artiqSrc} - EOF + echo ${artiqSrc} > $out/pkgs/artiq-src.nix ''; artiqPkgs = import "${generatedNix}/default.nix" { inherit pkgs; }; @@ -27,7 +22,7 @@ let start // { "artiq-board-${board.target}-${board.variant}" = boardBinaries; "conda-artiq-board-${board.target}-${board.variant}" = import "${generatedNix}/conda-board.nix" { inherit pkgs; } { - artiqSrc = import "${generatedNix}/pkgs/artiq-src.nix" { fetchgit = pkgs.fetchgit; }; + artiqSrc = import "${generatedNix}/pkgs/artiq-src.nix"; boardBinaries = boardBinaries; target = board.target; variant = board.variant; @@ -37,7 +32,7 @@ let jobs = { conda-artiq = import "${generatedNix}/conda-build.nix" { inherit pkgs; } { name = "conda-artiq"; - src = import "${generatedNix}/pkgs/artiq-src.nix" { fetchgit = pkgs.fetchgit; }; + src = import "${generatedNix}/pkgs/artiq-src.nix"; recipe = "conda/artiq"; }; } // boardJobs // artiqPkgs;