From 4f69722ee55cd1a685da069e6683f1af9eae645b Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 24 Feb 2014 06:46:07 +0100 Subject: lua52/cross: Allow to cross-compile to mingw-w64. Signed-off-by: aszlig --- pkgs/development/interpreters/lua-5/5.2.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'pkgs/development/interpreters/lua-5') diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix index 70ab0c3bdf8b..609c6b3e404a 100644 --- a/pkgs/development/interpreters/lua-5/5.2.nix +++ b/pkgs/development/interpreters/lua-5/5.2.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { sha256 = "004zyh9p3lpvbwhyhlmrw6wwcia5abx84q4h2brkn4zdypipvmiz"; }; - buildInputs = [ readline ]; + nativeBuildInputs = [ readline ]; patches = [ dsoPatch ]; @@ -49,6 +49,29 @@ stdenv.mkDerivation rec { EOF ''; + crossAttrs = let + isMingwW64 = stdenv.cross.config == "x86_64-w64-mingw32"; + 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} + ${stdenv.lib.optionals isMingwW64 "mingw"} + ) + '' + stdenv.lib.optionalString isMingwW64 '' + installFlagsArray=( + TO_BIN="lua.exe luac.exe" + TO_LIB="liblua.a lua52.dll" + INSTALL_DATA="cp -d" + ) + ''; + }; + meta = { homepage = "http://www.lua.org"; description = "Powerful, fast, lightweight, embeddable scripting language"; -- cgit 1.4.1 From e64b342fa8fda783a7247e0469943ce728498004 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 3 Mar 2014 22:31:18 +0100 Subject: Use mingw-w64 for 32bit Windows builds as well. Mingw(32) is rather poorly maintaned and has quite a lot of bugs. And because our Windows cross builds were also poorly maintained and most of the cross-tests were broken as well, I'm just taking this step and try to switch to mingw-w64 for everything "cross Windows". Signed-off-by: aszlig --- pkgs/development/compilers/gcc/4.6/default.nix | 6 ++---- pkgs/development/compilers/gcc/4.8/default.nix | 6 ++---- pkgs/development/interpreters/lua-5/5.2.nix | 6 +++--- pkgs/development/libraries/SDL/default.nix | 2 +- pkgs/development/libraries/glew/default.nix | 2 +- pkgs/development/libraries/pcre/default.nix | 2 +- pkgs/development/libraries/qt-4.x/4.8/default.nix | 3 +-- pkgs/os-specific/windows/mingw-w64/default.nix | 2 +- pkgs/top-level/all-packages.nix | 8 ++------ pkgs/top-level/release-cross.nix | 11 +++++------ 10 files changed, 19 insertions(+), 29 deletions(-) (limited to 'pkgs/development/interpreters/lua-5') diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index 3ed0f7ad0e6d..af1113226980 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -159,10 +159,8 @@ let version = "4.6.3"; # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. " --disable-shared" + - (if cross.config == "x86_64-w64-mingw32" then - # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else "") + # To keep ABI compatibility with upstream mingw-w64 + " --enable-fully-dynamic-string" else (if cross.libc == "uclibc" then # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index aea525933234..e2c887c368f5 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -175,10 +175,8 @@ let version = "4.8.2"; # In any case, mingw32 g++ linking is broken by default with shared libs, # unless adding "-lsupc++" to any linking command. I don't know why. " --disable-shared" + - (if cross.config == "x86_64-w64-mingw32" then - # To keep ABI compatibility with upstream mingw-w64 - " --enable-fully-dynamic-string" - else "") + # To keep ABI compatibility with upstream mingw-w64 + " --enable-fully-dynamic-string" else (if cross.libc == "uclibc" then # In uclibc cases, libgomp needs an additional '-ldl' # and as I don't know how to pass it, I disable libgomp. diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix index 609c6b3e404a..b8fcbe5f242a 100644 --- a/pkgs/development/interpreters/lua-5/5.2.nix +++ b/pkgs/development/interpreters/lua-5/5.2.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { ''; crossAttrs = let - isMingwW64 = stdenv.cross.config == "x86_64-w64-mingw32"; + isMingw = stdenv.cross.libc == "msvcrt"; in { configurePhase = '' makeFlagsArray=( @@ -61,9 +61,9 @@ stdenv.mkDerivation rec { RANLIB=${stdenv.cross.config}-ranlib V=${majorVersion} R=${version} - ${stdenv.lib.optionals isMingwW64 "mingw"} + ${stdenv.lib.optionals isMingw "mingw"} ) - '' + stdenv.lib.optionalString isMingwW64 '' + '' + stdenv.lib.optionalString isMingw '' installFlagsArray=( TO_BIN="lua.exe luac.exe" TO_LIB="liblua.a lua52.dll" diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix index 0df130b11fb1..56ac04bebe62 100644 --- a/pkgs/development/libraries/SDL/default.nix +++ b/pkgs/development/libraries/SDL/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { crossAttrs = { configureFlags = configureFlagsFun { - alsaSupport = stdenv.cross.config != "x86_64-w64-mingw32"; + alsaSupport = stdenv.cross.libc != "msvcrt"; alsaLib = alsaLib.crossDrv; } + "--disable-directx"; }; diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix index b79fa97047b9..32083f96dfd1 100644 --- a/pkgs/development/libraries/glew/default.nix +++ b/pkgs/development/libraries/glew/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { "CC=${stdenv.cross.config}-gcc" "LD=${stdenv.cross.config}-gcc" "STRIP=" - ] ++ optional (stdenv.cross.config == "x86_64-w64-mingw32") "SYSTEM=mingw"; + ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw"; meta = { description = "An OpenGL extension loading library for C(++)"; diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index 067c3af43871..7138c44da643 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { # XXX: test failure on Cygwin # we are running out of stack on both freeBSDs on Hydra - crossAttrs = optionalAttrs (stdenv.cross.config == "x86_64-w64-mingw32") { + crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") { buildInputs = [ windows.mingw_w64_pthreads.crossDrv ]; }; diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index 16bd1ee65d2e..1bd027f52986 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -148,8 +148,7 @@ stdenv.mkDerivation rec { ''; crossAttrs = let - isMingw = stdenv.cross.config == "i686-pc-mingw32" || - stdenv.cross.config == "x86_64-w64-mingw32"; + isMingw = stdenv.cross.libc == "msvcrt"; in { # I've not tried any case other than i686-pc-mingw32. # -nomake tools: it fails linking some asian language symbols diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix index c5b6017aae4d..bf15b208e1a7 100644 --- a/pkgs/os-specific/windows/mingw-w64/default.nix +++ b/pkgs/os-specific/windows/mingw-w64/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation (rec { preConfigure = '' cd mingw-w64-headers ''; - configureFlags = "--without-crt --host=x86_64-w64-mingw32"; + configureFlags = "--without-crt"; } else if onlyPthreads then { name = name + "-pthreads"; preConfigure = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 133ef21060c7..952fe59734de 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2419,9 +2419,7 @@ let gccCrossStageStatic = let isMingw = (stdenv.cross.libc == "msvcrt"); - isMingw64 = isMingw && stdenv.cross.config == "x86_64-w64-mingw32"; - libcCross1 = if isMingw64 then windows.mingw_w64_headers else - if isMingw then windows.mingw_headers1 else null; + libcCross1 = if isMingw then windows.mingw_w64_headers else null; in wrapGCCCross { gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } ( @@ -4235,9 +4233,7 @@ let # We can choose: libcCrossChooser = name : if name == "glibc" then glibcCross else if name == "uclibc" then uclibcCross - else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then - windows.mingw_w64 - else if name == "msvcrt" then windows.mingw_headers3 + else if name == "msvcrt" then windows.mingw_w64 else throw "Unknown libc"; libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc; diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 6871567ca8d1..cef3d2dffbdb 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -140,11 +140,11 @@ in { crossUltraSparcLinux = mapTestOnCross crossSystem basic; }) // ( -/* Test some cross builds on mingw32 */ +/* Test some cross builds on 32 bit mingw-w64 */ let crossSystem = { - config = "i686-pc-mingw32"; - arch = "x86"; + config = "i686-w64-mingw32"; + arch = "x86"; # Irrelevant libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain platform = {}; }; @@ -161,11 +161,10 @@ in { }; }) // ( -/* Test some cross builds on mingw-w64 */ +/* Test some cross builds on 64 bit mingw-w64 */ let crossSystem = { - # That's the triplet they use in the mingw-w64 docs, - # and it's relevant for nixpkgs conditions. + # That's the triplet they use in the mingw-w64 docs. config = "x86_64-w64-mingw32"; arch = "x86_64"; # Irrelevant libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain -- cgit 1.4.1 From 745c4779305490816682bb95b319923d27c4a8fe Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 10 Mar 2014 22:17:04 +0100 Subject: lua5.2/cross: Fix build for Darwin. The ld from cctools doesn't like the -soname argument, so let's strip it off for now until we have a binutils <-> cctools bridge. Signed-off-by: aszlig --- pkgs/development/interpreters/lua-5/5.2.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'pkgs/development/interpreters/lua-5') diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix index 70ab0c3bdf8b..c496d14083e7 100644 --- a/pkgs/development/interpreters/lua-5/5.2.nix +++ b/pkgs/development/interpreters/lua-5/5.2.nix @@ -49,6 +49,30 @@ stdenv.mkDerivation rec { EOF ''; + crossAttrs = let + 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} + ${stdenv.lib.optionalString isDarwin '' + AR="${stdenv.cross.config}-ar rcu" + macosx + ''} + ) + ''; + } // 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"; -- cgit 1.4.1