treewide: NIX_*_COMPILE -> string

This commit is contained in:
Robin Gloster 2019-10-30 01:40:49 +01:00 committed by Jan Tojnar
parent 981ae25113
commit ab0cfd9e03
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
34 changed files with 51 additions and 65 deletions

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
];
# audacity only looks for lame and ffmpeg at runtime, so we need to link them in manually
NIX_LDFLAGS = [
NIX_LDFLAGS = toString [
# LAME
"-lmp3lame"
# ffmpeg

View File

@ -29,9 +29,7 @@ stdenv.mkDerivation rec {
gst_all_1.gst-plugins-base
] ++ stdenv.lib.optional useUnrar unrar;
NIX_LDFLAGS = [
"-lpthread"
];
NIX_LDFLAGS = "-lpthread";
postPatch = ''patchShebangs version.sh'';

View File

@ -48,7 +48,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
url = https://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
};
NIX_LDFLAGS = [ "-lm" ];
NIX_LDFLAGS = "-lm";
patchPhase = ''
sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \
-e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure
@ -141,7 +141,7 @@ stdenv.lib.makeScope pkgs.newScope (self: with self; {
Filters/Enhance/Wavelet sharpen
*/
name = "wavelet-sharpen-0.1.2";
NIX_LDFLAGS = [ "-lm" ];
NIX_LDFLAGS = "-lm";
src = fetchurl {
url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";

View File

@ -156,7 +156,7 @@ stdenv.mkDerivation rec {
AVFoundation MediaToolbox CoreLocation
Foundation libobjc AddressBook cups ];
NIX_CFLAGS_COMPILE = [
NIX_CFLAGS_COMPILE = toString ([
"-I${glib.dev}/include/gio-unix-2.0"
]
++ lib.optionals (!isTorBrowserLike) [
@ -164,7 +164,7 @@ stdenv.mkDerivation rec {
]
++ lib.optional (pname == "firefox-esr" && lib.versionAtLeast ffversion "68"
&& lib.versionOlder ffversion "69")
"-Wno-error=format-security";
"-Wno-error=format-security");
postPatch = lib.optionalString (lib.versionAtLeast ffversion "63.0" && !isTorBrowserLike) ''
substituteInPlace third_party/prio/prio/rand.c --replace 'nspr/prinit.h' 'prinit.h'

View File

@ -12,14 +12,14 @@ stdenv.mkDerivation {
};
buildInputs = [ cmake zlib boost.out boost.dev ];
NIX_CFLAGS_COMPILE = [ "-Wno-narrowing" ]
NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
# Squelch endless stream of warnings on same few things
++ stdenv.lib.optionals stdenv.cc.isClang [
"-Wno-empty-body"
"-Wno-tautological-compare"
"-Wc++11-compat-deprecated-writable-strings"
"-Wno-deprecated"
];
]);
prePatch = ''
sed -i -e '1i#include <stdint.h>' abc/src/bdd/dsd/dsd.h

View File

@ -108,9 +108,7 @@ stdenv.mkDerivation
# this is fixed upstream though not yet in an officially released version,
# should be fine remove on next release (if one ever happens)
NIX_LDFLAGS = [
"-lpthread"
];
NIX_LDFLAGS = "-lpthread";
postInstall = "ln -s $out/bin/aegisub-* $out/bin/aegisub";

View File

@ -195,11 +195,11 @@ stdenv.mkDerivation rec {
echo CONFIG_MPEGAUDIODSP=yes >> config.mak
'';
NIX_LDFLAGS = with stdenv.lib;
NIX_LDFLAGS = with stdenv.lib; toString (
optional fontconfigSupport "-lfontconfig"
++ optional fribidiSupport "-lfribidi"
++ optionals x11Support [ "-lX11" "-lXext" ]
;
);
installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui";

View File

@ -99,11 +99,9 @@ stdenv.mkDerivation rec {
"-Dudev_dir=${placeholder "out"}/lib/udev"
];
NIX_CFLAGS_COMPILE = [
# Default for release buildtype but passed manually because
# we're using plain
"-DG_DISABLE_CAST_CHECKS"
];
# Default for release buildtype but passed manually because
# we're using plain
NIX_CFLAGS_COMPILE = "-DG_DISABLE_CAST_CHECKS";
# So the polkit policy can reference /run/current-system/sw/bin/gnome-settings-daemon/gsd-backlight-helper
postFixup = ''

View File

@ -31,7 +31,7 @@ stdenv.mkDerivation {
stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
patchFlags = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "-p0";
patchFlags = stdenv.lib.optional stdenv.hostPlatform.isDarwin "-p0";
preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";

View File

@ -13,10 +13,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-Wno-nullability-extension"
"-Wno-typedef-redefinition"
];
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
"-Wno-nullability-extension -Wno-typedef-redefinition";
meta = with lib; {
description = "AWS SDK for C common core";

View File

@ -27,9 +27,7 @@ stdenv.mkDerivation rec {
cp ${gcc7PlatformPatch} glm/simd/platform.h
'';
NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [
"-DGLM_COMPILER=0"
];
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0";
postInstall = ''
mkdir -p $doc/share/doc/glm

View File

@ -47,12 +47,12 @@ stdenv.mkDerivation rec {
# fit in the limit. https://github.com/NixOS/nix/pull/1085
++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
NIX_CFLAGS_COMPILE =
NIX_CFLAGS_COMPILE = toString (
# qgpgme uses Q_ASSERT which retains build inputs at runtime unless
# debugging is disabled
lib.optional (qtbase != null) "-DQT_NO_DEBUG"
# https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64");
checkInputs = [ which ];

View File

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
};
# do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
# https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html
doCheck = stdenv.hostPlatform.system != "i686-linux" && stdenv.hostPlatform.system != "aarch64-linux";

View File

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
};
# do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
patches = [
(fetchpatch {

View File

@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = optional withAACS libaacs;
NIX_LDFLAGS = [
NIX_LDFLAGS = toString [
(optionalString withAACS "-L${libaacs}/lib -laacs")
(optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
];

View File

@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
};
# glib-2.62 deprecations
NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ];
NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
# Patches from Gentoo portage
patches = [

View File

@ -208,7 +208,7 @@ stdenv.mkDerivation {
nativeBuildInputs = [ cmake pkgconfig unzip ];
NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
# Configure can't find the library without this.
OpenBLAS_HOME = lib.optionalString enableOpenblas openblas;

View File

@ -206,13 +206,13 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
NIX_CFLAGS_COMPILE =
NIX_CFLAGS_COMPILE = toString (
# with gcc7 the warnings blow the log over Hydra's limit
[ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
++ lib.optionals (stdenv.isFreeBSD || stdenv.isDarwin)
[ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ]
++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1";
++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1");
NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";

View File

@ -12,9 +12,9 @@ let
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
++ (args.qmakeFlags or []);
NIX_CFLAGS_COMPILE =
NIX_CFLAGS_COMPILE = toString (
optional (!debug) "-DQT_NO_DEBUG"
++ lib.toList (args.NIX_CFLAGS_COMPILE or []);
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
cmakeFlags =
(args.cmakeFlags or [])

View File

@ -200,20 +200,17 @@ stdenv.mkDerivation {
done
'';
NIX_CFLAGS_COMPILE =
[
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
]
++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optionals withGtk3 [
''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
]
++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC";
++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
prefixKey = "-prefix ";

View File

@ -28,7 +28,7 @@ in stdenv.mkDerivation {
hardeningDisable = [ "format" ];
NIX_CFLAGS_COMPILE =
stdenv.lib.optional stdenv.isDarwin "-mmacosx-version-min=10.9";
stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
buildInputs = [ unzip ];
buildPhase = ''

View File

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47";
};
NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
NIX_CFLAGS_COMPILE = "-Wno-error";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libusb ];

View File

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
+ optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib ";
# Work around a bug in configure.
NIX_CFLAGS_COMPILE = [ "-DHAVE_X11_XLIB_H=1" "-lX11" "-lcairo" "-Wno-narrowing" ];
NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing";
preConfigure = "
substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='

View File

@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
buildInputs = [ makeWrapper SDL SDL_image ];
NIX_LDFLAGS = [
"-lm"
];
NIX_LDFLAGS = "-lm";
installPhase = ''
ls -l

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation {
sha256 = "157pp84wf0q3bdb72rnbm3ck0czwx2ply6lyhj8z7kfdc7csdbr3";
};
NIX_LDFLAGS = [ "-lSDL_image" ];
NIX_LDFLAGS = "-lSDL_image";
enableParallelBuilding = true;

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
'';
# fix build on gcc7+
NIX_CFLAGS_COMPILE = [
NIX_CFLAGS_COMPILE = builtins.toString [
"-Wno-error=builtin-declaration-mismatch"
"-Wno-error=implicit-fallthrough"
"-Wno-error=deprecated-copy"

View File

@ -17,7 +17,7 @@ let
# prevent failing with "cmake-3.13.4/nix-support/setup-hook: line 10: ./3rdParty/rocksdb/RocksDBConfig.cmake.in: No such file or directory"
dontFixCmake = lib.versionAtLeast version "3.5";
NIX_CFLAGS_COMPILE = lib.optionals (lib.versionAtLeast version "3.5") [ "-Wno-error" ];
NIX_CFLAGS_COMPILE = lib.optionalString (lib.versionAtLeast version "3.5") "-Wno-error";
preConfigure = lib.optionalString (lib.versionAtLeast version "3.5") "patchShebangs utils";
postPatch = ''

View File

@ -44,7 +44,7 @@ let
buildFlags = [ "world" ];
NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ];
NIX_CFLAGS_COMPILE = "-I${libxml2.dev}/include/libxml2";
# Otherwise it retains a reference to compiler and fails; see #44767. TODO: better.
preConfigure = "CC=${stdenv.cc.targetPrefix}cc";

View File

@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
osl seexpr makeWrapper
];
NIX_CFLAGS_COMPILE = [
NIX_CFLAGS_COMPILE = toString [
"-I${openexr.dev}/include/OpenEXR"
"-I${ilmbase.dev}/include/OpenEXR"
"-I${openimageio.dev}/include/OpenImageIO"

View File

@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
"--with-context=$out/share/texmf/tex/context/third"
];
NIX_CFLAGS_COMPILE = [ "-I${boehmgc.dev}/include/gc" ];
NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc";
postInstall = ''
mv $out/share/info/asymptote/*.info $out/share/info/

View File

@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
];
# Disable assertions which include -dev QtBase file paths.
NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG";
configureFlags = [
"--without-python"

View File

@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "15zxg6spcmd35r6xbidq2fgcg2nzyv1sbbqds08lzll70mqx4pj7";
};
NIX_CFLAGS_COMPILE = [ "-Wno-error=format"
NIX_CFLAGS_COMPILE = toString [
"-Wno-error=format"
"-Wno-error=format-truncation"
"-Wno-error=pointer-compare"
"-Wno-error=memset-elt-size"

View File

@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
name = "atinout-${version}";
version = "0.9.2-alpha";
NIX_CFLAGS_COMPILE = [ "-Werror=implicit-fallthrough=0" ];
NIX_CFLAGS_COMPILE = "-Werror=implicit-fallthrough=0";
LANG = "C.UTF-8";
nativeBuildInputs = [ ronn mount ];

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
buildInputs = [ libdv libjpeg libpng ]
++ lib.optionals (!withMinimal) [ gtk2 libX11 SDL SDL_gfx ];
NIX_CFLAGS_COMPILE = lib.optional (!withMinimal) "-I${SDL.dev}/include/SDL";
NIX_CFLAGS_COMPILE = lib.optionalString (!withMinimal) "-I${SDL.dev}/include/SDL";
postPatch = ''
sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure