Merge pull request #135041 from qowoz/go-buildflags

This commit is contained in:
Sandro 2021-08-21 20:40:18 +02:00 committed by GitHub
commit a7a97c9a97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 56 additions and 56 deletions

View file

@ -16,9 +16,9 @@ buildGoModule rec {
vendorSha256 = "sha256-XBfTVd3X3IDxLCAaNnijf6E5bw+AZ94UdOG9w7BOdBU=";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/achannarasappa/ticker/cmd.Version=v${version}")
'';
ldflags = [
"-s" "-w" "-X github.com/achannarasappa/ticker/cmd.Version=v${version}"
];
# Tests require internet
doCheck = false;

View file

@ -17,10 +17,10 @@ buildGoModule rec {
excludedPackages = "\\(tools\\|docgen\\)";
preBuild = let t = "github.com/rancher/k3d/v4/version"; in
''
buildFlagsArray+=("-ldflags" "-s -w -X ${t}.Version=v${version} -X ${t}.K3sVersion=v${k3sVersion}")
'';
ldflags = let t = "github.com/rancher/k3d/v4/version"; in
[
"-s" "-w" "-X ${t}.Version=v${version}" "-X ${t}.K3sVersion=v${k3sVersion}"
];
doCheck = false;

View file

@ -13,9 +13,9 @@ buildGoModule rec {
vendorSha256 = "sha256-EM0lPwwWJuLD+aqZWshz1ILaeEtUU4wJ0Puwv1Ikgf4=";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w")
'';
ldflags = [
"-s" "-w"
];
meta = with lib; {
homepage = "https://github.com/aquasecurity/starboard-octant-plugin";

View file

@ -16,9 +16,9 @@ buildGoModule rec {
# Don't build and check the integration tests
excludedPackages = "itest";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
'';
ldflags = [
"-s" "-w" "-X main.version=v${version}"
];
preCheck = ''
# Remove test that requires networking

View file

@ -9,9 +9,9 @@ buildGoModule rec {
doCheck = false;
preBuild = ''
buildFlagsArray+=("-ldflags" "-X main.version=${version}")
'';
ldflags = [
"-X main.version=${version}"
];
src = fetchFromGitHub {
owner = "drone";

View file

@ -16,9 +16,9 @@ buildGoModule rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ btrfs-progs lvm2 ];
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X main.version=${version}")
'';
ldflags = [
"-s" "-w" "-X main.version=${version}"
];
preCheck = ''
# Remove tests that use networking

View file

@ -19,9 +19,9 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ];
preBuild = ''
buildFlagsArray+=("-ldflags=-s -w -X main.version=${version} -X main.commit=v${version} -X main.date=19700101-00:00:00")
'';
ldflags = [
"-s" "-w" "-X main.version=${version}" "-X main.commit=v${version}" "-X main.date=19700101-00:00:00"
];
postInstall = ''
for shell in bash zsh; do

View file

@ -18,9 +18,9 @@ buildGoModule rec {
vendorSha256 = "sha256-J48ezMi9+PxohDKFhBpbcu6fdojlZPXnQQw2IcyimTA=";
proxyVendor = true;
preBuild = ''
buildFlagsArray+=("-ldflags=-w -s -X main.version=${version}")
'';
ldflags = [
"-w" "-s" "-X main.version=${version}"
];
passthru.tests = { inherit (nixosTests) telegraf; };

View file

@ -15,9 +15,9 @@ buildGoModule rec {
excludedPackages = "misc";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
'';
ldflags = [
"-s" "-w" "-X main.version=v${version}"
];
doInstallCheck = true;
installCheckPhase = ''

View file

@ -14,10 +14,10 @@ buildGoPackage rec {
sha256 = "1wdlblj127skgynf9amk7waabc3abbyxys9dvyc6c72zpcpdy5nc";
};
preBuild = ''
# TODO: is there a way to get the commit ref so we can set main.buildCommit?
buildFlagsArray+=("-ldflags" "-X main.buildDate=1970-01-01T00:00:00+0000 -X main.buildVersion=${version}")
'';
# TODO: is there a way to get the commit ref so we can set main.buildCommit?
ldflags = [
"-X main.buildDate=1970-01-01T00:00:00+0000" "-X main.buildVersion=${version}"
];
meta = {
description = "A go rewrite of envdir";

View file

@ -14,9 +14,9 @@ buildGoModule rec {
vendorSha256 = "1lyqjkwj8hybj5swyrv6357hs8sxmf4wim0c8yhfb9mv7fsxhrv7";
CGO_ENABLED = 0;
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
'';
ldflags = [
"-s" "-w" "-X main.version=v${version}"
];
meta = with lib; {
homepage = "https://github.com/aelsabbahy/goss/";

View file

@ -16,9 +16,9 @@ buildGoPackage rec {
goPackagePath = "github.com/variadico/noti";
preBuild = ''
buildFlagsArray+=("-ldflags" "-X ${goPackagePath}/internal/command.Version=${version}")
'';
ldflags = [
"-X ${goPackagePath}/internal/command.Version=${version}"
];
postInstall = ''
install -Dm444 -t $out/share/man/man1 $src/docs/man/*.1

View file

@ -20,9 +20,9 @@ buildGoModule rec {
doCheck = false;
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X moul.io/assh/v2/pkg/version.Version=${version}")
'';
ldflags = [
"-s" "-w" "-X moul.io/assh/v2/pkg/version.Version=${version}"
];
nativeBuildInputs = [ makeWrapper ];

View file

@ -16,9 +16,9 @@ buildGoModule rec {
vendorSha256 = "sha256-Cc4DJPpOMHxDcH22S7znYo7QHNRXv8jOJhznu09kaE4=";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}")
'';
ldflags = [
"-s" "-w" "-X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}"
];
meta = with lib; {
description = "Scan git repos (or files) for secrets";

View file

@ -19,9 +19,9 @@ buildGoModule rec {
propagatedBuildInputs = [ docker ];
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/anchore/grype/internal/version.version=${version}")
'';
ldflags = [
"-s" "-w" "-X github.com/anchore/grype/internal/version.version=${version}"
];
# Tests require a running Docker instance
doCheck = false;

View file

@ -16,9 +16,9 @@ buildGoModule rec {
vendorSha256 = "1nczzzsnh38qi949ki5268y39ggkwncanc1pv7727qpwllzl62vy";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=${version}")
'';
ldflags = [
"-s" "-w" "-X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=${version}"
];
subPackages = [ "./cmd/kiterunner" ];

View file

@ -18,9 +18,9 @@ buildGoPackage rec {
goPackagePath = "github.com/starkandwayne/safe";
preBuild = ''
buildFlagsArray+=("-ldflags" "-X main.Version=${version}")
'';
ldflags = [
"-X main.Version=${version}"
];
meta = with lib; {
description = "A Vault CLI";

View file

@ -16,9 +16,9 @@ buildGoModule rec {
vendorSha256 = "sha256-TQjwPem+RMuoF5T02CL/CTvBS6W7Q786gTvYUFIvxjE=";
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X ktbs.dev/teler/common.Version=${version}")
'';
ldflags = [
"-s" "-w" "-X ktbs.dev/teler/common.Version=${version}"
];
# test require internet access
doCheck = false;