treewide: move CGO_* env vars into env for structuredAttrs (#492191)

This commit is contained in:
Jo
2026-02-20 11:41:05 +00:00
committed by GitHub
13 changed files with 39 additions and 24 deletions
+6 -4
View File
@@ -26,10 +26,12 @@ buildGoModule (finalAttrs: {
proxyVendor = true;
vendorHash = "sha256-0+YwlCHjiU46y333RSuaha4pLKFTYlj+M9+TFAALamY=";
# Fix error: 'Caught SIGILL in blst_cgo_init'
# https://github.com/bnb-chain/bsc/issues/1521
CGO_CFLAGS = "-O -D__BLST_PORTABLE__";
CGO_CFLAGS_ALLOW = "-O -D__BLST_PORTABLE__";
env = {
# Fix error: 'Caught SIGILL in blst_cgo_init'
# https://github.com/bnb-chain/bsc/issues/1521
CGO_CFLAGS = "-O -D__BLST_PORTABLE__";
CGO_CFLAGS_ALLOW = "-O -D__BLST_PORTABLE__";
};
ldflags = [
"-s"
+1 -1
View File
@@ -49,7 +49,7 @@ buildGoModule rec {
"-X github.com/trezor/blockbook/common.buildDate=unknown"
];
CGO_LDFLAGS = [
env.CGO_LDFLAGS = toString [
"-L${lib.getLib stdenv.cc.cc}/lib"
"-lrocksdb"
"-lz"
@@ -20,7 +20,7 @@ buildGoModule (finalAttrs: {
buildInputs = [ systemdLibs ];
CGO_CFLAGS = "-I ${systemdLibs}/include";
env.CGO_CFLAGS = "-I ${systemdLibs}/include";
ldflags = [
"-extldflags='-Wl,-z,lazy'"
+5 -1
View File
@@ -52,7 +52,11 @@ buildGoModule rec {
glibc
];
CGO_LDFLAGS = "-lpcap -lpthread -static";
env.CGO_LDFLAGS = toString [
"-lpcap"
"-lpthread"
"-static"
];
ldflags = [
"-extldflags '-static'"
+1 -1
View File
@@ -20,7 +20,7 @@ buildGoModule (finalAttrs: {
subPackages = [ "cmd/exportarr" ];
CGO_ENABLE = 0;
env.CGO_ENABLE = 0;
ldflags = [
"-s"
+1 -1
View File
@@ -109,7 +109,7 @@ buildGoModule (finalAttrs: {
tags = [ "libsqlite3" ];
# required for go-cowsql.
CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
env.CGO_LDFLAGS_ALLOW = "(-Wl,-wrap,pthread_create)|(-Wl,-z,now)";
# add our lxc location to incus's acceptable rootFsPaths
# this is necessary for tmpfs/tmpfs-overlay to work
+3 -1
View File
@@ -42,7 +42,9 @@ buildGoModule rec {
tags = lib.optional withGoolm "goolm";
CGO_LDFLAGS = lib.optional withGoolm [ cppStdLib ];
env = lib.optionalAttrs withGoolm {
CGO_LDFLAGS = toString [ cppStdLib ];
};
vendorHash = "sha256-TFz5P8czj8J9+QTFHjffCldw8Je2+DiM49W7jv5rY/I=";
+3 -1
View File
@@ -64,7 +64,9 @@ buildGoModule (finalAttrs: {
"-X github.com/navidrome/navidrome/consts.gitTag=v${finalAttrs.version}"
];
CGO_CFLAGS = lib.optionals stdenv.cc.isGNU [ "-Wno-return-local-addr" ];
env = lib.optionalAttrs stdenv.cc.isGNU {
CGO_CFLAGS = toString [ "-Wno-return-local-addr" ];
};
postPatch = ''
patchShebangs ui/bin/update-workbox.sh
+14 -9
View File
@@ -40,22 +40,27 @@ buildGoModule (finalAttrs: {
];
ldflags = [
"-s -w"
"-s"
"-w"
];
tags = lib.optionals (!withDpi) [
"nodpi"
];
CGO_LDFLAGS = lib.optionalString withDpi ''
-L${ndpi}/lib -lndpi
-L${libprotoident}/lib -lndpi
'';
env = lib.optionalAttrs withDpi {
CGO_LDFLAGS = toString [
"-L${ndpi}/lib"
"-lndpi"
"-L${libprotoident}/lib"
"-lndpi"
];
CGO_CFLAGS = lib.optionalString withDpi ''
-I${ndpi}/include
-I${libprotoident}/include
'';
CGO_CFLAGS = toString [
"-I${ndpi}/include"
"-I${libprotoident}/include"
];
};
postInstall = ''
mv $out/bin/cmd $out/bin/net
@@ -19,7 +19,7 @@ buildGoModule rec {
hash = "sha256-NafQWP1NxHTwmOND8ovy3oVia7qq0rCwZYE3VNlMBKQ=";
};
CGO_LDFLAGS = "-ldcgm";
env.CGO_LDFLAGS = "-ldcgm";
buildInputs = [
dcgm
@@ -38,7 +38,7 @@ buildGoModule.override { stdenv = clangStdenv; } (finalAttrs: {
libz
];
CGO_LDFLAGS = "-l bpf";
env.CGO_LDFLAGS = "-l bpf";
hardeningDisable = [ "zerocallusedregs" ];
+1 -1
View File
@@ -42,7 +42,7 @@ buildGoModule rec {
"-X github.com/smallstep/step-kms-plugin/cmd.Version=${version}"
];
CGO_CFLAGS = "-I${lib.getDev pcsclite}/include/PCSC/";
env.CGO_CFLAGS = "-I${lib.getDev pcsclite}/include/PCSC/";
meta = {
description = "Step plugin to manage keys and certificates on cloud KMSs and HSMs";
+1 -1
View File
@@ -32,7 +32,7 @@ buildGoModule (finalAttrs: {
"-w"
];
CGO_CFLAGS = [ "-Wno-format-security" ];
env.CGO_CFLAGS = toString [ "-Wno-format-security" ];
preCheck = ''
# Remove tests that require additional services.