From d0cb52596ee15fcfcf6e97d4c86d61b9cc7a9c40 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 11 Jun 2016 21:00:47 -0500 Subject: [PATCH 1/3] libmpack: fix building on darwin --- pkgs/development/libraries/libmpack/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/libmpack/default.nix b/pkgs/development/libraries/libmpack/default.nix index 867a7ccf79df..b45d5f3d2ce0 100644 --- a/pkgs/development/libraries/libmpack/default.nix +++ b/pkgs/development/libraries/libmpack/default.nix @@ -10,6 +10,7 @@ stdenv.mkDerivation rec { inherit rev; sha256 = "1h3pbmykm69gfyi0wz647gz5836a6f3jc4azzll7i3mkpc11gcrd"; }; + LIBTOOL = "libtool"; buildInputs = [ libtool ]; installPhase = '' mkdir -p $out/lib/libmpack From b331af6de6eab62be38b4abbce12cbbad414ba25 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 11 Jun 2016 21:02:33 -0500 Subject: [PATCH 2/3] lua-mpack: fix building with clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clang has some things considered “warnings” that gcc doesn’t so it is necessary to set “-Wno-error” to build under clang. --- pkgs/top-level/lua-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index c90a8452c25b..7a315eaa4d23 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -398,6 +398,7 @@ let preInstall = '' mkdir -p $out/lib/lua/${lua.luaversion} ''; + NIX_CFLAGS_COMPILE = "-Wno-error -fpic"; installFlags = [ "USE_SYSTEM_LUA=yes" "LUA_VERSION_MAJ_MIN=" From e0884e85cfc2634aeb2d7456f9e0cf6b7dc3b945 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 11 Jun 2016 21:11:31 -0500 Subject: [PATCH 3/3] neovim: fix build on darwin, cleanup lua paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #16152 The cmake script had trouble finding the lua paths, this sets them using “luaPackages.getLuaPath” and “luaPackages.getLuaCPath”. --- pkgs/applications/editors/neovim/default.nix | 26 +++++++++----------- pkgs/top-level/lua-packages.nix | 5 ++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix index d00d9a79ac77..15bd695aafc8 100644 --- a/pkgs/applications/editors/neovim/default.nix +++ b/pkgs/applications/editors/neovim/default.nix @@ -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 = '' diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 7a315eaa4d23..5f38fdf42aa7 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -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;