1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-19 17:39:34 +00:00

corerad: set linkTimestamp from file in repository root

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2020-06-24 23:51:22 -04:00
parent 10f75b2fed
commit 477cf953be
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94

View file

@ -13,10 +13,16 @@ buildGoModule rec {
vendorSha256 = "19hp8xqr50v8h9vblihalvkb9ll8c0v4p071j9j1zkbjhnb07rca";
buildFlagsArray = ''
-ldflags=
-X github.com/mdlayher/corerad/internal/build.linkTimestamp=1593050100
-X github.com/mdlayher/corerad/internal/build.linkVersion=v${version}
# Since the tarball pulled from GitHub doesn't contain git tag information,
# we fetch the expected tag's timestamp from a file in the root of the
# repository.
preBuild = ''
buildFlagsArray=(
-ldflags="
-X github.com/mdlayher/corerad/internal/build.linkTimestamp=$(<.gittagtime)
-X github.com/mdlayher/corerad/internal/build.linkVersion=v${version}
"
)
'';
passthru.tests = {