Skip to content

Commit

Permalink
neovim: fix build on Darwin
Browse files Browse the repository at this point in the history
libluv path passed to -DLIBLUV_LIBRARY broken by change in libluv, eg:
libluv.dylib -> libluv.1.30.0.dylib

Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
  • Loading branch information
siriobalmelli committed Aug 14, 2020
1 parent 00c4808 commit 0f1434c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkgs/applications/editors/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -47,7 +55,7 @@ in
libtermkey
libuv
libvterm-neovim
lua.pkgs.luv.libluv
luv.libluv
msgpack
ncurses
neovimLuaEnv
Expand Down Expand Up @@ -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"
;
Expand Down

0 comments on commit 0f1434c

Please sign in to comment.