treewide: env.NIX_CFLAGS_COMPILE use toString on result of optionals

env values must be strings
This commit is contained in:
Artturin 2023-02-20 17:36:06 +02:00
parent 226e149145
commit 3251013cc1
39 changed files with 70 additions and 70 deletions

View file

@ -63,11 +63,11 @@ stdenv.mkDerivation rec {
"-DWARNINGS_ARE_ERRORS=ON" "-DWARNINGS_ARE_ERRORS=ON"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc) # Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc)
"-Wno-error=mismatched-new-delete" "-Wno-error=mismatched-new-delete"
"-Wno-error=use-after-free" "-Wno-error=use-after-free"
]; ]);
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a # Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a

View file

@ -117,9 +117,9 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DOCPN_BUNDLE_DOCS=true" ]; cmakeFlags = [ "-DOCPN_BUNDLE_DOCS=true" ];
env.NIX_CFLAGS_COMPILE = lib.optionals (!stdenv.hostPlatform.isx86) [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (!stdenv.hostPlatform.isx86) [
"-DSQUISH_USE_SSE=0" "-DSQUISH_USE_SSE=0"
]; ]);
postInstall = lib.optionals stdenv.isDarwin '' postInstall = lib.optionals stdenv.isDarwin ''
mkdir -p $out/Applications mkdir -p $out/Applications

View file

@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DNoVoip=True" ]; # libtgvoip required cmakeFlags = [ "-DNoVoip=True" ]; # libtgvoip required
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "-U__ARM_NEON__" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "-U__ARM_NEON__" ]);
meta = with lib; { meta = with lib; {
homepage = "https://github.com/ars3niy/tdlib-purple"; homepage = "https://github.com/ars3niy/tdlib-purple";

View file

@ -175,11 +175,11 @@ stdenv.mkDerivation rec {
WITH_X11 = true; WITH_X11 = true;
}; };
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-DTARGET_OS_IPHONE=0" "-DTARGET_OS_IPHONE=0"
"-DTARGET_OS_WATCH=0" "-DTARGET_OS_WATCH=0"
"-include AudioToolbox/AudioToolbox.h" "-include AudioToolbox/AudioToolbox.h"
]; ]);
NIX_LDFLAGS = lib.optionals stdenv.isDarwin [ NIX_LDFLAGS = lib.optionals stdenv.isDarwin [
"-framework AudioToolbox" "-framework AudioToolbox"

View file

@ -80,10 +80,10 @@ stdenv.mkDerivation rec {
# guile warning # guile warning
GUILE_AUTO_COMPILE="0"; GUILE_AUTO_COMPILE="0";
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=use-after-free" "-Wno-error=use-after-free"
]; ]);
# `make check` target does not define its prerequisites but expects them to # `make check` target does not define its prerequisites but expects them to
# have already been built. The list of targets below was built through trial # have already been built. The list of targets below was built through trial

View file

@ -69,9 +69,9 @@ stdenv.mkDerivation rec {
"-DUNITTEST=ON" "-DUNITTEST=ON"
] ++ lib.optionals pulseSupport [ "-DUSE_PULSEAUDIO:BOOL=TRUE" ]; ] ++ lib.optionals pulseSupport [ "-DUSE_PULSEAUDIO:BOOL=TRUE" ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
"-DAPPLE_OLD_XCODE" "-DAPPLE_OLD_XCODE"
]; ]);
doCheck = true; doCheck = true;

View file

