diff options
author | Brian Leung <29217594+leungbk@users.noreply.github.com> | 2023-01-02 18:12:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-02 18:12:08 -0800 |
commit | c14aeb3b51e1753e03429dd5f7f148be1abadda7 (patch) | |
tree | 5a44128865184e24f567e5a3fab8b5301345866c /overlays | |
parent | 9ef42377c7985840cfb65b5b9403e518d7d97afb (diff) | |
parent | 2430837315cfb9d2d0cbc7002ee9a1e8e9b63417 (diff) | |
download | nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar.gz nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar.bz2 nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar.lz nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar.xz nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.tar.zst nixlib-c14aeb3b51e1753e03429dd5f7f148be1abadda7.zip |
Merge pull request #290 from antifuchs/darwin-treesit-path-patching
Use build flags to add tree-sitter-grammars to RPATH 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 00ec16624109..180bd7a4bee1 100644 --- a/overlays/emacs.nix +++ b/overlays/emacs.nix @@ -114,12 +114,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 ''; } |