treewide: env.NIX_CFLAGS_COMPILE use optionalString instead of optional

env values must be strings
This commit is contained in:
Artturin 2023-02-20 17:26:44 +02:00
parent 6b2a05e190
commit 226e149145
20 changed files with 21 additions and 21 deletions

View File

@ -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}

View File

@ -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}";

View File

@ -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 ];

View File

@ -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;

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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; {

View File

@ -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 {

View File

@ -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;
}

View File

@ -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 ];

View File

@ -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";

View File

@ -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

View File

@ -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";
};

View File

@ -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";

View File

@ -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 ];

View File

@ -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";

View File

@ -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

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
# Work around error from <stdio.h> 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";