Merge pull request #135041 from qowoz/go-buildflags
This commit is contained in:
commit
a7a97c9a97
18 changed files with 56 additions and 56 deletions
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorSha256 = "sha256-XBfTVd3X3IDxLCAaNnijf6E5bw+AZ94UdOG9w7BOdBU=";
|
vendorSha256 = "sha256-XBfTVd3X3IDxLCAaNnijf6E5bw+AZ94UdOG9w7BOdBU=";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X github.com/achannarasappa/ticker/cmd.Version=v${version}")
|
"-s" "-w" "-X github.com/achannarasappa/ticker/cmd.Version=v${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
# Tests require internet
|
# Tests require internet
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
|
@ -17,10 +17,10 @@ buildGoModule rec {
|
||||||
|
|
||||||
excludedPackages = "\\(tools\\|docgen\\)";
|
excludedPackages = "\\(tools\\|docgen\\)";
|
||||||
|
|
||||||
preBuild = let t = "github.com/rancher/k3d/v4/version"; in
|
ldflags = let t = "github.com/rancher/k3d/v4/version"; in
|
||||||
''
|
[
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X ${t}.Version=v${version} -X ${t}.K3sVersion=v${k3sVersion}")
|
"-s" "-w" "-X ${t}.Version=v${version}" "-X ${t}.K3sVersion=v${k3sVersion}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorSha256 = "sha256-EM0lPwwWJuLD+aqZWshz1ILaeEtUU4wJ0Puwv1Ikgf4=";
|
vendorSha256 = "sha256-EM0lPwwWJuLD+aqZWshz1ILaeEtUU4wJ0Puwv1Ikgf4=";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w")
|
"-s" "-w"
|
||||||
'';
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/aquasecurity/starboard-octant-plugin";
|
homepage = "https://github.com/aquasecurity/starboard-octant-plugin";
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
# Don't build and check the integration tests
|
# Don't build and check the integration tests
|
||||||
excludedPackages = "itest";
|
excludedPackages = "itest";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
|
"-s" "-w" "-X main.version=v${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
# Remove test that requires networking
|
# Remove test that requires networking
|
||||||
|
|
|
@ -9,9 +9,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-X main.version=${version}")
|
"-X main.version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "drone";
|
owner = "drone";
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
nativeBuildInputs = [ pkg-config ];
|
nativeBuildInputs = [ pkg-config ];
|
||||||
buildInputs = [ btrfs-progs lvm2 ];
|
buildInputs = [ btrfs-progs lvm2 ];
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X main.version=${version}")
|
"-s" "-w" "-X main.version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
# Remove tests that use networking
|
# Remove tests that use networking
|
||||||
|
|
|
@ -19,9 +19,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags=-s -w -X main.version=${version} -X main.commit=v${version} -X main.date=19700101-00:00:00")
|
"-s" "-w" "-X main.version=${version}" "-X main.commit=v${version}" "-X main.date=19700101-00:00:00"
|
||||||
'';
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
for shell in bash zsh; do
|
for shell in bash zsh; do
|
||||||
|
|
|
@ -18,9 +18,9 @@ buildGoModule rec {
|
||||||
vendorSha256 = "sha256-J48ezMi9+PxohDKFhBpbcu6fdojlZPXnQQw2IcyimTA=";
|
vendorSha256 = "sha256-J48ezMi9+PxohDKFhBpbcu6fdojlZPXnQQw2IcyimTA=";
|
||||||
proxyVendor = true;
|
proxyVendor = true;
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags=-w -s -X main.version=${version}")
|
"-w" "-s" "-X main.version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
passthru.tests = { inherit (nixosTests) telegraf; };
|
passthru.tests = { inherit (nixosTests) telegraf; };
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
excludedPackages = "misc";
|
excludedPackages = "misc";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
|
"-s" "-w" "-X main.version=v${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
installCheckPhase = ''
|
installCheckPhase = ''
|
||||||
|
|
|
@ -14,10 +14,10 @@ buildGoPackage rec {
|
||||||
sha256 = "1wdlblj127skgynf9amk7waabc3abbyxys9dvyc6c72zpcpdy5nc";
|
sha256 = "1wdlblj127skgynf9amk7waabc3abbyxys9dvyc6c72zpcpdy5nc";
|
||||||
};
|
};
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
# TODO: is there a way to get the commit ref so we can set main.buildCommit?
|
# 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}")
|
ldflags = [
|
||||||
'';
|
"-X main.buildDate=1970-01-01T00:00:00+0000" "-X main.buildVersion=${version}"
|
||||||
|
];
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A go rewrite of envdir";
|
description = "A go rewrite of envdir";
|
||||||
|
|
|
@ -14,9 +14,9 @@ buildGoModule rec {
|
||||||
vendorSha256 = "1lyqjkwj8hybj5swyrv6357hs8sxmf4wim0c8yhfb9mv7fsxhrv7";
|
vendorSha256 = "1lyqjkwj8hybj5swyrv6357hs8sxmf4wim0c8yhfb9mv7fsxhrv7";
|
||||||
|
|
||||||
CGO_ENABLED = 0;
|
CGO_ENABLED = 0;
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X main.version=v${version}")
|
"-s" "-w" "-X main.version=v${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/aelsabbahy/goss/";
|
homepage = "https://github.com/aelsabbahy/goss/";
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoPackage rec {
|
||||||
|
|
||||||
goPackagePath = "github.com/variadico/noti";
|
goPackagePath = "github.com/variadico/noti";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-X ${goPackagePath}/internal/command.Version=${version}")
|
"-X ${goPackagePath}/internal/command.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -Dm444 -t $out/share/man/man1 $src/docs/man/*.1
|
install -Dm444 -t $out/share/man/man1 $src/docs/man/*.1
|
||||||
|
|
|
@ -20,9 +20,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X moul.io/assh/v2/pkg/version.Version=${version}")
|
"-s" "-w" "-X moul.io/assh/v2/pkg/version.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorSha256 = "sha256-Cc4DJPpOMHxDcH22S7znYo7QHNRXv8jOJhznu09kaE4=";
|
vendorSha256 = "sha256-Cc4DJPpOMHxDcH22S7znYo7QHNRXv8jOJhznu09kaE4=";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}")
|
"-s" "-w" "-X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Scan git repos (or files) for secrets";
|
description = "Scan git repos (or files) for secrets";
|
||||||
|
|
|
@ -19,9 +19,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
propagatedBuildInputs = [ docker ];
|
propagatedBuildInputs = [ docker ];
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X github.com/anchore/grype/internal/version.version=${version}")
|
"-s" "-w" "-X github.com/anchore/grype/internal/version.version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
# Tests require a running Docker instance
|
# Tests require a running Docker instance
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorSha256 = "1nczzzsnh38qi949ki5268y39ggkwncanc1pv7727qpwllzl62vy";
|
vendorSha256 = "1nczzzsnh38qi949ki5268y39ggkwncanc1pv7727qpwllzl62vy";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=${version}")
|
"-s" "-w" "-X github.com/assetnote/kiterunner/cmd/kiterunner/cmd.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
subPackages = [ "./cmd/kiterunner" ];
|
subPackages = [ "./cmd/kiterunner" ];
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ buildGoPackage rec {
|
||||||
|
|
||||||
goPackagePath = "github.com/starkandwayne/safe";
|
goPackagePath = "github.com/starkandwayne/safe";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-X main.Version=${version}")
|
"-X main.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A Vault CLI";
|
description = "A Vault CLI";
|
||||||
|
|
|
@ -16,9 +16,9 @@ buildGoModule rec {
|
||||||
|
|
||||||
vendorSha256 = "sha256-TQjwPem+RMuoF5T02CL/CTvBS6W7Q786gTvYUFIvxjE=";
|
vendorSha256 = "sha256-TQjwPem+RMuoF5T02CL/CTvBS6W7Q786gTvYUFIvxjE=";
|
||||||
|
|
||||||
preBuild = ''
|
ldflags = [
|
||||||
buildFlagsArray+=("-ldflags" "-s -w -X ktbs.dev/teler/common.Version=${version}")
|
"-s" "-w" "-X ktbs.dev/teler/common.Version=${version}"
|
||||||
'';
|
];
|
||||||
|
|
||||||
# test require internet access
|
# test require internet access
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
Loading…
Reference in a new issue