2019-04-24 15:05:29 +08:00
|
|
|
{ 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`
|
2019-05-06 23:09:11 +08:00
|
|
|
COMMITCOUNT=`${git}/bin/git rev-list --count HEAD`
|
2019-04-24 15:05:29 +08:00
|
|
|
'';
|
|
|
|
installPhase = ''
|
2019-05-06 23:09:11 +08:00
|
|
|
echo -n 5.$COMMITCOUNT.`cut -c1-8 <<< $REV`-beta > $out
|
2019-04-24 15:05:29 +08:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
builtins.readFile artiq-version
|