Merge pull request #132959 from qowoz/gotags

This commit is contained in:
Sandro 2021-08-07 12:35:33 +02:00 committed by GitHub
commit 3f3e2da660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 22 deletions

View File

@ -30,11 +30,13 @@ buildGoModule rec {
subPackages = [ "." ];
preBuild = let t = "github.com/minio/minio/cmd"; in
''
export CGO_ENABLED=0
buildFlagsArray+=("-tags" "kqueue" "-ldflags" "-s -w -X ${t}.Version=${versionToTimestamp version} -X ${t}.ReleaseTag=RELEASE.${version} -X ${t}.CommitID=${src.rev}")
'';
CGO_ENABLED = 0;
tags = [ "kqueue" ];
ldflags = let t = "github.com/minio/minio/cmd"; in [
"-s" "-w" "-X ${t}.Version=${versionToTimestamp version}" "-X ${t}.ReleaseTag=RELEASE.${version}" "-X ${t}.CommitID=${src.rev}"
];
passthru.tests.minio = nixosTests.minio;

View File

@ -102,12 +102,12 @@ in buildGoModule {
go generate
popd
done
export buildFlagsArray=(
-tags="assets"
-ldflags="-X main.commit=${shorthash} -X main.version=${version}"
)
'';
tags = [ "assets" ];
ldflags = [ "-X main.commit=${shorthash}" "-X main.version=${version}" ];
meta = with lib; {
description = "An open-source distributed time series database";
license = licenses.mit;

View File

@ -21,12 +21,9 @@ buildGoModule rec {
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ];
preBuild = ''
export buildFlagsArray=(
-tags="xversion"
-ldflags="-X tailscale.com/version.Long=${version} -X tailscale.com/version.Short=${version}"
)
'';
tags = [ "xversion" ];
ldflags = [ "-X tailscale.com/version.Long=${version}" "-X tailscale.com/version.Short=${version}" ];
postInstall = ''
wrapProgram $out/bin/tailscaled --prefix PATH : ${

View File

@ -17,10 +17,9 @@ buildGoModule rec {
subPackages = [ "main/pg" ];
buildFlagsArray = [
"-tags=brotli libsodium"
"-ldflags=-s -w -X github.com/wal-g/wal-g/cmd/pg.WalgVersion=${version} -X github.com/wal-g/wal-g/cmd/pg.GitRevision=${src.rev}"
];
tags = [ "brotli" "libsodium" ];
ldflags = [ "-s" "-w" "-X github.com/wal-g/wal-g/cmd/pg.WalgVersion=${version}" "-X github.com/wal-g/wal-g/cmd/pg.GitRevision=${src.rev}" ];
postInstall = ''
mv $out/bin/pg $out/bin/wal-g

View File

@ -21,9 +21,8 @@ buildGoModule rec {
excludedPackages = "\\(copasetic\\)";
preBuild = ''
buildFlagsArray+=(${lib.optionalString pivKeySupport "-tags=pivkey"})
'';
tags = lib.optionals pivKeySupport [ "pivkey" ];
ldflags = [ "-s" "-w" "-X github.com/sigstore/cosign/cmd/cosign/cli.gitVersion=v${version}" ];
meta = with lib; {