Making wxGTK stay wxGTK even cross-built, so I remove the wxMSW code I added to test the crossbuilding with wxGTK. I added a new windows-specific package: wxMSW.

svn path=/nixpkgs/trunk/; revision=21634

+76 -45
-15
pkgs/development/libraries/wxGTK-2.8/default.nix
··· 30 30 "--with-opengl" 31 31 ]; 32 32 33 - # Cross build only tested for mingw32 34 - # Additionally, this should not be called wxGTK anymore, if built for 35 - # mingw32. But before placing this in a better place, it helps as a test for 36 - # mingw32. 37 - crossAttrs = assert stdenv.cross.libc == "msvcrt"; { 38 - src = fetchurl { 39 - url = mirror://sourceforge/wxwindows/wxWidgets-2.8.11.tar.gz; 40 - sha256 = "0icxd21g18d42n1ygshkpw0jnflm03iqki6r623pb5hhd7fm2ksj"; 41 - }; 42 - buildInputs = []; 43 - propagatedBuildInputs = []; 44 - SEARCH_INCLUDE=""; 45 - SEARCH_LIB=""; 46 - }; 47 - 48 33 # This variable is used by configure to find some dependencies. 49 34 SEARCH_INCLUDE = 50 35 "${libXinerama}/include ${libSM}/include ${libXxf86vm}/include";
+40
pkgs/os-specific/windows/wxMSW-2.8/default.nix
··· 1 + { stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true, 2 + }: 3 + 4 + assert stdenv ? cross -> stdenv.cross.libc == "msvcrt"; 5 + 6 + stdenv.mkDerivation { 7 + name = "wxMSW-2.8.11"; 8 + 9 + src = fetchurl { 10 + url = mirror://sourceforge/wxwindows/wxWidgets-2.8.11.tar.gz; 11 + sha256 = "0icxd21g18d42n1ygshkpw0jnflm03iqki6r623pb5hhd7fm2ksj"; 12 + }; 13 + 14 + configureFlags = [ 15 + (if compat24 then "--enable-compat24" else "--disable-compat24") 16 + (if compat26 then "--enable-compat26" else "--disable-compat26") 17 + "--disable-precomp-headers" 18 + (if unicode then "--enable-unicode" else "") 19 + "--with-opengl" 20 + ]; 21 + 22 + # Cross build only tested for mingw32 23 + checkCross = throw "This package can only be cross-built" false; 24 + crossAttrs = { 25 + checkCross = true; 26 + }; 27 + 28 + preConfigure = " 29 + substituteInPlace configure --replace /usr /no-such-path 30 + "; 31 + 32 + postBuild = "(cd contrib/src && make)"; 33 + 34 + postInstall = " 35 + (cd contrib/src && make install) 36 + (cd $out/include && ln -s wx-*/* .) 37 + "; 38 + 39 + passthru = {inherit compat24 compat26 unicode;}; 40 + }
+36 -30
pkgs/top-level/all-packages.nix
··· 2070 2070 2071 2071 gccCrossStageStatic = let 2072 2072 isMingw = (stdenv.cross.libc == "msvcrt"); 2073 - libcCross1 = if isMingw then mingw_headers1 else null; 2073 + libcCross1 = if isMingw then windows.mingw_headers1 else null; 2074 2074 in 2075 2075 wrapGCCCross { 2076 2076 gcc = forceBuildDrv (lib.addMetaAttrs { platforms = []; } ( ··· 2088 2088 # Only needed for mingw builds 2089 2089 gccCrossMingw2 = wrapGCCCross { 2090 2090 gcc = gccCrossStageStatic.gcc; 2091 - libc = mingw_headers2; 2091 + libc = windows.mingw_headers2; 2092 2092 binutils = binutilsCross; 2093 2093 cross = assert crossSystem != null; crossSystem; 2094 2094 }; ··· 3896 3896 # We can choose: 3897 3897 libcCrossChooser = name : if (name == "glibc") then glibcCross 3898 3898 else if (name == "uclibc") then uclibcCross 3899 - else if (name == "msvcrt") then mingw_headers3 3899 + else if (name == "msvcrt") then windows.mingw_headers3 3900 3900 else throw "Unknown libc"; 3901 3901 3902 3902 libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc; ··· 6703 6703 inherit ncurses; 6704 6704 }; 6705 6705 6706 - w32api = makeOverridable (import ../os-specific/windows/w32api) { 6707 - inherit fetchurl stdenv; 6708 - gccCross = gccCrossStageStatic; 6709 - binutilsCross = binutilsCross; 6710 - }; 6706 + windows = rec { 6707 + w32api = makeOverridable (import ../os-specific/windows/w32api) { 6708 + inherit fetchurl stdenv; 6709 + gccCross = gccCrossStageStatic; 6710 + binutilsCross = binutilsCross; 6711 + }; 6711 6712 6712 - w32api_headers = w32api.override { 6713 - onlyHeaders = true; 6714 - }; 6713 + w32api_headers = w32api.override { 6714 + onlyHeaders = true; 6715 + }; 6715 6716 6716 - mingw_runtime = makeOverridable (import ../os-specific/windows/mingwrt) { 6717 - inherit fetchurl stdenv; 6718 - gccCross = gccCrossMingw2; 6719 - binutilsCross = binutilsCross; 6720 - }; 6717 + mingw_runtime = makeOverridable (import ../os-specific/windows/mingwrt) { 6718 + inherit fetchurl stdenv; 6719 + gccCross = gccCrossMingw2; 6720 + binutilsCross = binutilsCross; 6721 + }; 6721 6722 6722 - mingw_runtime_headers = mingw_runtime.override { 6723 - onlyHeaders = true; 6724 - }; 6723 + mingw_runtime_headers = mingw_runtime.override { 6724 + onlyHeaders = true; 6725 + }; 6725 6726 6726 - mingw_headers1 = buildEnv { 6727 - name = "mingw-headers-1"; 6728 - paths = [ w32api_headers mingw_runtime_headers ]; 6729 - }; 6727 + mingw_headers1 = buildEnv { 6728 + name = "mingw-headers-1"; 6729 + paths = [ w32api_headers mingw_runtime_headers ]; 6730 + }; 6730 6731 6731 - mingw_headers2 = buildEnv { 6732 - name = "mingw-headers-2"; 6733 - paths = [ w32api mingw_runtime_headers ]; 6734 - }; 6732 + mingw_headers2 = buildEnv { 6733 + name = "mingw-headers-2"; 6734 + paths = [ w32api mingw_runtime_headers ]; 6735 + }; 6735 6736 6736 - mingw_headers3 = buildEnv { 6737 - name = "mingw-headers-3"; 6738 - paths = [ w32api mingw_runtime ]; 6737 + mingw_headers3 = buildEnv { 6738 + name = "mingw-headers-3"; 6739 + paths = [ w32api mingw_runtime ]; 6740 + }; 6741 + 6742 + wxMSW = makeOverridable (import ../os-specific/windows/wxMSW-2.8) { 6743 + inherit fetchurl stdenv; 6744 + }; 6739 6745 }; 6740 6746 6741 6747 wesnoth = import ../games/wesnoth {