mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 11:12:16 +00:00
Fix missing git revision when built with Nix. (#680)
This commit is contained in:
parent
1696ebfa20
commit
f8b585df39
2 changed files with 7 additions and 0 deletions
|
@ -50,6 +50,9 @@
|
||||||
"-static-libstdc++"
|
"-static-libstdc++"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
GIT_REVISION = if self ? rev then self.rev else "dirty";
|
||||||
|
GIT_REVISION_DATE = (builtins.concatStringsSep "-" (builtins.match "(.{4})(.{2})(.{2}).*" self.lastModifiedDate)) + " " + (builtins.concatStringsSep ":" (builtins.match "^........(.{2})(.{2})(.{2}).*" self.lastModifiedDate));
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
moveToOutput bin "$bin"
|
moveToOutput bin "$bin"
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -139,6 +139,8 @@ function(GetGitState _working_dir)
|
||||||
RunGitCommand(show -s "--format=%H" ${object})
|
RunGitCommand(show -s "--format=%H" ${object})
|
||||||
if(exit_code EQUAL 0)
|
if(exit_code EQUAL 0)
|
||||||
set(ENV{GIT_HEAD_SHA1} ${output})
|
set(ENV{GIT_HEAD_SHA1} ${output})
|
||||||
|
else()
|
||||||
|
set(ENV{GIT_HEAD_SHA1} "$ENV{GIT_REVISION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
RunGitCommand(show -s "--format=%an" ${object})
|
RunGitCommand(show -s "--format=%an" ${object})
|
||||||
|
@ -154,6 +156,8 @@ function(GetGitState _working_dir)
|
||||||
RunGitCommand(show -s "--format=%ci" ${object})
|
RunGitCommand(show -s "--format=%ci" ${object})
|
||||||
if(exit_code EQUAL 0)
|
if(exit_code EQUAL 0)
|
||||||
set(ENV{GIT_COMMIT_DATE_ISO8601} "${output}")
|
set(ENV{GIT_COMMIT_DATE_ISO8601} "${output}")
|
||||||
|
else()
|
||||||
|
set(ENV{GIT_COMMIT_DATE_ISO8601} "$ENV{GIT_REVISION_DATE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
RunGitCommand(show -s "--format=%s" ${object})
|
RunGitCommand(show -s "--format=%s" ${object})
|
||||||
|
|
Loading…
Reference in a new issue