about summary refs log tree commit diff
path: root/pkgs/applications/editors/neovim
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-04 00:02:53 +0000
committerGitHub <noreply@github.com>2023-10-04 00:02:53 +0000
commitdc6e881362130743a06f59e6d8d48b7cd400ed78 (patch)
treed3249e195d414cb4744f0a663a4cd0270b3f6f37 /pkgs/applications/editors/neovim
parent98b8e0dee980244fc632178866b04888387ed166 (diff)
parent4b71f780ea0412e8a4b75e0dbdd3a723fa6765a6 (diff)
downloadnixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar.gz
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar.bz2
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar.lz
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar.xz
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.tar.zst
nixlib-dc6e881362130743a06f59e6d8d48b7cd400ed78.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/applications/editors/neovim')
-rw-r--r--pkgs/applications/editors/neovim/default.nix27
1 files changed, 25 insertions, 2 deletions
diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix
index 9bf6fb51bdff..4b77b2b7c666 100644
--- a/pkgs/applications/editors/neovim/default.nix
+++ b/pkgs/applications/editors/neovim/default.nix
@@ -7,6 +7,7 @@
 , buildPackages
 , treesitter-parsers ? import ./treesitter-parsers.nix { inherit fetchurl; }
 , CoreServices
+, fixDarwinDylibNames
 , glibcLocales ? null, procps ? null
 
 # now defaults to false because some tests can be flaky (clipboard etc), see
@@ -16,8 +17,29 @@
 }:
 
 let
+  nvim-lpeg-dylib = luapkgs: if stdenv.isDarwin
+    then (luapkgs.lpeg.overrideAttrs (oa: {
+      preConfigure = ''
+        # neovim wants clang .dylib
+        sed -i makefile -e "s/CC = gcc/CC = clang/"
+        sed -i makefile -e "s/-bundle/-dynamiclib/"
+      '';
+      preBuild = ''
+        # there seems to be implicit calls to Makefile from luarocks, we need to
+        # add a stage to build our dylib
+        make macosx
+        mkdir -p $out/lib
+        mv lpeg.so $out/lib/lpeg.dylib
+      '';
+      nativeBuildInputs =
+        oa.nativeBuildInputs
+        ++ (
+          lib.optional stdenv.isDarwin fixDarwinDylibNames
+        );
+    }))
+    else luapkgs.lpeg;
   requiredLuaPkgs = ps: (with ps; [
-    lpeg
+    (nvim-lpeg-dylib ps)
     luabitop
     mpack
   ] ++ lib.optionals doCheck [
@@ -40,10 +62,11 @@ let
             deterministicStringIds = true;
             self = deterministicLuajit;
           };
-        in deterministicLuajit.withPackages(ps: [ ps.mpack ps.lpeg ])
+        in deterministicLuajit.withPackages(ps: [ ps.mpack (nvim-lpeg-dylib ps) ])
       else lua.luaOnBuild;
 
   pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
+
 in
   stdenv.mkDerivation rec {
     pname = "neovim-unwrapped";