@ -19,7 +19,7 @@ in stdenv.mkDerivation {
cmakeFlags = [ "-DSoapySDR_DIR=${soapysdr}/share/cmake/SoapySDR/" ]; cmakeFlags = [ "-DSoapySDR_DIR=${soapysdr}/share/cmake/SoapySDR/" ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-include sys/select.h" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [ "-include sys/select.h" ]);
meta = with lib; { meta = with lib; {
homepage = "https://github.com/pothosware/SoapyRemote"; homepage = "https://github.com/pothosware/SoapyRemote";

View file

@ -60,13 +60,13 @@ stdenv.mkDerivation rec {
--prefix PATH : "$out/share/cbmc" \ --prefix PATH : "$out/share/cbmc" \
''; '';
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12 but breaks on darwin (with clang) # Needed with GCC 12 but breaks on darwin (with clang)
"-Wno-error=maybe-uninitialized" "-Wno-error=maybe-uninitialized"
] ++ lib.optionals stdenv.cc.isClang [ ] ++ lib.optionals stdenv.cc.isClang [
# fix "argument unused during compilation" # fix "argument unused during compilation"
"-Wno-unused-command-line-argument" "-Wno-unused-command-line-argument"
]; ]);
# TODO: add jbmc support # TODO: add jbmc support
cmakeFlags = [ "-DWITH_JBMC=OFF" "-Dsat_impl=cadical" "-Dcadical_INCLUDE_DIR=${cadical.dev}/include" ]; cmakeFlags = [ "-DWITH_JBMC=OFF" "-Dsat_impl=cadical" "-Dcadical_INCLUDE_DIR=${cadical.dev}/include" ];

View file

@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
makeFlags = [ "PREFIX=$(out)" ]; makeFlags = [ "PREFIX=$(out)" ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12 # Needed with GCC 12
"-Wno-error=maybe-uninitialized" "-Wno-error=maybe-uninitialized"
]; ]);
preInstall = '' preInstall = ''
mkdir -p $out/bin mkdir -p $out/bin

View file

@ -171,7 +171,7 @@ stdenv.mkDerivation rec {
optional (!threadSupport) "sb-thread" ++ optional (!threadSupport) "sb-thread" ++
optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];
env.NIX_CFLAGS_COMPILE = lib.optionals (lib.versionOlder version "2.1.10") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (lib.versionOlder version "2.1.10") [
# Workaround build failure on -fno-common toolchains like upstream # Workaround build failure on -fno-common toolchains like upstream
# clang-13. Without the change build fails as: # clang-13. Without the change build fails as:
# duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o # duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o
@ -179,7 +179,7 @@ stdenv.mkDerivation rec {
"-fcommon" "-fcommon"
] ]
# Fails to find `O_LARGEFILE` otherwise. # Fails to find `O_LARGEFILE` otherwise.
++ [ "-D_GNU_SOURCE" ]; ++ [ "-D_GNU_SOURCE" ]);
buildPhase = '' buildPhase = ''
runHook preBuild runHook preBuild

View file

@ -36,10 +36,10 @@ stdenv.mkDerivation rec {
"--enable-remote-bitbang" "--enable-remote-bitbang"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
"-Wno-error=cpp" "-Wno-error=cpp"
"-Wno-error=strict-prototypes" # fixes build failure with hidapi 0.10.0 "-Wno-error=strict-prototypes" # fixes build failure with hidapi 0.10.0
]; ]);
postInstall = lib.optionalString stdenv.isLinux '' postInstall = lib.optionalString stdenv.isLinux ''
mkdir -p "$out/etc/udev/rules.d" mkdir -p "$out/etc/udev/rules.d"

View file

@ -30,10 +30,10 @@ buildGoModule {
export GOARCH=$(go env GOHOSTARCH) export GOARCH=$(go env GOHOSTARCH)
''; '';
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12 but breaks on darwin (with clang) # Needed with GCC 12 but breaks on darwin (with clang)
"-Wno-error=stringop-overflow" "-Wno-error=stringop-overflow"
]; ]);
buildPhase = '' buildPhase = ''
ninjaBuildPhase ninjaBuildPhase

View file

@ -44,10 +44,10 @@ stdenv.mkDerivation rec {
}; };
}; };
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-DTARGET_OS_IPHONE=0" "-DTARGET_OS_IPHONE=0"
"-DTARGET_OS_WATCH=0" "-DTARGET_OS_WATCH=0"
]; ]);
meta = with lib; { meta = with lib; {
homepage = "https://gitlab.gnome.org/GNOME/gtk-frdp"; homepage = "https://gitlab.gnome.org/GNOME/gtk-frdp";

View file

@ -56,10 +56,10 @@ mkDerivation rec {
"-DMBGL_WITH_QT_HEADLESS=OFF" "-DMBGL_WITH_QT_HEADLESS=OFF"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (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=use-after-free" "-Wno-error=use-after-free"
]; ]);
meta = with lib; { meta = with lib; {
description = "Open-source alternative to Mapbox GL Native"; description = "Open-source alternative to Mapbox GL Native";

View file

@ -323,10 +323,10 @@ self = stdenv.mkDerivation {
done done
''; '';
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-fno-common" ] ++ lib.optionals enableOpenCL [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [ "-fno-common" ] ++ lib.optionals enableOpenCL [
"-UPIPE_SEARCH_DIR" "-UPIPE_SEARCH_DIR"
"-DPIPE_SEARCH_DIR=\"${placeholder "opencl"}/lib/gallium-pipe\"" "-DPIPE_SEARCH_DIR=\"${placeholder "opencl"}/lib/gallium-pipe\""
]; ]);
passthru = { passthru = {
inherit (libglvnd) driverLink; inherit (libglvnd) driverLink;

View file

@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
"-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-D_GNU_SOURCE" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [ "-D_GNU_SOURCE" ]);
nativeBuildInputs = [ cmake gcc ]; nativeBuildInputs = [ cmake gcc ];
buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ]; buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ];

