From d7039d5029f248617e5e29c6d981e89e5b1bec78 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Thu, 16 Nov 2017 22:57:34 +0100 Subject: [PATCH 1/3] libmpack: fix darwin build On darwin we need the correct prefix during the buildPhase, otherwise the dynamic libraries have an incorrect install_name. --- pkgs/development/libraries/libmpack/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libmpack/default.nix b/pkgs/development/libraries/libmpack/default.nix index e9bc2a646b71..2754c726da2b 100644 --- a/pkgs/development/libraries/libmpack/default.nix +++ b/pkgs/development/libraries/libmpack/default.nix @@ -9,11 +9,11 @@ stdenv.mkDerivation rec { rev = version; sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2"; }; - LIBTOOL = "libtool"; - buildInputs = [ libtool ]; - preInstall = '' - export PREFIX=$out - ''; + + nativeBuildInputs = [ libtool ]; + + makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ]; + meta = with stdenv.lib; { description = "Simple implementation of msgpack in C"; homepage = https://github.com/tarruda/libmpack/; From 00ced68a9e1223dad4b8c035a65f87721693a532 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Wed, 29 Nov 2017 03:00:21 +0000 Subject: [PATCH 2/3] lua5_1: provide version --- pkgs/development/interpreters/lua-5/5.1.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix index cdbb2324dc65..1981c15c5f3e 100644 --- a/pkgs/development/interpreters/lua-5/5.1.nix +++ b/pkgs/development/interpreters/lua-5/5.1.nix @@ -8,7 +8,8 @@ let }; in stdenv.mkDerivation rec { - name = "lua-5.1.5"; + name = "lua-${version}"; + version = "5.1.5"; luaversion = "5.1"; src = fetchurl { From b7ed08665039128c24c772ba41431f24d8bbfc37 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 20 Nov 2017 23:44:47 +0100 Subject: [PATCH 3/3] lua-mpack: fix darwin build --- pkgs/top-level/lua-packages.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index e3eaa7c7f589..47299791e86b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -614,34 +614,30 @@ let }; mpack = buildLuaPackage rec { - name = "lua-mpack-${version}"; - version = "1.0.7_${rev}"; - rev = "ef025224a799066b818120fb1f30a308543a6e99"; + name = "mpack-${version}"; + version = "1.0.7"; src = fetchFromGitHub { owner = "libmpack"; repo = "libmpack-lua"; - inherit rev; + rev = version; sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb"; }; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ libmpack ]; # ++ [ libtool lua ]; + buildInputs = [ libmpack ]; dontBuild = true; - preInstall = '' - mkdir -p $out/lib/lua/${lua.luaversion} - export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${libmpack} + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + substituteInPlace Makefile \ + --replace '-shared' '-bundle -undefined dynamic_lookup -all_load' ''; - NIX_CFLAGS_COMPILE = "-Wno-error -fpic"; - installFlags = [ "USE_SYSTEM_LUA=yes" "USE_SYSTEM_MPACK=yes" - "MPACK_LUA_VERSION=${(builtins.parseDrvName lua.name).version}" - "LUA_INCLUDE=-I${lua}/include" - "LUA_CMOD_INSTALLDIR=$$out/lib/lua/${lua.luaversion}" + "MPACK_LUA_VERSION=${lua.version}" + "LUA_CMOD_INSTALLDIR=$(out)/lib/lua/${lua.luaversion}" ]; meta = with stdenv.lib; {