1
0
Fork 0

cleanup, support retrieving ARTIQ version for non-hydra build

This commit is contained in:
Sebastien Bourdeauducq 2019-04-24 15:05:29 +08:00
parent 7aaac042f6
commit 4a137f2c58
7 changed files with 26 additions and 16 deletions

View File

@ -23,7 +23,7 @@ let
};
}) {} boards;
manualPackages = import ./pkgs/artiq-manual.nix {
inherit stdenv lib fetchgit python3Packages texlive texinfo;
inherit stdenv lib fetchgit git python3Packages texlive texinfo;
inherit (pythonDeps) sphinxcontrib-wavedrom;
};
mainPackages = rec {

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchgit, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
let
artiqVersion = import ./artiq-version.nix;
artiqVersion = import ./artiq-version.nix { inherit stdenv fetchgit git; };
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
@ -26,7 +26,7 @@ let
preBuild = ''
export VERSIONEER_OVERRIDE=${artiqVersion}
export SOURCE_DATE_EPOCH=${import ./artiq-timestamp.nix}
export SOURCE_DATE_EPOCH=${import ./artiq-timestamp.nix { inherit stdenv fetchgit git; }}
cd doc/manual
'';
makeFlags = [ target ];

View File

@ -1,16 +1,13 @@
let pkgs = import <nixpkgs> {};
in
with pkgs;
{ stdenv, git, fetchgit }:
let
artiq-timestamp = stdenv.mkDerivation {
name = "artiq-timestamp";
src = import ./artiq-src.nix { inherit fetchgit; };
buildInputs = [ git ];
buildPhase = ''
TIMESTAMP=`${git}/bin/git log -1 --format=%ct`
'';
installPhase = ''
echo \"$TIMESTAMP\" > $out
echo -n $TIMESTAMP > $out
'';
};
in

View File

@ -1 +1,14 @@
"5e.localdev"
{ stdenv, git, fetchgit }:
let
artiq-version = stdenv.mkDerivation {
name = "artiq-version";
src = import ./artiq-src.nix { inherit fetchgit; };
buildPhase = ''
REV=`${git}/bin/git rev-parse HEAD`
'';
installPhase = ''
echo -n 5e.`cut -c1-8 <<< $REV` > $out
'';
};
in
builtins.readFile artiq-version

View File

@ -1,11 +1,11 @@
{ stdenv, callPackage, fetchgit, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
{ stdenv, callPackage, fetchgit, git, python3Packages, qt5Full, binutils-or1k, 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;
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; };
preBuild = "export VERSIONEER_OVERRIDE=${version}";
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ]

View File

@ -1,7 +1,7 @@
{ stdenv, fetchgit, rustc }:
{ stdenv, fetchgit, git, rustc }:
stdenv.mkDerivation rec {
name = "libartiq-support-${version}";
version = import ./artiq-version.nix;
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
src = import ./artiq-src.nix { inherit fetchgit; };
phases = [ "buildPhase" ];
# keep in sync with artiq/test/lit/lit.cfg or remove build from the latter once we don't use buildbot/conda anymore

View File

@ -20,8 +20,8 @@ let
sha256 = "$HASH";
}
EOF
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix
echo \"$TIMESTAMP\" > $out/pkgs/artiq-timestamp.nix
echo "{ stdenv, git, fetchgit }: \"5e.`cut -c1-8 <<< $REV`\"" > $out/pkgs/artiq-version.nix
echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix
'';
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
''