From a5a715bb249ee4e531d7e743f5a4e4234dd29346 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 24 Mar 2023 20:41:20 +0100 Subject: postgresql_jit: fix darwin build So, patchelf works on ELF files and these don't exist on Darwin. I'm not aware of any other way to eliminate all references of the executable's body while preserving library paths in the header. This still works, the only problem is that darwin has a dependency on llvm.dev, so it's runtime closure is larger. --- pkgs/servers/sql/postgresql/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pkgs/servers') diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index 82a590e898f93..0b50b0ebfc949 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -164,11 +164,13 @@ let --replace ${self.llvmPackages.llvm.dev}/bin/llvm-config llvm-config \ --replace -I${self.llvmPackages.llvm.dev}/include "" - # 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" + ${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" + ''} ''} ''; -- cgit 1.4.1