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:
aszlig
2014-03-12 10:16:51 +01:00
33 changed files with 487 additions and 119 deletions

View File

@@ -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";