neovim: fix build on darwin, cleanup lua paths

fixes #16152

The cmake script had trouble finding the lua paths, this sets them
using “luaPackages.getLuaPath” and “luaPackages.getLuaCPath”.
This commit is contained in:
Matthew Bauer 2016-06-11 21:11:31 -05:00
parent b331af6de6
commit e0884e85cf
2 changed files with 16 additions and 15 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, cmake, gettext, glib, libmsgpack, libtermkey
, libtool, libuv, lua, luajit, luaPackages, man, ncurses, perl, pkgconfig
, libtool, libuv, luajit, luaPackages, man, ncurses, perl, pkgconfig
, unibilium, makeWrapper, vimUtils, xsel
, withPython ? true, pythonPackages, extraPythonPackages ? []
@ -75,20 +75,14 @@ let
glib
libtermkey
libuv
# For some reason, `luajit` has to be listed after `lua`. See
# https://github.com/NixOS/nixpkgs/issues/14442
lua
luajit
libmsgpack
ncurses
neovimLibvterm
unibilium
luaPackages.lpeg
luaPackages.mpack
luaPackages.luabitop
] ++ optional withJemalloc jemalloc;
luajit
luaPackages.lua
] ++ optional withJemalloc jemalloc
++ lualibs;
nativeBuildInputs = [
cmake
@ -97,11 +91,13 @@ let
pkgconfig
];
LUA_CPATH = "${luaPackages.lpeg}/lib/lua/${lua.luaversion}/?.so;${luaPackages.mpack}/lib/lua/${lua.luaversion}/?.so;${luaPackages.luabitop}/lib/lua/${lua.luaversion}/?.so";
LUA_PATH = stdenv.lib.concatStringsSep ";" (map luaPackages.getLuaPath lualibs);
LUA_CPATH = stdenv.lib.concatStringsSep ";" (map luaPackages.getLuaCPath lualibs);
configureFlags = [
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
"-DENABLE_JEMALLOC=ON"
lualibs = [ luaPackages.mpack luaPackages.lpeg luaPackages.luabitop ];
cmakeFlags = [
"-DLUA_PRG=${luaPackages.lua}/bin/lua"
];
preConfigure = ''

View File

@ -19,6 +19,11 @@ let
inherit lua;
inherit (stdenv.lib) maintainers;
# helper functions for dealing with LUA_PATH and LUA_CPATH
getPath = lib : type : "${lib}/lib/lua/${lua.luaversion}/?.${type};${lib}/share/lua/${lua.luaversion}/?.${type}";
getLuaPath = lib : getPath lib "lua";
getLuaCPath = lib : getPath lib "so";
#define build lua package function
buildLuaPackage = callPackage ../development/lua-modules/generic lua;