about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2020-08-17 17:14:44 +0200
committerGitHub <noreply@github.com>2020-08-17 17:14:44 +0200
commitad6d9ad5b652049090104928ae7b1d08687079e2 (patch)
tree4b6dd8ad0d56c8b4036360c086e0e85deb09248c /pkgs/applications/editors
parentd829adbee8f1c519abcd10d071b142545b4e7f4b (diff)
parent0f1434cb2adb8bec6678b53510750ce7c1814263 (diff)
Merge pull request #95364 from siriobalmelli-foss/fix/neovim
neovim: fix build on Darwin
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/neovim/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix
index e56e7d9380732..b546aae790a7f 100644
--- a/pkgs/applications/editors/neovim/default.nix
+++ b/pkgs/applications/editors/neovim/default.nix
@@ -20,6 +20,14 @@ let
     ));
 
   pyEnv = python.withPackages(ps: [ ps.pynvim ps.msgpack ]);
+
+  # FIXME: this is verry messy and strange.
+  # see https://github.com/NixOS/nixpkgs/pull/80528
+  luv = lua.pkgs.luv;
+  luvpath = with builtins ; if stdenv.isDarwin
+    then "${luv.libluv}/lib/lua/${lua.luaversion}/libluv.${head (match "([0-9.]+).*" luv.version)}.dylib"
+    else "${luv}/lib/lua/${lua.luaversion}/luv.so";
+
 in
   stdenv.mkDerivation rec {
     pname = "neovim-unwrapped";
@@ -47,7 +55,7 @@ in
       libtermkey
       libuv
       libvterm-neovim
-      lua.pkgs.luv.libluv
+      luv.libluv
       msgpack
       ncurses
       neovimLuaEnv
@@ -88,10 +96,8 @@ in
     cmakeFlags = [
       "-DGPERF_PRG=${gperf}/bin/gperf"
       "-DLUA_PRG=${neovimLuaEnv.interpreter}"
+      "-DLIBLUV_LIBRARY=${luvpath}"
     ]
-    # FIXME: this is verry messy and strange.
-    ++ optional (!stdenv.isDarwin) "-DLIBLUV_LIBRARY=${lua.pkgs.luv}/lib/lua/${lua.luaversion}/luv.so"
-    ++ optional (stdenv.isDarwin) "-DLIBLUV_LIBRARY=${lua.pkgs.luv.libluv}/lib/lua/${lua.luaversion}/libluv.dylib"
     ++ optional doCheck "-DBUSTED_PRG=${neovimLuaEnv}/bin/busted"
     ++ optional (!lua.pkgs.isLuaJIT) "-DPREFER_LUA=ON"
     ;