From ab0cfd9e036ca83bdffb8790f7cf45179441cd93 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Wed, 30 Oct 2019 01:40:49 +0100 Subject: treewide: NIX_*_COMPILE -> string --- pkgs/development/libraries/argp-standalone/default.nix | 2 +- pkgs/development/libraries/aws-c-common/default.nix | 6 ++---- pkgs/development/libraries/glm/default.nix | 4 +--- pkgs/development/libraries/gpgme/default.nix | 4 ++-- pkgs/development/libraries/gsl/default.nix | 2 +- pkgs/development/libraries/gsl/gsl-1_16.nix | 2 +- pkgs/development/libraries/libbluray/default.nix | 2 +- pkgs/development/libraries/libunique/default.nix | 2 +- pkgs/development/libraries/opencv/3.x.nix | 2 +- pkgs/development/libraries/qt-4.x/4.8/default.nix | 4 ++-- pkgs/development/libraries/qt-5/mkDerivation.nix | 4 ++-- pkgs/development/libraries/qt-5/modules/qtbase.nix | 17 +++++++---------- pkgs/development/libraries/tinyxml/2.6.2.nix | 2 +- pkgs/development/libraries/usbredir/default.nix | 2 +- pkgs/development/libraries/wxwidgets/2.8/default.nix | 2 +- 15 files changed, 25 insertions(+), 32 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/argp-standalone/default.nix b/pkgs/development/libraries/argp-standalone/default.nix index 8fe3bd287c1..6544c481187 100644 --- a/pkgs/development/libraries/argp-standalone/default.nix +++ b/pkgs/development/libraries/argp-standalone/default.nix @@ -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'"; diff --git a/pkgs/development/libraries/aws-c-common/default.nix b/pkgs/development/libraries/aws-c-common/default.nix index 4286eedc87b..b10797d3d56 100644 --- a/pkgs/development/libraries/aws-c-common/default.nix +++ b/pkgs/development/libraries/aws-c-common/default.nix @@ -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"; diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix index 88b33601ee7..d39d6f0d7a3 100644 --- a/pkgs/development/libraries/glm/default.nix +++ b/pkgs/development/libraries/glm/default.nix @@ -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 diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 63072273c2e..ed2b5563bd3 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -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 ]; diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix index 1fd086ca23c..966d6a8ffd5 100644 --- a/pkgs/development/libraries/gsl/default.nix +++ b/pkgs/development/libraries/gsl/default.nix @@ -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"; diff --git a/pkgs/development/libraries/gsl/gsl-1_16.nix b/pkgs/development/libraries/gsl/gsl-1_16.nix index e5772c8772e..ae102ac6030 100644 --- a/pkgs/development/libraries/gsl/gsl-1_16.nix +++ b/pkgs/development/libraries/gsl/gsl-1_16.nix @@ -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 { diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix index 517251e137e..daa349ca630 100644 --- a/pkgs/development/libraries/libbluray/default.nix +++ b/pkgs/development/libraries/libbluray/default.nix @@ -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") ]; diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix index e0022411221..d6566978a6b 100644 --- a/pkgs/development/libraries/libunique/default.nix +++ b/pkgs/development/libraries/libunique/default.nix @@ -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 = [ diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 97df84637ef..642facf166a 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -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; diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index 632b5fc1fd5..25953949eb7 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -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"; diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix index 95357c096df..2c6333cb020 100644 --- a/pkgs/development/libraries/qt-5/mkDerivation.nix +++ b/pkgs/development/libraries/qt-5/mkDerivation.nix @@ -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 []) diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index c7cb6d509dc..cd426884d12 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -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 "; diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix index cc7c996f7c3..0cc4038b64e 100644 --- a/pkgs/development/libraries/tinyxml/2.6.2.nix +++ b/pkgs/development/libraries/tinyxml/2.6.2.nix @@ -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 = '' diff --git a/pkgs/development/libraries/usbredir/default.nix b/pkgs/development/libraries/usbredir/default.nix index 2eee80a7696..8e43135196c 100644 --- a/pkgs/development/libraries/usbredir/default.nix +++ b/pkgs/development/libraries/usbredir/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47"; }; - NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; + NIX_CFLAGS_COMPILE = "-Wno-error"; nativeBuildInputs = [ pkgconfig ]; buildInputs = [ libusb ]; diff --git a/pkgs/development/libraries/wxwidgets/2.8/default.nix b/pkgs/development/libraries/wxwidgets/2.8/default.nix index 38ee4376ac2..73dac47307a 100644 --- a/pkgs/development/libraries/wxwidgets/2.8/default.nix +++ b/pkgs/development/libraries/wxwidgets/2.8/default.nix @@ -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=' -- cgit 1.4.1