View file

@ -102,7 +102,7 @@ qtModule {
--replace "-Wl,-fatal_warnings" "" --replace "-Wl,-fatal_warnings" ""
'') + postPatch; '') + postPatch;
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
"-Wno-class-memaccess" "-Wno-class-memaccess"
] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [ ] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [
@ -111,7 +111,7 @@ qtModule {
"-march=westmere" "-march=westmere"
] ++ lib.optionals stdenv.cc.isClang [ ] ++ lib.optionals stdenv.cc.isClang [
"-Wno-elaborated-enum-base" "-Wno-elaborated-enum-base"
]; ]);
preConfigure = '' preConfigure = ''
export NINJAFLAGS=-j$NIX_BUILD_CORES export NINJAFLAGS=-j$NIX_BUILD_CORES

View file

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
"tools" "tools"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
"-Wno-error=deprecated-copy" "-Wno-error=deprecated-copy"
"-Wno-error=pessimizing-move" "-Wno-error=pessimizing-move"
# Needed with GCC 12 # Needed with GCC 12
@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
] ++ lib.optionals stdenv.cc.isClang [ ] ++ lib.optionals stdenv.cc.isClang [
"-Wno-error=unused-private-field" "-Wno-error=unused-private-field"
"-faligned-allocation" "-faligned-allocation"
]; ]);
cmakeFlags = [ cmakeFlags = [
"-DPORTABLE=1" "-DPORTABLE=1"

View file

@ -37,9 +37,9 @@ buildPythonPackage rec {
rapidfuzz-cpp rapidfuzz-cpp
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [
"-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098 "-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098
]; ]);
propagatedBuildInputs = [ propagatedBuildInputs = [
rapidfuzz rapidfuzz

View file

@ -52,9 +52,9 @@ buildPythonPackage rec {
export CMAKE_ARGS="-DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB" export CMAKE_ARGS="-DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB"
''; '';
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isClang && stdenv.isDarwin) [
"-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098 "-fno-lto" # work around https://github.com/NixOS/nixpkgs/issues/19098
]; ]);
propagatedBuildInputs = [ propagatedBuildInputs = [
numpy numpy

View file

@ -136,9 +136,9 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
# As of ruby 3.0, ruby headers require -fdeclspec when building with clang # As of ruby 3.0, ruby headers require -fdeclspec when building with clang
# Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57 # Introduced in https://github.com/ruby/ruby/commit/0958e19ffb047781fe1506760c7cbd8d7fe74e57
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isClang && lib.versionAtLeast ruby.version.major "3") [
"-fdeclspec" "-fdeclspec"
]; ]);
buildPhase = attrs.buildPhase or '' buildPhase = attrs.buildPhase or ''
runHook preBuild runHook preBuild

View file

@ -41,9 +41,9 @@ stdenv.mkDerivation rec {
"-DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON" "-DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON"
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-faligned-allocation" "-faligned-allocation"
]; ]);
passthru.tests.version = testers.testVersion { package = mold; }; passthru.tests.version = testers.testVersion { package = mold; };

View file

@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (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=address" "-Wno-error=address"
"-Wno-error=use-after-free" "-Wno-error=use-after-free"
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
"-Wno-error=deprecated-declarations" "-Wno-error=deprecated-declarations"
# Avoid GL_GLEXT_VERSION double definition # Avoid GL_GLEXT_VERSION double definition
" -DNO_SDL_GLEXT" " -DNO_SDL_GLEXT"
]; ]);
# To avoid problems finding SDL_types.h. # To avoid problems finding SDL_types.h.
configureFlags = [ "CFLAGS=-I${lib.getDev SDL}/include/SDL" ]; configureFlags = [ "CFLAGS=-I${lib.getDev SDL}/include/SDL" ];

View file

@ -76,9 +76,9 @@ stdenv.mkDerivation rec {
installFlags = [ "DESTDIR=${placeholder "out"}" ]; installFlags = [ "DESTDIR=${placeholder "out"}" ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
"-Wno-error=strict-prototypes" "-Wno-error=strict-prototypes"
]; ]);
enableParallelBuilding = true; enableParallelBuilding = true;

View file

@ -86,9 +86,9 @@ stdenv.mkDerivation rec {
]; ];
# Flag needed by GCC 12 but unrecognized by GCC 9 (aarch64-linux default now) # Flag needed by GCC 12 but unrecognized by GCC 9 (aarch64-linux default now)
env.NIX_CFLAGS_COMPILE = lib.optionals (with stdenv; cc.isGNU && lib.versionAtLeast cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (with stdenv; cc.isGNU && lib.versionAtLeast cc.version "12") [
"-Wno-error=mismatched-new-delete" "-Wno-error=mismatched-new-delete"
]; ]);
patchPhase = '' patchPhase = ''
patchShebangs scripts patchShebangs scripts

View file

@ -42,10 +42,10 @@ let
python3 python3
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=maybe-uninitialized" "-Wno-error=maybe-uninitialized"
]; ]);
meta = with lib; { meta = with lib; {
homepage = "https://github.com/ClusterLabs/resource-agents"; homepage = "https://github.com/ClusterLabs/resource-agents";

View file

@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
]; ];
# Configure phase requires 64-bit time_t even on 32-bit platforms. # Configure phase requires 64-bit time_t even on 32-bit platforms.
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.hostPlatform.is32bit [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.is32bit [
"-D_TIME_BITS=64" "-D_FILE_OFFSET_BITS=64" "-D_TIME_BITS=64" "-D_FILE_OFFSET_BITS=64"
]; ]);
configureFlags = [ configureFlags = [
"--disable-silent-rules" "--disable-silent-rules"

View file

@ -38,7 +38,7 @@ buildGoModule rec {
# uses go-systemd, which uses libsystemd headers # uses go-systemd, which uses libsystemd headers
# https://github.com/coreos/go-systemd/issues/351 # https://github.com/coreos/go-systemd/issues/351
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isLinux [ "-I${lib.getDev systemd}/include" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isLinux [ "-I${lib.getDev systemd}/include" ]);
# tries to access /sys: https://github.com/grafana/agent/issues/333 # tries to access /sys: https://github.com/grafana/agent/issues/333
preBuild = '' preBuild = ''

View file

@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
hardeningEnable = [ "pie" ]; hardeningEnable = [ "pie" ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-std=c11" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-std=c11" ]);
# darwin currently lacks a pure `pgrep` which is extensively used here # darwin currently lacks a pure `pgrep` which is extensively used here
doCheck = !stdenv.isDarwin; doCheck = !stdenv.isDarwin;

View file

@ -24,7 +24,7 @@ buildGoPackage rec {
sha256 = "0mm3hfr778c7djza8gr1clwa8wca4d3ldh9hlg80avw4x664y5zi"; sha256 = "0mm3hfr778c7djza8gr1clwa8wca4d3ldh9hlg80avw4x664y5zi";
}; };
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-error=deprecated-copy" "-Wno-error=redundant-move" "-Wno-error=pessimizing-move" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-Wno-error=deprecated-copy" "-Wno-error=redundant-move" "-Wno-error=pessimizing-move" ]);
inherit nativeBuildInputs buildInputs; inherit nativeBuildInputs buildInputs;

View file

@ -64,12 +64,12 @@ stdenv.mkDerivation rec {
--replace windres.exe ${stdenv.cc.targetPrefix}windres --replace windres.exe ${stdenv.cc.targetPrefix}windres
''; '';
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-Wno-deprecated-copy-dtor" "-Wno-deprecated-copy-dtor"
] ++ lib.optionals stdenv.hostPlatform.isMinGW [ ] ++ lib.optionals stdenv.hostPlatform.isMinGW [
"-Wno-conversion" "-Wno-conversion"
"-Wno-unused-macros" "-Wno-unused-macros"
]; ]);
inherit makefile; inherit makefile;

