Skip to content

Commit

Permalink
postgresql: remove references to llvm-dev on darwin as well
Browse files Browse the repository at this point in the history
The !isDarwin condition seems to have been put in place only because of the
use of patchelf, which in turn seemed to be necessary because of nuke-refs.

Replacing the big nuke with the more granular remove-references-to allows
enabling this for darwin, too.
  • Loading branch information
wolfgangwalther committed Jun 3, 2024
1 parent 7e4a078 commit a2baf6c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions pkgs/servers/sql/postgresql/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let

# JIT
, jitSupport
, nukeReferences, patchelf, llvmPackages, overrideCC
, llvmPackages, overrideCC

# PL/Python
, pythonSupport ? false
Expand Down Expand Up @@ -109,7 +109,7 @@ let
pkg-config
removeReferencesTo
]
++ lib.optionals jitSupport [ llvmPackages.llvm.dev nukeReferences patchelf ];
++ lib.optionals jitSupport [ llvmPackages.llvm.dev ];

enableParallelBuilding = true;

Expand Down Expand Up @@ -210,15 +210,9 @@ let
moveToOutput "lib/*.a" "$dev"
'' + lib.optionalString jitSupport ''
# In the case of JIT support, prevent a retained dependency on clang-wrapper
nuke-refs $out/lib/llvmjit_types.bc $(find $out/lib/bitcode -type f)
${lib.optionalString (!stdenv'.isDarwin) ''
# Stop lib depending on the -dev output of llvm
rpath=$(patchelf --print-rpath $out/lib/llvmjit.so)
nuke-refs -e $out $out/lib/llvmjit.so
# Restore the correct rpath
patchelf $out/lib/llvmjit.so --set-rpath "$rpath"
''}
remove-references-to -t "${stdenv'.cc}" $out/lib/llvmjit_types.bc $(find $out/lib/bitcode -type f)
# Stop lib depending on the -dev output of llvm
remove-references-to -t "${llvmPackages.llvm.dev}" $out/lib/llvmjit.so
'';

postFixup = lib.optionalString (!stdenv'.isDarwin && stdenv'.hostPlatform.libc == "glibc")
Expand Down

0 comments on commit a2baf6c

Please sign in to comment.