add a dummy artiq-timestamp.nix, generate through main.nix, use in artiq-manual.nix

This commit is contained in:
Astro 2019-04-23 22:07:43 +02:00
parent 22ba790a3c
commit e75355c6c8
4 changed files with 21 additions and 4 deletions

View File

@ -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 {

View File

@ -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 ];

View 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

View File

@ -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 ]; }
''