add a dummy artiq-timestamp.nix, generate through main.nix, use in artiq-manual.nix
This commit is contained in:
parent
22ba790a3c
commit
e75355c6c8
@ -23,7 +23,7 @@ let
|
||||
};
|
||||
}) {} boards;
|
||||
manualPackages = import ./pkgs/artiq-manual.nix {
|
||||
inherit stdenv lib fetchgit git python3Packages texlive texinfo;
|
||||
inherit stdenv lib fetchgit python3Packages texlive texinfo;
|
||||
inherit (pythonDeps) sphinxcontrib-wavedrom;
|
||||
};
|
||||
mainPackages = rec {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
|
||||
{ stdenv, lib, fetchgit, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
|
||||
|
||||
let
|
||||
artiqVersion = import ./artiq-version.nix;
|
||||
@ -18,7 +18,6 @@ let
|
||||
|
||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||
buildInputs = [
|
||||
git
|
||||
python3Packages.sphinx python3Packages.sphinx_rtd_theme
|
||||
python3Packages.sphinx-argparse sphinxcontrib-wavedrom
|
||||
] ++
|
||||
@ -27,7 +26,7 @@ let
|
||||
|
||||
preBuild = ''
|
||||
export VERSIONEER_OVERRIDE=${artiqVersion}
|
||||
export SOURCE_DATE_EPOCH=`${git}/bin/git log -1 --format=%ct`
|
||||
export SOURCE_DATE_EPOCH=${import ./artiq-timestamp.nix {}}
|
||||
cd doc/manual
|
||||
'';
|
||||
makeFlags = [ target ];
|
||||
|
16
artiq/pkgs/artiq-timestamp.nix
Normal file
16
artiq/pkgs/artiq-timestamp.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
with pkgs;
|
||||
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
|
||||
'';
|
||||
};
|
||||
in
|
||||
builtins.readFile artiq-timestamp
|
2
main.nix
2
main.nix
@ -5,6 +5,7 @@ let
|
||||
''
|
||||
cp --no-preserve=mode,ownership -R ${./artiq} $out
|
||||
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
|
||||
TIMESTAMP=`git log -1 --format=%ct`
|
||||
ARTIQ_SRC_CLEAN=`mktemp -d`
|
||||
cp -a ${artiqSrc}/. $ARTIQ_SRC_CLEAN
|
||||
chmod -R 755 $ARTIQ_SRC_CLEAN/.git
|
||||
@ -20,6 +21,7 @@ let
|
||||
}
|
||||
EOF
|
||||
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix
|
||||
echo \"$TIMESTAMP\" > $out/pkgs/artiq-timestamp.nix
|
||||
'';
|
||||
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user