diff options
author | Artturin <Artturin@artturin.com> | 2023-02-20 17:17:34 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2023-02-22 21:23:04 +0200 |
commit | 6b2a05e19089c2b16c6ed52e7e495f8a9f903c60 (patch) | |
tree | 30990df54ee4a654a86772f909c5d2c318356419 /pkgs/development | |
parent | f9fdf2d4028eac28a074c9ad75d309b3dcbf8e7a (diff) |
treewide: manual fixups for
treewide: use toString on list NIX_CFLAGS_COMPILE treewide: move NIX_CFLAGS_COMPILE to the env attrset
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/libraries/belle-sip/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/libraries/glibc/default.nix | 28 | ||||
-rw-r--r-- | pkgs/development/libraries/libiscsi/default.nix | 3 | ||||
-rw-r--r-- | pkgs/development/libraries/nss/generic.nix | 4 | ||||
-rw-r--r-- | pkgs/development/libraries/openexrid-unstable/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-5/modules/qtwebkit.nix | 4 | ||||
-rw-r--r-- | pkgs/development/libraries/qt-mobility/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/sqlite/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/python-modules/torch/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/tools/tracy/default.nix | 4 |
10 files changed, 29 insertions, 28 deletions
diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix index 01c73a8515e0e..b40ea68a48a6f 100644 --- a/pkgs/development/libraries/belle-sip/default.nix +++ b/pkgs/development/libraries/belle-sip/default.nix @@ -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 ]; diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 98f2e406bc01d..e1a427e35b658 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -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 diff --git a/pkgs/development/libraries/libiscsi/default.nix b/pkgs/development/libraries/libiscsi/default.nix index 2c9a232b315c0..806a9729c574c 100644 --- a/pkgs/development/libraries/libiscsi/default.nix +++ b/pkgs/development/libraries/libiscsi/default.nix @@ -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"; diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index a9382294ebe85..408d5f4e1ac3c 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -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 diff --git a/pkgs/development/libraries/openexrid-unstable/default.nix b/pkgs/development/libraries/openexrid-unstable/default.nix index 47b2f6395478e..c961dfd069a6b 100644 --- a/pkgs/development/libraries/openexrid-unstable/default.nix +++ b/pkgs/development/libraries/openexrid-unstable/default.nix @@ -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 ''; diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix index 1299cd11dd6cd..a70ebd3fb74fc 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix @@ -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) diff --git a/pkgs/development/libraries/qt-mobility/default.nix b/pkgs/development/libraries/qt-mobility/default.nix index 36e1948f09ec9..7807e41b606e3 100644 --- a/pkgs/development/libraries/qt-mobility/default.nix +++ b/pkgs/development/libraries/qt-mobility/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "14713pbscysd6d0b9rgm7gg145jzwvgdn22778pf2v13qzvfmy1i"; }; - NIX_CFLAGS_COMPILE="-fpermissive"; + env.NIX_CFLAGS_COMPILE = "-fpermissive"; configurePhase = '' ./configure -prefix $out diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 151958dd0e1b6..91f694649b004 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -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 "" ''; diff --git a/pkgs/development/python-modules/torch/default.nix b/pkgs/development/python-modules/torch/default.nix index 2abc9d29e9653..8fe9e1fed629e 100644 --- a/pkgs/development/python-modules/torch/default.nix +++ b/pkgs/development/python-modules/torch/default.nix @@ -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 diff --git a/pkgs/development/tools/tracy/default.nix b/pkgs/development/tools/tracy/default.nix index 4d430148500e8..00e121adc7185 100644 --- a/pkgs/development/tools/tracy/default.nix +++ b/pkgs/development/tools/tracy/default.nix @@ -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"; |