diff --git a/pkgs/development/libraries/wxGTK-2.8/default.nix b/pkgs/development/libraries/wxGTK-2.8/default.nix index 3d0d27f36dd8..cc899d7b0034 100644 --- a/pkgs/development/libraries/wxGTK-2.8/default.nix +++ b/pkgs/development/libraries/wxGTK-2.8/default.nix @@ -30,21 +30,6 @@ stdenv.mkDerivation { "--with-opengl" ]; - # Cross build only tested for mingw32 - # Additionally, this should not be called wxGTK anymore, if built for - # mingw32. But before placing this in a better place, it helps as a test for - # mingw32. - crossAttrs = assert stdenv.cross.libc == "msvcrt"; { - src = fetchurl { - url = mirror://sourceforge/wxwindows/wxWidgets-2.8.11.tar.gz; - sha256 = "0icxd21g18d42n1ygshkpw0jnflm03iqki6r623pb5hhd7fm2ksj"; - }; - buildInputs = []; - propagatedBuildInputs = []; - SEARCH_INCLUDE=""; - SEARCH_LIB=""; - }; - # This variable is used by configure to find some dependencies. SEARCH_INCLUDE = "${libXinerama}/include ${libSM}/include ${libXxf86vm}/include"; diff --git a/pkgs/os-specific/windows/wxMSW-2.8/default.nix b/pkgs/os-specific/windows/wxMSW-2.8/default.nix new file mode 100644 index 000000000000..5c79460060ad --- /dev/null +++ b/pkgs/os-specific/windows/wxMSW-2.8/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, compat24 ? false, compat26 ? true, unicode ? true, +}: + +assert stdenv ? cross -> stdenv.cross.libc == "msvcrt"; + +stdenv.mkDerivation { + name = "wxMSW-2.8.11"; + + src = fetchurl { + url = mirror://sourceforge/wxwindows/wxWidgets-2.8.11.tar.gz; + sha256 = "0icxd21g18d42n1ygshkpw0jnflm03iqki6r623pb5hhd7fm2ksj"; + }; + + configureFlags = [ + (if compat24 then "--enable-compat24" else "--disable-compat24") + (if compat26 then "--enable-compat26" else "--disable-compat26") + "--disable-precomp-headers" + (if unicode then "--enable-unicode" else "") + "--with-opengl" + ]; + + # Cross build only tested for mingw32 + checkCross = throw "This package can only be cross-built" false; + crossAttrs = { + checkCross = true; + }; + + preConfigure = " + substituteInPlace configure --replace /usr /no-such-path + "; + + postBuild = "(cd contrib/src && make)"; + + postInstall = " + (cd contrib/src && make install) + (cd $out/include && ln -s wx-*/* .) + "; + + passthru = {inherit compat24 compat26 unicode;}; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23bb6bddb7a0..b7e04747789a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2070,7 +2070,7 @@ let gccCrossStageStatic = let isMingw = (stdenv.cross.libc == "msvcrt"); - libcCross1 = if isMingw then mingw_headers1 else null; + libcCross1 = if isMingw then windows.mingw_headers1 else null; in wrapGCCCross { gcc = forceBuildDrv (lib.addMetaAttrs { platforms = []; } ( @@ -2088,7 +2088,7 @@ let # Only needed for mingw builds gccCrossMingw2 = wrapGCCCross { gcc = gccCrossStageStatic.gcc; - libc = mingw_headers2; + libc = windows.mingw_headers2; binutils = binutilsCross; cross = assert crossSystem != null; crossSystem; }; @@ -3896,7 +3896,7 @@ let # We can choose: libcCrossChooser = name : if (name == "glibc") then glibcCross else if (name == "uclibc") then uclibcCross - else if (name == "msvcrt") then mingw_headers3 + else if (name == "msvcrt") then windows.mingw_headers3 else throw "Unknown libc"; libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc; @@ -6703,39 +6703,45 @@ let inherit ncurses; }; - w32api = makeOverridable (import ../os-specific/windows/w32api) { - inherit fetchurl stdenv; - gccCross = gccCrossStageStatic; - binutilsCross = binutilsCross; - }; + windows = rec { + w32api = makeOverridable (import ../os-specific/windows/w32api) { + inherit fetchurl stdenv; + gccCross = gccCrossStageStatic; + binutilsCross = binutilsCross; + }; - w32api_headers = w32api.override { - onlyHeaders = true; - }; + w32api_headers = w32api.override { + onlyHeaders = true; + }; - mingw_runtime = makeOverridable (import ../os-specific/windows/mingwrt) { - inherit fetchurl stdenv; - gccCross = gccCrossMingw2; - binutilsCross = binutilsCross; - }; + mingw_runtime = makeOverridable (import ../os-specific/windows/mingwrt) { + inherit fetchurl stdenv; + gccCross = gccCrossMingw2; + binutilsCross = binutilsCross; + }; - mingw_runtime_headers = mingw_runtime.override { - onlyHeaders = true; - }; + mingw_runtime_headers = mingw_runtime.override { + onlyHeaders = true; + }; - mingw_headers1 = buildEnv { - name = "mingw-headers-1"; - paths = [ w32api_headers mingw_runtime_headers ]; - }; + mingw_headers1 = buildEnv { + name = "mingw-headers-1"; + paths = [ w32api_headers mingw_runtime_headers ]; + }; - mingw_headers2 = buildEnv { - name = "mingw-headers-2"; - paths = [ w32api mingw_runtime_headers ]; - }; + mingw_headers2 = buildEnv { + name = "mingw-headers-2"; + paths = [ w32api mingw_runtime_headers ]; + }; - mingw_headers3 = buildEnv { - name = "mingw-headers-3"; - paths = [ w32api mingw_runtime ]; + mingw_headers3 = buildEnv { + name = "mingw-headers-3"; + paths = [ w32api mingw_runtime ]; + }; + + wxMSW = makeOverridable (import ../os-specific/windows/wxMSW-2.8) { + inherit fetchurl stdenv; + }; }; wesnoth = import ../games/wesnoth {