diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2023-03-24 20:41:20 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2023-03-29 08:39:47 +0200 |
commit | a5a715bb249ee4e531d7e743f5a4e4234dd29346 (patch) | |
tree | 89caf895c7116d593976ada70a8517c500053dcd | |
parent | 608cb37533f25a049d9363f7053890fdab6076eb (diff) |
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.
-rw-r--r-- | pkgs/servers/sql/postgresql/default.nix | 12 |
1 files changed, 7 insertions, 5 deletions
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" + ''} ''} ''; |