Merge pull request #31759 from LnL7/darwin-libmpack
libmpack: fix darwin build
This commit is contained in:
commit
4cf3a494cc
|
@ -8,7 +8,8 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "lua-5.1.5";
|
name = "lua-${version}";
|
||||||
|
version = "5.1.5";
|
||||||
luaversion = "5.1";
|
luaversion = "5.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
|
|
@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2";
|
sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2";
|
||||||
};
|
};
|
||||||
LIBTOOL = "libtool";
|
|
||||||
buildInputs = [ libtool ];
|
nativeBuildInputs = [ libtool ];
|
||||||
preInstall = ''
|
|
||||||
export PREFIX=$out
|
makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ];
|
||||||
'';
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Simple implementation of msgpack in C";
|
description = "Simple implementation of msgpack in C";
|
||||||
homepage = https://github.com/tarruda/libmpack/;
|
homepage = https://github.com/tarruda/libmpack/;
|
||||||
|
|
|
@ -614,34 +614,30 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
mpack = buildLuaPackage rec {
|
mpack = buildLuaPackage rec {
|
||||||
name = "lua-mpack-${version}";
|
name = "mpack-${version}";
|
||||||
version = "1.0.7_${rev}";
|
version = "1.0.7";
|
||||||
rev = "ef025224a799066b818120fb1f30a308543a6e99";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "libmpack";
|
owner = "libmpack";
|
||||||
repo = "libmpack-lua";
|
repo = "libmpack-lua";
|
||||||
inherit rev;
|
rev = version;
|
||||||
sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb";
|
sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ libmpack ]; # ++ [ libtool lua ];
|
buildInputs = [ libmpack ];
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
preInstall = ''
|
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
mkdir -p $out/lib/lua/${lua.luaversion}
|
substituteInPlace Makefile \
|
||||||
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${libmpack}
|
--replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-Wno-error -fpic";
|
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"USE_SYSTEM_LUA=yes"
|
"USE_SYSTEM_LUA=yes"
|
||||||
"USE_SYSTEM_MPACK=yes"
|
"USE_SYSTEM_MPACK=yes"
|
||||||
"MPACK_LUA_VERSION=${(builtins.parseDrvName lua.name).version}"
|
"MPACK_LUA_VERSION=${lua.version}"
|
||||||
"LUA_INCLUDE=-I${lua}/include"
|
"LUA_CMOD_INSTALLDIR=$(out)/lib/lua/${lua.luaversion}"
|
||||||
"LUA_CMOD_INSTALLDIR=$$out/lib/lua/${lua.luaversion}"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
Loading…
Reference in New Issue