diff options
author | Andreas Fuchs <asf@boinkor.net> | 2023-01-01 19:52:38 -0500 |
---|---|---|
committer | Andreas Fuchs <asf@materialize.com> | 2023-01-02 18:58:59 -0500 |
commit | 2430837315cfb9d2d0cbc7002ee9a1e8e9b63417 (patch) | |
tree | 60662960063004568e71a045d543da9e218ef28a /overlays | |
parent | cd444d8f2d284c90a1e898bd102a40176e6dfcfa (diff) | |
download | nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar.gz nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar.bz2 nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar.lz nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar.xz nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.tar.zst nixlib-2430837315cfb9d2d0cbc7002ee9a1e8e9b63417.zip |
Use build flags to add tree-sitter-grammars to RPATH on Darwin
It seems that on Darwin, adding the second rpath entry after build doesn't cause dlopen to search in that rpath entry: It might be because the code signature block is in the way. At any rate, this way works on Darwin.
Diffstat (limited to 'overlays')
-rw-r--r-- | overlays/emacs.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/overlays/emacs.nix b/overlays/emacs.nix index 9bf46eff2e2e..2e3a12d3cf5c 100644 --- a/overlays/emacs.nix +++ b/overlays/emacs.nix @@ -113,12 +113,11 @@ let (super.lib.concatStringsSep "\n" (["mkdir -p $out/lib"] ++ (map linkCmd plugins))); in { buildInputs = old.buildInputs ++ [ self.pkgs.tree-sitter tree-sitter-grammars ]; + buildFlags = super.lib.optionalString self.stdenv.isDarwin + "LDFLAGS=-Wl,-rpath,${super.lib.makeLibraryPath [tree-sitter-grammars]}"; TREE_SITTER_LIBS = "-ltree-sitter"; - # Add to list of directories dlopen/dynlib_open searches for tree sitter languages *.so/*.dylib. - postFixup = old.postFixup + super.lib.optionalString self.stdenv.isDarwin '' - install_name_tool -add_rpath ${super.lib.makeLibraryPath [ tree-sitter-grammars ]} $out/bin/emacs - /usr/bin/codesign -s - -f $out/bin/emacs - '' + super.lib.optionalString self.stdenv.isLinux '' + # Add to list of directories dlopen/dynlib_open searches for tree sitter languages *.so + postFixup = old.postFixup + super.lib.optionalString self.stdenv.isLinux '' ${self.pkgs.patchelf}/bin/patchelf --add-rpath ${super.lib.makeLibraryPath [ tree-sitter-grammars ]} $out/bin/emacs ''; } |