forked from M-Labs/nix-scripts
cleanup, support retrieving ARTIQ version for non-hydra build
This commit is contained in:
parent
7aaac042f6
commit
4a137f2c58
|
@ -23,7 +23,7 @@ let
|
||||||
};
|
};
|
||||||
}) {} boards;
|
}) {} boards;
|
||||||
manualPackages = import ./pkgs/artiq-manual.nix {
|
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;
|
inherit (pythonDeps) sphinxcontrib-wavedrom;
|
||||||
};
|
};
|
||||||
mainPackages = rec {
|
mainPackages = rec {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv, lib, fetchgit, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
|
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
|
||||||
|
|
||||||
let
|
let
|
||||||
artiqVersion = import ./artiq-version.nix;
|
artiqVersion = import ./artiq-version.nix { inherit stdenv fetchgit git; };
|
||||||
|
|
||||||
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
|
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ let
|
||||||
|
|
||||||
preBuild = ''
|
preBuild = ''
|
||||||
export VERSIONEER_OVERRIDE=${artiqVersion}
|
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
|
cd doc/manual
|
||||||
'';
|
'';
|
||||||
makeFlags = [ target ];
|
makeFlags = [ target ];
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
let pkgs = import <nixpkgs> {};
|
{ stdenv, git, fetchgit }:
|
||||||
in
|
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
artiq-timestamp = stdenv.mkDerivation {
|
artiq-timestamp = stdenv.mkDerivation {
|
||||||
name = "artiq-timestamp";
|
name = "artiq-timestamp";
|
||||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||||
buildInputs = [ git ];
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
TIMESTAMP=`${git}/bin/git log -1 --format=%ct`
|
TIMESTAMP=`${git}/bin/git log -1 --format=%ct`
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
echo \"$TIMESTAMP\" > $out
|
echo -n $TIMESTAMP > $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
let
|
||||||
pythonDeps = callPackage ./python-deps.nix {};
|
pythonDeps = callPackage ./python-deps.nix {};
|
||||||
in
|
in
|
||||||
python3Packages.buildPythonPackage rec {
|
python3Packages.buildPythonPackage rec {
|
||||||
name = "artiq-${version}";
|
name = "artiq-${version}";
|
||||||
version = import ./artiq-version.nix;
|
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
|
||||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||||
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
||||||
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ]
|
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv, fetchgit, rustc }:
|
{ stdenv, fetchgit, git, rustc }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "libartiq-support-${version}";
|
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; };
|
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||||
phases = [ "buildPhase" ];
|
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
|
# keep in sync with artiq/test/lit/lit.cfg or remove build from the latter once we don't use buildbot/conda anymore
|
||||||
|
|
4
main.nix
4
main.nix
|
@ -20,8 +20,8 @@ let
|
||||||
sha256 = "$HASH";
|
sha256 = "$HASH";
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix
|
echo "{ stdenv, git, fetchgit }: \"5e.`cut -c1-8 <<< $REV`\"" > $out/pkgs/artiq-version.nix
|
||||||
echo \"$TIMESTAMP\" > $out/pkgs/artiq-timestamp.nix
|
echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix
|
||||||
'';
|
'';
|
||||||
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
|
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in New Issue