about summary refs log tree commit diff
path: root/pkgs/tools/package-management/nix/default.nix
diff options
context:
space:
mode:
authorEdward Amsden <edward@blackriversoft.com>2020-03-02 07:07:42 -0500
committerEdward Amsden <edward@blackriversoft.com>2020-03-03 18:07:21 -0500
commit3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1 (patch)
tree18286d5a3d7c72ece18d02ccea41e54f4697f856 /pkgs/tools/package-management/nix/default.nix
parentf1415f633cb5cca0000dc5d5b36b717a1b11ae0f (diff)
downloadnixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar.gz
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar.bz2
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar.lz
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar.xz
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.tar.zst
nixlib-3b72c55fc5aff74cc7bdef1f15c04c29e5671ab1.zip
nix: Drive-by cleanup: replace ifthenelse with lib.optionalString
Diffstat (limited to 'pkgs/tools/package-management/nix/default.nix')
-rw-r--r--pkgs/tools/package-management/nix/default.nix21
1 files changed, 10 insertions, 11 deletions
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index a17a621fbbef..29af4a90cb90 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -66,17 +66,15 @@ common =
       preConfigure =
         # Copy libboost_context so we don't get all of Boost in our closure.
         # https://github.com/NixOS/nixpkgs/issues/45462
-        (if is20 then ''
-           mkdir -p $out/lib
-           cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
-           rm -f $out/lib/*.a
-           ${lib.optionalString stdenv.isLinux ''
-             chmod u+w $out/lib/*.so.*
-             patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
-           ''}
-         '' else ''
-           configureFlagsArray+=(BDW_GC_LIBS="-lgc -lgccpp")
-         '') +
+        lib.optionalString is20 ''
+          mkdir -p $out/lib
+          cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
+          rm -f $out/lib/*.a
+          ${lib.optionalString stdenv.isLinux ''
+            chmod u+w $out/lib/*.so.*
+            patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.*
+          ''}
+        '' +
         # For Nix-2.3, patch around an issue where the Nix configure step pulls in the
         # build system's bash and other utilities when cross-compiling
         lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform && isExactly23) ''
@@ -103,6 +101,7 @@ common =
           "--with-dbi=${perlPackages.DBI}/${perl.libPrefix}"
           "--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}"
           "--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}"
+          "BDW_GC_LIBS=\"-lgc -lgccpp\""
         ] ++ lib.optionals (is20 && stdenv.isLinux) [
           "--with-sandbox-shell=${sh}/bin/busybox"
         ]