Merge 'mingw-w64' and 'darwin' into cross-win-osx.
Both branches have quite a lot in common, so it's time for a merge and do the cleanups with respect to both implementations and also generalize both implementations as much as possible. This also closes #1876. Conflicts: pkgs/development/interpreters/lua-5/5.2.nix pkgs/development/libraries/SDL/default.nix pkgs/development/libraries/glew/default.nix pkgs/top-level/all-packages.nix
This commit is contained in:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "004zyh9p3lpvbwhyhlmrw6wwcia5abx84q4h2brkn4zdypipvmiz";
|
||||
};
|
||||
|
||||
buildInputs = [ readline ];
|
||||
nativeBuildInputs = [ readline ];
|
||||
|
||||
patches = [ dsoPatch ];
|
||||
|
||||
@@ -49,6 +49,37 @@ stdenv.mkDerivation rec {
|
||||
EOF
|
||||
'';
|
||||
|
||||
crossAttrs = let
|
||||
isMingw = stdenv.cross.libc == "msvcrt";
|
||||
isDarwin = stdenv.cross.libc == "libSystem";
|
||||
in {
|
||||
configurePhase = ''
|
||||
makeFlagsArray=(
|
||||
INSTALL_TOP=$out
|
||||
INSTALL_MAN=$out/share/man/man1
|
||||
CC=${stdenv.cross.config}-gcc
|
||||
STRIP=:
|
||||
RANLIB=${stdenv.cross.config}-ranlib
|
||||
V=${majorVersion}
|
||||
R=${version}
|
||||
${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin ''
|
||||
AR="${stdenv.cross.config}-ar rcu"
|
||||
macosx
|
||||
''}
|
||||
)
|
||||
'' + 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";
|
||||
|
||||
Reference in New Issue
Block a user