diff --git a/pkgs/applications/graphics/apngasm/2.nix b/pkgs/applications/graphics/apngasm/2.nix index cd518f5df658..0435ec6236a8 100644 --- a/pkgs/applications/graphics/apngasm/2.nix +++ b/pkgs/applications/graphics/apngasm/2.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { rm -rf libpng zlib zopfli ''; - NIX_CFLAGS_LINK = "-lzopfli"; + env.NIX_CFLAGS_LINK = "-lzopfli"; installPhase = '' install -Dt $out/bin apngasm diff --git a/pkgs/by-name/ap/aprutil/package.nix b/pkgs/by-name/ap/aprutil/package.nix index 66c9d3af92dc..f140e7a61493 100644 --- a/pkgs/by-name/ap/aprutil/package.nix +++ b/pkgs/by-name/ap/aprutil/package.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional stdenv.hostPlatform.isFreeBSD ./include-static-dependencies.patch; - NIX_CFLAGS_LINK = [ "-lcrypt" ]; + env.NIX_CFLAGS_LINK = toString [ "-lcrypt" ]; outputs = [ "out" diff --git a/pkgs/by-name/ds/dsniff/package.nix b/pkgs/by-name/ds/dsniff/package.nix index 22069f210ab6..8d935d49f6f2 100644 --- a/pkgs/by-name/ds/dsniff/package.nix +++ b/pkgs/by-name/ds/dsniff/package.nix @@ -103,8 +103,19 @@ stdenv.mkDerivation (finalAttrs: { libnsl libnl ]; - NIX_CFLAGS_LINK = "-lglib-2.0 -lpthread -ltirpc -lnl-3 -lnl-genl-3"; - env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ]; + + env = { + NIX_CFLAGS_LINK = toString [ + "-lglib-2.0" + "-lpthread" + "-ltirpc" + "-lnl-3" + "-lnl-genl-3" + ]; + NIX_CFLAGS_COMPILE = toString [ + "-I${libtirpc.dev}/include/tirpc" + ]; + }; postPatch = '' for patch in debian/patches/*.patch; do patch < $patch diff --git a/pkgs/by-name/he/hebbot/package.nix b/pkgs/by-name/he/hebbot/package.nix index ce1a2b6f57e9..8981a5d90c3a 100644 --- a/pkgs/by-name/he/hebbot/package.nix +++ b/pkgs/by-name/he/hebbot/package.nix @@ -40,13 +40,12 @@ rustPlatform.buildRustPackage (finalAttrs: { env = { OPENSSL_NO_VENDOR = 1; + NIX_CFLAGS_LINK = toString [ + "-L${lib.getLib openssl}/lib" + "-L${lib.getLib sqlite}/lib" + ]; }; - NIX_CFLAGS_LINK = [ - "-L${lib.getLib openssl}/lib" - "-L${lib.getLib sqlite}/lib" - ]; - passthru.updateScript = unstableGitUpdater { }; meta = { diff --git a/pkgs/by-name/io/iortcw/sp.nix b/pkgs/by-name/io/iortcw/sp.nix index 863f61dafdc2..7876192f0660 100644 --- a/pkgs/by-name/io/iortcw/sp.nix +++ b/pkgs/by-name/io/iortcw/sp.nix @@ -47,11 +47,15 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ makeWrapper ]; - env.NIX_CFLAGS_COMPILE = toString [ - "-I${lib.getInclude SDL2}/include/SDL2" - "-I${opusfile.dev}/include/opus" - ]; - NIX_CFLAGS_LINK = [ "-lSDL2" ]; + env = { + NIX_CFLAGS_COMPILE = toString [ + "-I${lib.getInclude SDL2}/include/SDL2" + "-I${opusfile.dev}/include/opus" + ]; + NIX_CFLAGS_LINK = toString [ + "-lSDL2" + ]; + }; postInstall = '' for i in `find $out/opt/iortcw -maxdepth 1 -type f -executable`; do diff --git a/pkgs/by-name/li/libsndfile/package.nix b/pkgs/by-name/li/libsndfile/package.nix index 18beb16107b4..9fadf930ba0e 100644 --- a/pkgs/by-name/li/libsndfile/package.nix +++ b/pkgs/by-name/li/libsndfile/package.nix @@ -78,7 +78,10 @@ stdenv.mkDerivation (finalAttrs: { ''; # Needed on Darwin. - NIX_CFLAGS_LINK = "-logg -lvorbis"; + env.NIX_CFLAGS_LINK = toString [ + "-logg" + "-lvorbis" + ]; # Broken with libopus >= 1.6.0 doCheck = false; diff --git a/pkgs/by-name/op/openspades/package.nix b/pkgs/by-name/op/openspades/package.nix index 4379fbe12e2c..6eebb66c8429 100644 --- a/pkgs/by-name/op/openspades/package.nix +++ b/pkgs/by-name/op/openspades/package.nix @@ -93,7 +93,7 @@ stdenv.mkDerivation rec { cp $notoFont $out/share/games/openspades/Resources/ ''; - NIX_CFLAGS_LINK = "-lopenal"; + env.NIX_CFLAGS_LINK = "-lopenal"; meta = { description = "Compatible client of Ace of Spades 0.75"; diff --git a/pkgs/by-name/to/tor/package.nix b/pkgs/by-name/to/tor/package.nix index 2778700d8ad2..034771bef7f8 100644 --- a/pkgs/by-name/to/tor/package.nix +++ b/pkgs/by-name/to/tor/package.nix @@ -85,7 +85,9 @@ stdenv.mkDerivation (finalAttrs: { # cross compiles correctly but needs the following lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--disable-tool-name-check" ]; - NIX_CFLAGS_LINK = lib.optionalString stdenv.cc.isGNU "-lgcc_s"; + env = lib.optionalAttrs stdenv.cc.isGNU { + NIX_CFLAGS_LINK = "-lgcc_s"; + }; postPatch = '' substituteInPlace contrib/client-tools/torify \ diff --git a/pkgs/by-name/uf/ufoai/package.nix b/pkgs/by-name/uf/ufoai/package.nix index 751fccaaab98..b245e5c92b77 100644 --- a/pkgs/by-name/uf/ufoai/package.nix +++ b/pkgs/by-name/uf/ufoai/package.nix @@ -30,12 +30,21 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "1drhh08cqqkwv1yz3z4ngkplr23pqqrdx6cp8c3isy320gy25cvb"; }; - # Workaround build failure on -fno-common toolchains: - # ld: r_gl.h:52: multiple definition of `qglGenBuffers'; - # r_gl.h:52: first defined here - # TODO: drop once release contains upstream fix: - # https://github.com/ufoai/ufoai/commit/8a3075fffdad294e - env.NIX_CFLAGS_COMPILE = "-fcommon"; + env = { + # Workaround build failure on -fno-common toolchains: + # ld: r_gl.h:52: multiple definition of `qglGenBuffers'; + # r_gl.h:52: first defined here + # TODO: drop once release contains upstream fix: + # https://github.com/ufoai/ufoai/commit/8a3075fffdad294e + NIX_CFLAGS_COMPILE = "-fcommon"; + NIX_CFLAGS_LINK = toString [ + # to avoid occasional runtime error in finding libgcc_s.so.1 + "-lgcc_s" + # tests are underlinked against libm: + # ld: release-linux-x86_64/testall/client/sound/s_mix.c.o: undefined reference to symbol 'acos@@GLIBC_2.2.5' + "-lm" + ]; + }; preConfigure = ''tar xvf "${finalAttrs.srcData}"''; @@ -60,14 +69,6 @@ stdenv.mkDerivation (finalAttrs: { cunit ]; - NIX_CFLAGS_LINK = [ - # to avoid occasional runtime error in finding libgcc_s.so.1 - "-lgcc_s" - # tests are underlinked against libm: - # ld: release-linux-x86_64/testall/client/sound/s_mix.c.o: undefined reference to symbol 'acos@@GLIBC_2.2.5' - "-lm" - ]; - meta = { homepage = "http://ufoai.org"; description = "Squad-based tactical strategy game in the tradition of X-Com"; diff --git a/pkgs/by-name/xb/xbill/package.nix b/pkgs/by-name/xb/xbill/package.nix index a8c1ba2c4aa2..20185d4007aa 100644 --- a/pkgs/by-name/xb/xbill/package.nix +++ b/pkgs/by-name/xb/xbill/package.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: { motif ]; - NIX_CFLAGS_LINK = "-lXpm"; + env.NIX_CFLAGS_LINK = "-lXpm"; configureFlags = [ "--with-x" diff --git a/pkgs/by-name/zd/zdoom/package.nix b/pkgs/by-name/zd/zdoom/package.nix index 44994bececb1..395b59635d4c 100644 --- a/pkgs/by-name/zd/zdoom/package.nix +++ b/pkgs/by-name/zd/zdoom/package.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { sourceRoot = "."; - NIX_CFLAGS_LINK = [ + env.NIX_CFLAGS_LINK = toString [ "-lopenal" "-lfluidsynth" ]; diff --git a/pkgs/by-name/ze/zeroad-unwrapped/package.nix b/pkgs/by-name/ze/zeroad-unwrapped/package.nix index 803f4288dfc7..56a64a60e0e5 100644 --- a/pkgs/by-name/ze/zeroad-unwrapped/package.nix +++ b/pkgs/by-name/ze/zeroad-unwrapped/package.nix @@ -103,18 +103,20 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional withEditor wxGTK32; - env.NIX_CFLAGS_COMPILE = toString [ - "-I${xorgproto}/include" - "-I${libx11.dev}/include" - "-I${libxcursor.dev}/include" - "-I${SDL2}/include/SDL2" - "-I${fmt_9.dev}/include" - "-I${nvidia-texture-tools.dev}/include" - ]; + env = { + NIX_CFLAGS_COMPILE = toString [ + "-I${xorgproto}/include" + "-I${libx11.dev}/include" + "-I${libxcursor.dev}/include" + "-I${SDL2}/include/SDL2" + "-I${fmt_9.dev}/include" + "-I${nvidia-texture-tools.dev}/include" + ]; - NIX_CFLAGS_LINK = toString [ - "-L${nvidia-texture-tools.lib}/lib/static" - ]; + NIX_CFLAGS_LINK = toString [ + "-L${nvidia-texture-tools.lib}/lib/static" + ]; + }; patches = [ ./rootdir_env.patch diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix index 25e5492ef71a..9420a6a203ab 100644 --- a/pkgs/development/libraries/librdf/redland.nix +++ b/pkgs/development/libraries/librdf/redland.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { ]; # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so. - NIX_CFLAGS_LINK = "-lraptor2"; + env.NIX_CFLAGS_LINK = "-lraptor2"; doCheck = false; # fails 1 out of 17 tests with a segmentation fault