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