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 { (old: rec {
buildInputs = old.buildInputs ++ [ pkg-config ]; buildInputs = old.buildInputs ++ [ pkg-config ];
# we need to reset this setting! # we need to reset this setting!
NIX_CFLAGS_COMPILE=""; env = (old.env or { }) // { NIX_CFLAGS_COMPILE = ""; };
configurePhase = '' configurePhase = ''
# FIXME: Some tests require writing at $HOME # FIXME: Some tests require writing at $HOME
HOME=$TMPDIR 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. 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: 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.isLinux [ "PLATFORM=DEB" ]
++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ]; ++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ];
env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ] ++ env.NIX_CFLAGS_COMPILE = toString ([ "-fpermissive" ] ++
lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing"; lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing");
NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation"; 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! # the linux config works fine on darwin too!
buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux"; 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 = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin

View file

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

View file

@ -33,8 +33,8 @@ mkDerivation rec {
xsimd xsimd
]; ];
env.NIX_CFLAGS_COMPILE = toString [ "-I${ilmbase.dev}/include/OpenEXR" ] env.NIX_CFLAGS_COMPILE = toString ([ "-I${ilmbase.dev}/include/OpenEXR" ]
++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy"; ++ 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. # 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. # 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 patchShebangs tools/get_wb_version.sh
''; '';
env.NIX_CFLAGS_COMPILE = toString [ env.NIX_CFLAGS_COMPILE = toString ([
# error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated # error: 'OGRErr OGRSpatialReference::importFromWkt(char**)' is deprecated
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
] ++ lib.optionals stdenv.isAarch64 [ ] ++ lib.optionals stdenv.isAarch64 [
@ -149,7 +149,7 @@ in stdenv.mkDerivation rec {
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but problematic with some old GCCs # Needed with GCC 12 but problematic with some old GCCs
"-Wno-error=maybe-uninitalized" "-Wno-error=maybe-uninitalized"
]; ]);
cmakeFlags = [ cmakeFlags = [
"-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config" "-DMySQL_CONFIG_PATH=${mysql}/bin/mysql_config"

View file

@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
buildInputs = [ SDL SDL_image ]; 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; { meta = with lib; {
homepage = "https://brlcad.org/~erik/"; homepage = "https://brlcad.org/~erik/";

View file

@ -49,13 +49,13 @@ stdenv.mkDerivation {
"-DENABLE_UNICODE_DATABASE_DOWNLOAD=false" "-DENABLE_UNICODE_DATABASE_DOWNLOAD=false"
]; ];
env.NIX_CFLAGS_COMPILE = toString [ env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-error" "-Wno-error"
] ++ lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [ ] ++ lib.optionals (stdenv.isDarwin && lib.versionOlder stdenv.targetPlatform.darwinSdkVersion "11.0") [
# error: use of undeclared identifier 'aligned_alloc' # error: use of undeclared identifier 'aligned_alloc'
"-include mm_malloc.h" "-include mm_malloc.h"
"-Daligned_alloc=_mm_malloc" "-Daligned_alloc=_mm_malloc"
]; ]);
# https://github.com/NixOS/nixpkgs/issues/201254 # https://github.com/NixOS/nixpkgs/issues/201254
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc"; 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" "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; { meta = with lib; {
homepage = "https://www.netsurf-browser.org/projects/${libname}/"; homepage = "https://www.netsurf-browser.org/projects/${libname}/";

View file

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

View file

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

View file

@ -50,19 +50,21 @@ in
# invocation does not work. # invocation does not work.
hardeningDisable = [ "fortify" "pie" "stackprotector" ]; hardeningDisable = [ "fortify" "pie" "stackprotector" ];
env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " env = (previousAttrs.env or { }) // {
(builtins.concatLists [ NIX_CFLAGS_COMPILE = (previousAttrs.env.NIX_CFLAGS_COMPILE or "") + lib.concatStringsSep " "
(lib.optionals withGd gdCflags) (builtins.concatLists [
# Fix -Werror build failure when building glibc with musl with GCC >= 8, see: (lib.optionals withGd gdCflags)
# https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798 # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
(lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias") # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
(lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [ (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
# Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'" (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
# New warning as of GCC 9 # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
# Same for musl: https://github.com/NixOS/nixpkgs/issues/78805 # New warning as of GCC 9
"-Wno-error=missing-attributes" # 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 # 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 # 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 ]; nativeBuildInputs = [ autoreconfHook ];
# This problem is gone on libiscsi master. # This problem is gone on libiscsi master.
env.NIX_CFLAGS_COMPILE = env.NIX_CFLAGS_COMPILE = toString (lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare");
lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare";
meta = with lib; { meta = with lib; {
description = "iscsi client library and utilities"; description = "iscsi client library and utilities";

View file

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

View file

@ -20,7 +20,7 @@ stdenv.mkDerivation {
--replace g++ c++ --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${openexr.dev}/include/OpenEXR
-I${openfx.dev}/include/OpenFX -I${openfx.dev}/include/OpenFX
''; '';

View file

@ -35,7 +35,7 @@ qtModule {
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF" "-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 # with gcc7 this warning blows the log over Hydra's limit
"-Wno-expansion-to-defined" "-Wno-expansion-to-defined"
] ]
@ -43,7 +43,7 @@ qtModule {
++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess" ++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
# with clang this warning blows the log over Hydra's limit # with clang this warning blows the log over Hydra's limit
++ lib.optional stdenv.isDarwin "-Wno-inconsistent-missing-override" ++ 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) doCheck = false; # fails 13 out of 13 tests (ctest)

View file

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

View file

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

View file

@ -213,11 +213,11 @@ in buildPythonPackage rec {
# #
# Also of interest: pytorch ignores CXXFLAGS uses CFLAGS for both C and C++: # 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 # 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 # Suppress gcc regression: avx512 math function raises uninitialized variable warning
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593 # 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 # 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 = [ nativeBuildInputs = [
cmake cmake

View file

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

View file

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

View file

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

View file

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

View file

@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
]; ];
# Fix SDL include problems # 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 # Fix linking errors
makeFlags = [ makeFlags = [
"ZAZ_LIBS+=-lSDL" "ZAZ_LIBS+=-lSDL"

View file

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

View file

@ -20,7 +20,7 @@ appleDerivation {
done 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 = { meta = {
platforms = lib.platforms.darwin; platforms = lib.platforms.darwin;

View file

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

View file

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

View file

@ -102,7 +102,7 @@ stdenv.mkDerivation {
# gcc-10. Otherwise build fails as: # gcc-10. Otherwise build fails as:
# ld: acpi/xsdt.o:/build/syslinux-b404870/com32/gpllib/../gplinclude/memory.h:40: multiple definition of # 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 # `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 = [ makeFlags = [
"BINDIR=$(out)/bin" "BINDIR=$(out)/bin"

View file

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

View file

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

View file

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

View file

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

View file

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
# gcc-10. Otherwise build fails as: # gcc-10. Otherwise build fails as:
# ld: svnclient.o:/build/svnfs-0.4/src/svnfs.h:40: multiple definition of # 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 # `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"; NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1";
meta = { meta = {

View file

@ -149,10 +149,10 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1"; 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. # Work around a bogus warning in conjunction with musl.
++ optional stdenv.hostPlatform.isMusl "-Wno-error" ++ 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: # Works around a bug with 8.26:
# Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop. # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.

View file

@ -35,14 +35,14 @@ rustPlatform.buildRustPackage rec {
libuv libuv
]; ];
env.NIX_CFLAGS_COMPILE = toString [ env.NIX_CFLAGS_COMPILE = toString ([
"-O2" "-O2"
"-Wno-error=array-bounds" "-Wno-error=array-bounds"
"-Wno-error=stringop-overflow" "-Wno-error=stringop-overflow"
"-Wno-error=stringop-truncation" "-Wno-error=stringop-truncation"
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [ ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
"-Wno-error=stringop-overread" "-Wno-error=stringop-overread"
]; ]);
passthru.tests.basic = nixosTests.cjdns; 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 this is necessary for dsniff to compile; otherwise g_thread_init is a missing
symbol when linking (?!?) symbol when linking (?!?)
*/ */
NIX_CFLAGS_COMPILE="-Dg_thread_init= "; env.NIX_CFLAGS_COMPILE = "-Dg_thread_init= ";
meta = with lib; { meta = with lib; {
description = "An E-component of Network Intrusion Detection System which emulates the IP stack of Linux 2.0.x"; 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" mkdir -p "$out/bin" "$out/share/man/man1"
''; '';
NIX_CFLAGS_COMPILE=" -Wno-error "; env.NIX_CFLAGS_COMPILE = " -Wno-error ";
meta = with lib; { meta = with lib; {
description = "Attachment extractor for MIME messages"; description = "Attachment extractor for MIME messages";

View file

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
# gcc-10. Otherwise build fails as: # gcc-10. Otherwise build fails as:
# ld: main.o:/build/tftp-hpa-5.2/tftp/main.c:98: multiple definition of # 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 # `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; { meta = with lib; {
description = "TFTP tools - a lot of fixes on top of BSD TFTP"; 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 ]; nativeBuildInputs = [ pkg-config ];
NIX_CFLAGS_COMPILE="-Wno-unused"; env.NIX_CFLAGS_COMPILE = "-Wno-unused";
meta = with lib; { meta = with lib; {
homepage = "https://www.cgsecurity.org/wiki/Main_Page"; homepage = "https://www.cgsecurity.org/wiki/Main_Page";

View file

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