treewide: manual fixups for

treewide: use toString on list NIX_CFLAGS_COMPILE
treewide: move NIX_CFLAGS_COMPILE to the env attrset
This commit is contained in:
Artturin 2023-02-20 17:17:34 +02:00
parent f9fdf2d402
commit 6b2a05e190
42 changed files with 72 additions and 71 deletions

View file

@ -60,7 +60,7 @@ See the `zlib` example:
(old: rec {
buildInputs = old.buildInputs ++ [ pkg-config ];
# we need to reset this setting!
NIX_CFLAGS_COMPILE="";
env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
configurePhase = ''
# FIXME: Some tests require writing at $HOME
HOME=$TMPDIR

View file

@ -1329,7 +1329,7 @@ bin/blib.a(bios_console.o): In function `bios_handle_cup':
Adds the `-O2 -D_FORTIFY_SOURCE=2` compiler options. During code generation the compiler knows a great deal of information about buffer sizes (where possible), and attempts to replace insecure unlimited length buffer function calls with length-limited ones. This is especially useful for old, crufty code. Additionally, format strings in writable memory that contain `%n` are blocked. If an application depends on such a format string, it will need to be worked around.
Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set `NIX_CFLAGS_COMPILE` to `-Wno-error=warning-type`.
Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set `env.NIX_CFLAGS_COMPILE` to `-Wno-error=warning-type`.
This needs to be turned off or fixed for errors similar to:

View file

@ -35,8 +35,8 @@ stdenv.mkDerivation rec {
++ lib.optionals stdenv.isLinux [ "PLATFORM=DEB" ]
++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ];
env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ] ++
lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
env.NIX_CFLAGS_COMPILE = toString ([ "-fpermissive" ] ++
lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing");
NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation";

View file

@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
# the linux config works fine on darwin too!
buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";
NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
env.NIX_CFLAGS_COMPILE = "-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
installPhase = ''
mkdir -p $out/bin

View file

@ -11,7 +11,7 @@ mkDerivation rec {
buildInputs = [ qtbase qtscript poppler zlib qtwebengine ];
nativeBuildInputs = [ pkg-config poppler qmake ];
NIX_CFLAGS_COMPILE="-I${poppler.dev}/include/poppler";
env.NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler";
qmakeFlags = [
"DESKTOPDIR=${placeholder "out"}/share/applications"

View file

@ -33,8 +33,8 @@ mkDerivation rec {
xsimd
];
env.NIX_CFLAGS_COMPILE = toString [ "-I${ilmbase.dev}/include/OpenEXR" ]
++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy";
env.NIX_CFLAGS_COMPILE = toString ([ "-I${ilmbase.dev}/include/OpenEXR" ]
++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy");
# Krita runs custom python scripts in CMake with custom PYTHONPATH which krita determined in their CMake script.
# Patch the PYTHONPATH so python scripts can import sip successfully.

View file

@ -140,7 +140,7 @@ in stdenv.mkDerivation rec {
patchShebangs tools/get_wb_version.sh
'';
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations"
] ++ lib.optionals stdenv.isAarch64 [
@ -149,7 +149,7 @@ in stdenv.mkDerivation rec {
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but problematic with some old GCCs
"-Wno-error=maybe-uninitalized"
];
]);
cmakeFlags = [
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
buildInputs = [ SDL SDL_image ];
NIX_CFLAGS_COMPILE="-I${SDL}/include/SDL -I${SDL_image}/include/SDL";
env.NIX_CFLAGS_COMPILE = "-I${SDL}/include/SDL -I${SDL_image}/include/SDL";
meta = with lib; {
homepage = "https://brlcad.org/~erik/";

View file

@ -49,13 +49,13 @@ stdenv.mkDerivation {
"-DENABLE_UNICODE_DATABASE_DOWNLOAD=false"
];
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error"
] ++ lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [
# error: use of undeclared identifier 'aligned_alloc'
"-include mm_malloc.h"
"-Daligned_alloc=_mm_malloc"
];
]);
# https://github.com/NixOS/nixpkgs/issues/201254
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";

View file

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
"NSSHARED=${buildsystem}/share/netsurf-buildsystem"
];
NIX_CFLAGS_COMPILE= [ "-Wno-error=implicit-fallthrough" "-Wno-error=maybe-uninitialized" ];
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-fallthrough" "-Wno-error=maybe-uninitialized" ];
meta = with lib; {
homepage = "https://www.netsurf-browser.org/projects/${libname}/";

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
dontConfigure = true;
NIX_CFLAGS_COMPILE="-std=c++98";
env.NIX_CFLAGS_COMPILE = "-std=c++98";
installPhase = ''
runHook preInstall

View file

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
# Do not build static libraries
cmakeFlags = [ "-DENABLE_STATIC=NO" ];
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=cast-function-type"
"-Wno-error=deprecated-declarations"
"-Wno-error=format-truncation"
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but problematic with some old GCCs and probably clang
"-Wno-error=use-after-free"
];
]);
propagatedBuildInputs = [ libantlr3c mbedtls_2 bctoolbox belr ];

View file

@ -50,19 +50,21 @@ in
# invocation does not work.
hardeningDisable = [ "fortify" "pie" "stackprotector" ];
env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " "
(builtins.concatLists [
(lib.optionals withGd gdCflags)
# Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
# https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
(lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
(lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
# Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
# New warning as of GCC 9
# Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
"-Wno-error=missing-attributes"
])
]);
env = (previousAttrs.env or { }) // {
NIX_CFLAGS_COMPILE = (previousAttrs.env.NIX_CFLAGS_COMPILE or "") + lib.concatStringsSep " "
(builtins.concatLists [
(lib.optionals withGd gdCflags)
# Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
# https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
(lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
(lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
# Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
# New warning as of GCC 9
# Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
"-Wno-error=missing-attributes"
])
]);
};
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new

View file

@ -14,8 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook ];
# This problem is gone on libiscsi master.
env.NIX_CFLAGS_COMPILE =
lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare";
env.NIX_CFLAGS_COMPILE = toString (lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare");
meta = with lib; {
description = "iscsi client library and utilities";

View file

@ -103,14 +103,14 @@ stdenv.mkDerivation rec {
runHook postBuild
'';
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error"
"-DNIX_NSS_LIBDIR=\"${placeholder "out"}/lib/\""
] ++ lib.optionals stdenv.hostPlatform.is64bit [
"-DNSS_USE_64=1"
] ++ lib.optionals stdenv.hostPlatform.isILP32 [
"-DNS_PTR_LE_32=1" # See RNG_RandomUpdate() in drdbg.c
];
]);
installPhase = ''
runHook preInstall

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation {
--replace g++ c++
'';
NIX_CFLAGS_COMPILE=''-I${ilmbase.dev}/include/OpenEXR
env.NIX_CFLAGS_COMPILE = ''-I${ilmbase.dev}/include/OpenEXR
-I${openexr.dev}/include/OpenEXR
-I${openfx.dev}/include/OpenFX
'';

View file

@ -35,7 +35,7 @@ qtModule {
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
];
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
# with gcc7 this warning blows the log over Hydra's limit
"-Wno-expansion-to-defined"
]
@ -43,7 +43,7 @@ qtModule {
++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
# with clang this warning blows the log over Hydra's limit
++ lib.optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
++ lib.optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"'';
++ lib.optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"'');
doCheck = false; # fails 13 out of 13 tests (ctest)

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "14713pbscysd6d0b9rgm7gg145jzwvgdn22778pf2v13qzvfmy1i";
};
NIX_CFLAGS_COMPILE="-fpermissive";
env.NIX_CFLAGS_COMPILE = "-fpermissive";
configurePhase = ''
./configure -prefix $out

View file

@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
export NIX_LDFLAGS="$NIX_LDFLAGS -lm"
echo ""
echo "env.NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
echo "NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
echo ""
'';

View file

@ -213,11 +213,11 @@ in buildPythonPackage rec {
#
# Also of interest: pytorch ignores CXXFLAGS uses CFLAGS for both C and C++:
# https://github.com/pytorch/pytorch/blob/v1.11.0/setup.py#L17
env.NIX_CFLAGS_COMPILE = lib.optionals (blas.implementation == "mkl") [ "-Wno-error=array-bounds" ]
env.NIX_CFLAGS_COMPILE = toString ((lib.optionals (blas.implementation == "mkl") [ "-Wno-error=array-bounds" ]
# Suppress gcc regression: avx512 math function raises uninitialized variable warning
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593
# See also: Fails to compile with GCC 12.1.0 https://github.com/pytorch/pytorch/issues/77939
++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=maybe-uninitialized" "-Wno-error=uninitialized" ];
++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=maybe-uninitialized" "-Wno-error=uninitialized" ]));
nativeBuildInputs = [
cmake

View file

@ -21,13 +21,13 @@ in stdenv.mkDerivation rec {
++ lib.optionals stdenv.isDarwin [ Carbon AppKit freetype ]
++ lib.optionals stdenv.isLinux [ gtk3 tbb dbus ];
env.NIX_CFLAGS_COMPILE = toString [ ]
env.NIX_CFLAGS_COMPILE = toString ([ ]
# Apple's compiler finds a format string security error on
# ../../../server/TracyView.cpp:649:34, preventing building.
++ lib.optional stdenv.isDarwin "-Wno-format-security"
++ lib.optional stdenv.isLinux "-ltbb"
++ lib.optional stdenv.cc.isClang "-faligned-allocation"
++ lib.optional disableLTO "-fno-lto";
++ lib.optional disableLTO "-fno-lto");
NIX_CFLAGS_LINK = lib.optional disableLTO "-fno-lto";

View file

@ -23,7 +23,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ pkg-config makeWrapper ];
NIX_CFLAGS_COMPILE="-include ${zlib.dev}/include/zlib.h";
env.NIX_CFLAGS_COMPILE = "-include ${zlib.dev}/include/zlib.h";
postInstall = ''
mkdir -p $out/share/naev

View file

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
# gcc-10. Otherwise build fails as:
# ld: world.o:/build/tf-50b8/src/socket.h:24: multiple definition of
# `world_decl'; command.o:/build/tf-50b8/src/socket.h:24: first defined here
NIX_CFLAGS_COMPILE="-fcommon";
env.NIX_CFLAGS_COMPILE = "-fcommon";
meta = {
homepage = "https://tinyfugue.sourceforge.net/";

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [libX11 libXt libXaw libXpm libXext];
nativeBuildInputs = [imake];
NIX_CFLAGS_COMPILE=" -isystem ${libXpm.dev}/include/X11 ";
env.NIX_CFLAGS_COMPILE = " -isystem ${libXpm.dev}/include/X11 ";
preConfigure = ''
sed -e "s@/usr/@$out/share/@g" -i src/Imakefile

View file

@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
];
# Fix SDL include problems
NIX_CFLAGS_COMPILE="-I${lib.getDev SDL}/include/SDL -I${SDL_image}/include/SDL";
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL -I${SDL_image}/include/SDL";
# Fix linking errors
makeFlags = [
"ZAZ_LIBS+=-lSDL"

View file

@ -12,7 +12,7 @@ appleDerivation {
# env.NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__"
# + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__"
# + lib.optionalString hostPlatform.isAarch32 "-D__arm__";
env.NIX_CFLAGS_COMPILE = toString [ "-DDAEMON_UID=1"
env.NIX_CFLAGS_COMPILE = toString ([ "-DDAEMON_UID=1"
"-DDAEMON_GID=1"
"-DDEFAULT_AT_QUEUE='a'"
"-DDEFAULT_BATCH_QUEUE='b'"
@ -28,7 +28,7 @@ appleDerivation {
"-DAHZV1=64 "
"-DAU_SESSION_FLAG_HAS_TTY=0x4000"
"-DAU_SESSION_FLAG_HAS_AUTHENTICATED=0x4000"
] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ ";
] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ ");
patchPhase = ''
substituteInPlace login.tproj/login.c \

View file

@ -20,7 +20,7 @@ appleDerivation {
done
'';
NIX_CFLAGS_COMPILE=[ "-Wno-error=format-security" ]; # hardeningDisable doesn't cut it
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=format-security" ]; # hardeningDisable doesn't cut it
meta = {
platforms = lib.platforms.darwin;

View file

@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
patches = [ ./pci.patch ];
NIX_CFLAGS_COMPILE="-Wno-error=implicit-fallthrough";
env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
postInstall = ''
cd ../

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "pic" "format" ];
NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types";
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
makeFlags = [
"ARCH=${stdenv.hostPlatform.linuxArch}"

View file

@ -102,7 +102,7 @@ stdenv.mkDerivation {
# gcc-10. Otherwise build fails as:
# ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of
# `e820_types'; memory.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: first defined here
NIX_CFLAGS_COMPILE="-fcommon";
env.NIX_CFLAGS_COMPILE = "-fcommon";
makeFlags = [
"BINDIR=$(out)/bin"

View file

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
'';
# fix build on gcc7+ and gcc11+
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-std=c++11" # c++17+ has errors
"-Wno-error=builtin-declaration-mismatch"
"-Wno-error=deprecated-copy"
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
"-Wno-error=nonnull"
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
"-Wno-error=mismatched-new-delete"
];
]);
buildPhase = ''jam "-j$NIX_BUILD_CORES" '';
installPhase = ''

View file

@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
hardeningEnable = [ "pie" ];
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" ]
++ lib.optional stdenv.isDarwin "-Wno-error";
env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-error=deprecated-declarations" ]
++ lib.optional stdenv.isDarwin "-Wno-error");
meta = with lib; {
description = "A distributed memory object caching system";

View file

@ -75,13 +75,13 @@ in stdenv.mkDerivation {
enableParallelBuilding = true;
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=format-truncation"
"-Wno-error=stringop-truncation"
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but unrecognized with GCC 9
"-Wno-error=use-after-free"
];
]);
configureFlags = [
# disable dvbscan, as having it enabled causes a network download which

View file

@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
"-Dversion=${version}"
];
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
# Needed with GCC 12
"-Wno-error=address"
] ++ lib.optionals stdenv.isDarwin [
@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
"-Wno-array-bounds"
"-Wno-free-nonheap-object"
"-Wno-stringop-truncation"
];
]);
passthru = {
updateScript = nix-update-script { };

View file

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
# gcc-10. Otherwise build fails as:
# ld: svnclient.o:/build/svnfs-0.4/src/svnfs.h:40: multiple definition of
# `dirbuf'; svnfs.o:/build/svnfs-0.4/src/svnfs.h:40: first defined here
NIX_CFLAGS_COMPILE="-I ${subversion.dev}/include/subversion-1 -fcommon";
env.NIX_CFLAGS_COMPILE = "-I ${subversion.dev}/include/subversion-1 -fcommon";
NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1";
meta = {

View file

@ -149,10 +149,10 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
env.NIX_CFLAGS_COMPILE = toString []
env.NIX_CFLAGS_COMPILE = toString ([]
# Work around a bogus warning in conjunction with musl.
++ optional stdenv.hostPlatform.isMusl "-Wno-error"
++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0";
++ optional stdenv.hostPlatform.isAndroid "-D__USE_FORTIFY_LEVEL=0");
# Works around a bug with 8.26:
# Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.

View file

@ -35,14 +35,14 @@ rustPlatform.buildRustPackage rec {
libuv
];
env.NIX_CFLAGS_COMPILE = toString [
env.NIX_CFLAGS_COMPILE = toString ([
"-O2"
"-Wno-error=array-bounds"
"-Wno-error=stringop-overflow"
"-Wno-error=stringop-truncation"
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
"-Wno-error=stringop-overread"
];
]);
passthru.tests.basic = nixosTests.cjdns;

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation {
this is necessary for dsniff to compile; otherwise g_thread_init is a missing
symbol when linking (?!?)
*/
NIX_CFLAGS_COMPILE="-Dg_thread_init= ";
env.NIX_CFLAGS_COMPILE = "-Dg_thread_init= ";
meta = with lib; {
description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x";

View file

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
mkdir -p "$out/bin" "$out/share/man/man1"
'';
NIX_CFLAGS_COMPILE=" -Wno-error ";
env.NIX_CFLAGS_COMPILE = " -Wno-error ";
meta = with lib; {
description = "Attachment extractor for MIME messages";

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
# gcc-10. Otherwise build fails as:
# ld: main.o:/build/tftp-hpa-5.2/tftp/main.c:98: multiple definition of
# `toplevel'; tftp.o:/build/tftp-hpa-5.2/tftp/tftp.c:51: first defined here
NIX_CFLAGS_COMPILE="-fcommon";
env.NIX_CFLAGS_COMPILE = "-fcommon";
meta = with lib; {
description = "TFTP tools - a lot of fixes on top of BSD TFTP";

View file

@ -41,7 +41,7 @@ assert enableQt -> qwt != null;
nativeBuildInputs = [ pkg-config ];
NIX_CFLAGS_COMPILE="-Wno-unused";
env.NIX_CFLAGS_COMPILE = "-Wno-unused";
meta = with lib; {
homepage = "https://www.cgsecurity.org/wiki/Main_Page";

View file

@ -142,7 +142,7 @@ rec {
(old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pkg-config ];
# we need to reset this setting!
NIX_CFLAGS_COMPILE="";
env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
dontStrip = true;
outputs = [ "out" ];
buildPhase = ''