From 226e14914512d33cee00543cd947cf74d50a1258 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 20 Feb 2023 17:26:44 +0200 Subject: treewide: env.NIX_CFLAGS_COMPILE use optionalString instead of optional env values must be strings --- pkgs/applications/audio/grandorgue/default.nix | 2 +- pkgs/applications/graphics/gimp/default.nix | 2 +- pkgs/applications/graphics/gnuclad/default.nix | 2 +- pkgs/applications/misc/gpsbabel/default.nix | 2 +- pkgs/applications/networking/mumble/default.nix | 2 +- pkgs/applications/science/computer-architecture/timeloop/default.nix | 2 +- pkgs/applications/science/physics/xfitter/default.nix | 2 +- pkgs/applications/virtualization/OVMF/default.nix | 2 +- pkgs/development/compilers/rgbds/default.nix | 2 +- pkgs/development/libraries/libtomcrypt/default.nix | 2 +- pkgs/development/libraries/qt-5/modules/qttools.nix | 2 +- pkgs/development/ocaml-modules/lablgtk/default.nix | 2 +- pkgs/development/python2-modules/pygtk/default.nix | 4 ++-- pkgs/misc/screensavers/xscreensaver/default.nix | 2 +- pkgs/os-specific/bsd/netbsd/default.nix | 2 +- pkgs/servers/search/qdrant/default.nix | 2 +- pkgs/tools/cd-dvd/cdrkit/default.nix | 2 +- pkgs/tools/graphics/hobbits/default.nix | 2 +- pkgs/tools/graphics/icoutils/default.nix | 2 +- pkgs/tools/networking/jwhois/default.nix | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/audio/grandorgue/default.nix b/pkgs/applications/audio/grandorgue/default.nix index a90e02d9ec0b5..f988e5cd1d420 100644 --- a/pkgs/applications/audio/grandorgue/default.nix +++ b/pkgs/applications/audio/grandorgue/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { "-DINSTALL_DEPEND=OFF" ] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF"; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; postInstall = lib.optionalString stdenv.isDarwin '' mkdir -p $out/{Applications,bin,lib} diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix index 73429a5ad37bd..8ffc0a0424e5b 100644 --- a/pkgs/applications/graphics/gimp/default.nix +++ b/pkgs/applications/graphics/gimp/default.nix @@ -154,7 +154,7 @@ in stdenv.mkDerivation rec { doCheck = true; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGDK_OSX_BIG_SUR=16"; # Check if librsvg was built with --disable-pixbuf-loader. PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}"; diff --git a/pkgs/applications/graphics/gnuclad/default.nix b/pkgs/applications/graphics/gnuclad/default.nix index a2eb640bc1f13..b90735d850837 100644 --- a/pkgs/applications/graphics/gnuclad/default.nix +++ b/pkgs/applications/graphics/gnuclad/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "0ka2kscpjff7gflsargv3r9fdaxhkf3nym9mfaln3pnq6q7fwdki"; }; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.cc.isGNU "-Wno-error=catch-value"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=catch-value"; nativeBuildInputs = [ pkg-config ]; diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix index 8edf3ec0fffda..60a1e40a614ed 100644 --- a/pkgs/applications/misc/gpsbabel/default.nix +++ b/pkgs/applications/misc/gpsbabel/default.nix @@ -66,7 +66,7 @@ stdenv.mkDerivation rec { # Floating point behavior on i686 causes nmea.test failures. Preventing # extended precision fixes this problem. - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isi686 "-ffloat-store"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-ffloat-store"; doCheck = true; diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index 2d7620cabf14e..c9b6ac807a050 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -71,7 +71,7 @@ let ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; - env.NIX_CFLAGS_COMPILE = lib.optional speechdSupport "-I${speechd}/include/speech-dispatcher"; + env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd}/include/speech-dispatcher"; postFixup = '' wrapProgram $out/bin/mumble \ diff --git a/pkgs/applications/science/computer-architecture/timeloop/default.nix b/pkgs/applications/science/computer-architecture/timeloop/default.nix index f559974ddaf53..4e794aaa29e24 100644 --- a/pkgs/applications/science/computer-architecture/timeloop/default.nix +++ b/pkgs/applications/science/computer-architecture/timeloop/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { #link-time optimization fails on darwin #see https://github.com/NixOS/nixpkgs/issues/19098 - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-fno-lto"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto"; postPatch = '' # use nix ar/ranlib diff --git a/pkgs/applications/science/physics/xfitter/default.nix b/pkgs/applications/science/physics/xfitter/default.nix index e55f93142cff5..1852ef3ff1c8e 100644 --- a/pkgs/applications/science/physics/xfitter/default.nix +++ b/pkgs/applications/science/physics/xfitter/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc ; - env.NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc"; + env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc"; NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc"; # workaround wrong library IDs diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index 8371a4715ad54..7350765ab5d2f 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -46,7 +46,7 @@ edk2.mkDerivation projectDscPath (finalAttrs: { ++ lib.optionals httpSupport [ "-D NETWORK_HTTP_ENABLE=TRUE" "-D NETWORK_HTTP_BOOT_ENABLE=TRUE" ] ++ lib.optionals tpmSupport [ "-D TPM_ENABLE" "-D TPM2_ENABLE" "-D TPM2_CONFIG_ENABLE"]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.cc.isClang "-Qunused-arguments"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Qunused-arguments"; postPatch = lib.optionalString csmSupport '' cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin diff --git a/pkgs/development/compilers/rgbds/default.nix b/pkgs/development/compilers/rgbds/default.nix index 200c4ceefc3c6..7cec0eb0ddbb8 100644 --- a/pkgs/development/compilers/rgbds/default.nix +++ b/pkgs/development/compilers/rgbds/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ bison flex pkg-config ]; buildInputs = [ libpng ]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-fno-lto"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto"; installFlags = [ "PREFIX=${placeholder "out"}" ]; meta = with lib; { diff --git a/pkgs/development/libraries/libtomcrypt/default.nix b/pkgs/development/libraries/libtomcrypt/default.nix index d7678bc4c8dba..9bfd42e7a71c2 100644 --- a/pkgs/development/libraries/libtomcrypt/default.nix +++ b/pkgs/development/libraries/libtomcrypt/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin # upgrades to a newer SDK. - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; patches = [ (fetchpatch { diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index b8e72b09e88a7..be96236d72850 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -36,7 +36,7 @@ qtModule { "bin/macdeployqt" ]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; setupHook = ../hooks/qttools-setup-hook.sh; } diff --git a/pkgs/development/ocaml-modules/lablgtk/default.nix b/pkgs/development/ocaml-modules/lablgtk/default.nix index 4f6a5be39fb71..6b35bb423e3bc 100644 --- a/pkgs/development/ocaml-modules/lablgtk/default.nix +++ b/pkgs/development/ocaml-modules/lablgtk/default.nix @@ -30,7 +30,7 @@ in stdenv.mkDerivation { pname = "ocaml${ocaml.version}-lablgtk"; - inherit (param) version src NIX_CFLAGS_COMPILE; + inherit (param) version src env; # gnumake42: https://github.com/garrigue/lablgtk/issues/162 nativeBuildInputs = [ pkg-config ocaml findlib gnumake42 ]; diff --git a/pkgs/development/python2-modules/pygtk/default.nix b/pkgs/development/python2-modules/pygtk/default.nix index 95447127ad066..c3960dd5309d6 100644 --- a/pkgs/development/python2-modules/pygtk/default.nix +++ b/pkgs/development/python2-modules/pygtk/default.nix @@ -37,8 +37,8 @@ buildPythonPackage rec { buildPhase = "buildPhase"; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-ObjC" - ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "-lpython2.7"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-ObjC" + + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) " -lpython2.7"; installPhase = "installPhase"; diff --git a/pkgs/misc/screensavers/xscreensaver/default.nix b/pkgs/misc/screensavers/xscreensaver/default.nix index 5af46251a35ba..ea8ba9d042bcb 100644 --- a/pkgs/misc/screensavers/xscreensaver/default.nix +++ b/pkgs/misc/screensavers/xscreensaver/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ]; # "marbling" has NEON code that mixes signed and unsigned vector types - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch "-flax-vector-conversions"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch "-flax-vector-conversions"; postInstall = '' for bin in $out/bin/*; do diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index e88e98023cb92..6bf884d382840 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -535,7 +535,7 @@ in makeScopeWithSplicing path = "usr.bin/uudecode"; version = "9.2"; sha256 = "00a3zmh15pg4vx6hz0kaa5mi8d2b1sj4h512d7p6wbvxq6mznwcn"; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isLinux "-DNO_BASE64"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNO_BASE64"; NIX_LDFLAGS = lib.optional stdenv.isDarwin "-lresolv"; }; diff --git a/pkgs/servers/search/qdrant/default.nix b/pkgs/servers/search/qdrant/default.nix index 827e5a5d76e58..8c8fab851b096 100644 --- a/pkgs/servers/search/qdrant/default.nix +++ b/pkgs/servers/search/qdrant/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ protobuf rustPlatform.bindgenHook ]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-faligned-allocation"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-faligned-allocation"; meta = with lib; { description = "Vector Search Engine for the next generation of AI applications"; diff --git a/pkgs/tools/cd-dvd/cdrkit/default.nix b/pkgs/tools/cd-dvd/cdrkit/default.nix index b950e37940c59..efa6638099492 100644 --- a/pkgs/tools/cd-dvd/cdrkit/default.nix +++ b/pkgs/tools/cd-dvd/cdrkit/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ libcap zlib bzip2 perl ]; hardeningDisable = [ "format" ]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isMusl "-D__THROW="; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-D__THROW="; # efi-boot-patch extracted from http://arm.koji.fedoraproject.org/koji/rpminfo?rpmID=174244 patches = [ ./include-path.patch ./cdrkit-1.1.9-efi-boot.patch ./cdrkit-1.1.11-fno-common.patch ]; diff --git a/pkgs/tools/graphics/hobbits/default.nix b/pkgs/tools/graphics/hobbits/default.nix index fc185682cabc8..d6c63aee9562c 100644 --- a/pkgs/tools/graphics/hobbits/default.nix +++ b/pkgs/tools/graphics/hobbits/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DUSE_SYSTEM_PFFFT=ON" ]; - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing"; meta = with lib; { description = "A multi-platform GUI for bit-based analysis, processing, and visualization"; diff --git a/pkgs/tools/graphics/icoutils/default.nix b/pkgs/tools/graphics/icoutils/default.nix index acd2b4302fc9d..b450537b5a428 100644 --- a/pkgs/tools/graphics/icoutils/default.nix +++ b/pkgs/tools/graphics/icoutils/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin # upgrades to a newer SDK. - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0"; patchPhase = '' patchShebangs extresso/extresso diff --git a/pkgs/tools/networking/jwhois/default.nix b/pkgs/tools/networking/jwhois/default.nix index 12494fc269921..9026a60e2f3ac 100644 --- a/pkgs/tools/networking/jwhois/default.nix +++ b/pkgs/tools/networking/jwhois/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { # Work around error from on aarch64-darwin: # error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_] # TODO: this should probably be fixed at a lower level than this? - env.NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-undef-prefix"; + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-undef-prefix"; meta = { description = "A client for the WHOIS protocol allowing you to query the owner of a domain name"; -- cgit 1.4.1