View file

@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-i6V2Owb8GcTcWowgb/BmdupOSFsYiCF2SbC9hXa26uY="; sha256 = "sha256-i6V2Owb8GcTcWowgb/BmdupOSFsYiCF2SbC9hXa26uY=";
}; };
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-std=c++11" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-std=c++11" ]);
nativeBuildInputs = [ cmake pkg-config ]; nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ libtiff ]; buildInputs = [ libtiff ];

View file

@ -14,10 +14,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12 but breaks on darwin (with clang) # Needed with GCC 12 but breaks on darwin (with clang)
"-std=c++14" "-std=c++14"
]; ]);
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin

View file

@ -14,7 +14,7 @@ edk2.mkDerivation "ShellPkg/ShellPkg.dsc" (finalAttrs: {
++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ]; ++ lib.optionals stdenv.cc.isClang [ llvmPackages.bintools llvmPackages.llvm ];
strictDeps = true; strictDeps = true;
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ]; env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [ "-fno-pic" "-Qunused-arguments" ]);
# Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to # Set explicitly to use Python 3 from nixpkgs. Otherwise, the build system will detect and try to
# use `/usr/bin/python3` on Darwin when sandboxing is disabled. # use `/usr/bin/python3` on Darwin when sandboxing is disabled.

View file

@ -19,13 +19,13 @@ stdenv.mkDerivation rec {
cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ]; cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_OUT_PGSQL=ON" ];
# _FORTIFY_SOURCE requires compiling with optimization (-O) # _FORTIFY_SOURCE requires compiling with optimization (-O)
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-O" ] env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [ "-O" ]
# Workaround build failure on -fno-common toolchains: # Workaround build failure on -fno-common toolchains:
# ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout'; # ld: /monkey/mk_tls.h:81: multiple definition of `mk_tls_server_timeout';
# flb_config.c.o:include/monkey/mk_tls.h:81: first defined here # flb_config.c.o:include/monkey/mk_tls.h:81: first defined here
# TODO: drop when upstream gets a fix for it: # TODO: drop when upstream gets a fix for it:
# https://github.com/fluent/fluent-bit/issues/5537 # https://github.com/fluent/fluent-bit/issues/5537
++ lib.optionals stdenv.isDarwin [ "-fcommon" ]; ++ lib.optionals stdenv.isDarwin [ "-fcommon" ]);
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];

View file

@ -31,10 +31,10 @@ rustPlatform.buildRustPackage rec {
Foundation Foundation
]; ];
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-framework" "-framework"
"AppKit" "AppKit"
]; ]);
postInstall = '' postInstall = ''
installShellCompletion --cmd topgrade \ installShellCompletion --cmd topgrade \

View file

@ -41,9 +41,9 @@ rustPlatform.buildRustPackage rec {
# Needed to get openssl-sys to use pkg-config. # Needed to get openssl-sys to use pkg-config.
OPENSSL_NO_VENDOR = 1; OPENSSL_NO_VENDOR = 1;
env.NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
"-framework" "AppKit" "-framework" "AppKit"
]; ]);
# Requires network access # Requires network access
doCheck = false; doCheck = false;

View file

@ -18,10 +18,10 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake perl ]; nativeBuildInputs = [ cmake perl ];
buildInputs = [ libubox json_c ]; buildInputs = [ libubox json_c ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=dangling-pointer" "-Wno-error=dangling-pointer"
]; ]);
meta = with lib; { meta = with lib; {
description = "Tiny QMI command line utility"; description = "Tiny QMI command line utility";

View file

@ -21,10 +21,10 @@ stdenv.mkDerivation rec {
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices CoreFoundation ]; buildInputs = lib.optionals stdenv.isDarwin [ CoreServices CoreFoundation ];
env.NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [ env.NIX_CFLAGS_COMPILE = toString (lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
# Needed with GCC 12 but breaks on darwin (with clang) or older gcc # Needed with GCC 12 but breaks on darwin (with clang) or older gcc
"-Wno-error=mismatched-new-delete" "-Wno-error=mismatched-new-delete"
]; ]);
postPatch = lib.optionalString stdenv.isAarch64 '' postPatch = lib.optionalString stdenv.isAarch64 ''
substituteInPlace Makefile \ substituteInPlace Makefile \