git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31759 from LnL7/darwin-libmpack

libmpack: fix darwin build

commit4cf3a494ccf965e1d72704054ce0bd93ae9f2e8f authorDaiderd Jordan <daiderd@gmail.com> dateWed 29 Nov 2017, 08:07 (9 years ago) parent898aedcb7ed086
3 files changed+16−19
pkgs/development/interpreters/lua-5/5.1.nix+2−1 pkgs/development/libraries/libmpack/default.nix+5−5 pkgs/top-level/lua-packages.nix+9−13
pkgs/development/interpreters/lua-5/5.1.nix+2−1
@@ -8,7 +8,8 @@ let
88 };
99in
1010stdenv.mkDerivation rec {
11− name = "lua-5.1.5";
11+ name = "lua-${version}";
12+ version = "5.1.5";
1213 luaversion = "5.1";
1314
1415 src = fetchurl {
pkgs/development/libraries/libmpack/default.nix+5−5
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
99 rev = version;
1010 sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2";
1111 };
12− LIBTOOL = "libtool";
13− buildInputs = [ libtool ];
14− preInstall = ''
15− export PREFIX=$out
16− '';
12+
13+ nativeBuildInputs = [ libtool ];
14+
15+ makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ];
16+
1717 meta = with stdenv.lib; {
1818 description = "Simple implementation of msgpack in C";
1919 homepage = https://github.com/tarruda/libmpack/;
pkgs/top-level/lua-packages.nix+9−13
@@ -614,34 +614,30 @@ let
614614 };
615615
616616 mpack = buildLuaPackage rec {
617− name = "lua-mpack-${version}";
618− version = "1.0.7_${rev}";
619− rev = "ef025224a799066b818120fb1f30a308543a6e99";
617+ name = "mpack-${version}";
618+ version = "1.0.7";
620619
621620 src = fetchFromGitHub {
622621 owner = "libmpack";
623622 repo = "libmpack-lua";
624− inherit rev;
623+ rev = version;
625624 sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb";
626625 };
627626
628627 nativeBuildInputs = [ pkgconfig ];
629− buildInputs = [ libmpack ]; # ++ [ libtool lua ];
628+ buildInputs = [ libmpack ];
630629 dontBuild = true;
631630
632− preInstall = ''
633− mkdir -p $out/lib/lua/${lua.luaversion}
634− export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${libmpack}
631+ postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
632+ substituteInPlace Makefile \
633+ --replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
635634 '';
636635
637− NIX_CFLAGS_COMPILE = "-Wno-error -fpic";
638−
639636 installFlags = [
640637 "USE_SYSTEM_LUA=yes"
641638 "USE_SYSTEM_MPACK=yes"
642− "MPACK_LUA_VERSION=${(builtins.parseDrvName lua.name).version}"
643− "LUA_INCLUDE=-I${lua}/include"
644− "LUA_CMOD_INSTALLDIR=$$out/lib/lua/${lua.luaversion}"
639+ "MPACK_LUA_VERSION=${lua.version}"
640+ "LUA_CMOD_INSTALLDIR=$(out)/lib/lua/${lua.luaversion}"
645641 ];
646642
647643 meta = with stdenv.lib; {