mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
lua-{5.2,5.3}: cross fixups, drop crossAttrs
mostly just forward environment variables to make arguments,
this partially reverts 5d1e51a199
which removed them because they're already set in env--
but that's not enough to override make vars.
Also, readline is buildInput not nativeBuildInput
(we need headers and to link against it)
This commit is contained in:
parent
c7b3373851
commit
ebe7b86bac
@ -19,17 +19,17 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0b8034v1s82n4dg5rzcn12067ha3nxaylp2vdp8gg08kjsbzphhk";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ readline ];
|
||||
buildInputs = [ readline ];
|
||||
|
||||
patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [ dsoPatch ];
|
||||
|
||||
configurePhase =
|
||||
if stdenv.isDarwin
|
||||
then ''
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} )
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} CC="$CC" )
|
||||
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.${version}.dylib" INSTALL_DATA='cp -d' )
|
||||
'' else ''
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} )
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} CC="$CC" AR="$AR q" RANLIB="$RANLIB" )
|
||||
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}" INSTALL_DATA='cp -d' )
|
||||
'';
|
||||
|
||||
@ -56,31 +56,6 @@ stdenv.mkDerivation rec {
|
||||
EOF
|
||||
'';
|
||||
|
||||
crossAttrs = let
|
||||
inherit (hostPlatform) isDarwin isMinGW;
|
||||
in {
|
||||
configurePhase = ''
|
||||
makeFlagsArray=(
|
||||
INSTALL_TOP=$out
|
||||
INSTALL_MAN=$out/share/man/man1
|
||||
V=${luaversion}
|
||||
R=${version}
|
||||
${if isMinGW then "mingw" else stdenv.lib.optionalString isDarwin ''
|
||||
''}
|
||||
)
|
||||
'' + stdenv.lib.optionalString isMinGW ''
|
||||
installFlagsArray=(
|
||||
TO_BIN="lua.exe luac.exe"
|
||||
TO_LIB="liblua.a lua52.dll"
|
||||
INSTALL_DATA="cp -d"
|
||||
)
|
||||
'';
|
||||
} // stdenv.lib.optionalAttrs isDarwin {
|
||||
postPatch = ''
|
||||
sed -i -e 's/-Wl,-soname[^ ]* *//' src/Makefile
|
||||
'';
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://www.lua.org;
|
||||
description = "Powerful, fast, lightweight, embeddable scripting language";
|
||||
|
@ -12,17 +12,17 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ readline ];
|
||||
buildInputs = [ readline ];
|
||||
|
||||
patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else [];
|
||||
|
||||
configurePhase =
|
||||
if stdenv.isDarwin
|
||||
then ''
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} )
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=macosx CFLAGS="-DLUA_USE_LINUX -fno-common -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} CC="$CC" )
|
||||
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.${version}.dylib" INSTALL_DATA='cp -d' )
|
||||
'' else ''
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version})
|
||||
makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" LDFLAGS="-fPIC" V=${luaversion} R=${version} CC="$CC" AR="$AR q" RANLIB="$RANLIB" )
|
||||
installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}" INSTALL_DATA='cp -d' )
|
||||
cat ${./lua-5.3-dso.make} >> src/Makefile
|
||||
sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile
|
||||
@ -55,31 +55,6 @@ stdenv.mkDerivation rec {
|
||||
EOF
|
||||
'';
|
||||
|
||||
crossAttrs = let
|
||||
inherit (hostPlatform) isDarwin isMinGW;
|
||||
in {
|
||||
configurePhase = ''
|
||||
makeFlagsArray=(
|
||||
INSTALL_TOP=$out
|
||||
INSTALL_MAN=$out/share/man/man1
|
||||
V=${luaversion}
|
||||
R=${version}
|
||||
${if isMinGW then "mingw" else stdenv.lib.optionalString isDarwin ''
|
||||
''}
|
||||
)
|
||||
'' + stdenv.lib.optionalString isMinGW ''
|
||||
installFlagsArray=(
|
||||
TO_BIN="lua.exe luac.exe"
|
||||
TO_LIB="liblua.a lua52.dll"
|
||||
INSTALL_DATA="cp -d"
|
||||
)
|
||||
'';
|
||||
} // stdenv.lib.optionalAttrs isDarwin {
|
||||
postPatch = ''
|
||||
sed -i -e 's/-Wl,-soname[^ ]* *//' src/Makefile
|
||||
'';
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = http://www.lua.org;
|
||||
description = "Powerful, fast, lightweight, embeddable scripting language";
|
||||
|
Loading…
Reference in New Issue
Block a user