wine: add MinGW-w64 support

This commit is contained in:
Kira Bruneau 2020-11-09 18:33:43 -05:00
parent 31051812bc
commit 9f5cba0aaa
3 changed files with 15 additions and 5 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, lib, pkgArches, callPackage,
name, version, src, monos, geckos, platforms,
name, version, src, mingwGccs, monos, geckos, platforms,
pkgconfig, fontforge, makeWrapper, flex, bison,
supportFlags,
buildScript ? null, configureFlags ? []
@ -15,9 +15,13 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
}) // rec {
inherit name src configureFlags;
# Fixes "Compiler cannot create executables" building wineWow with mingwSupport
strictDeps = true;
nativeBuildInputs = [
pkgconfig fontforge makeWrapper flex bison
];
]
++ lib.optionals supportFlags.mingwSupport mingwGccs;
buildInputs = toBuildInputs pkgArches (with supportFlags; (pkgs:
[ pkgs.freetype ]
@ -92,6 +96,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
# drive_c/windows/system32 will only contain a few files instead of
# hundreds, there will be an error about winemenubuilder and MountMgr
# on startup of Wine, and the Drives tab in winecfg will show an error.
# TODO: binutils 2.34 contains a fix for this bug, re-enable stripping once available.
dontStrip = true;
## FIXME
@ -136,7 +141,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
# https://bugs.winehq.org/show_bug.cgi?id=43530
# https://github.com/NixOS/nixpkgs/issues/31989
hardeningDisable = [ "bindnow" ]
++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify";
++ lib.optional (stdenv.hostPlatform.isDarwin) "fortify"
++ lib.optional (supportFlags.mingwSupport) "format";
passthru = { inherit pkgArches; };
meta = {

View file

@ -44,6 +44,7 @@
sdlSupport ? false,
faudioSupport ? false,
vkd3dSupport ? false,
mingwSupport ? false,
}:
let wine-build = build: release:
@ -56,7 +57,7 @@ let wine-build = build: release:
gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport
pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport
openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport faudioSupport
vkd3dSupport;
vkd3dSupport mingwSupport;
};
});

View file

@ -1,4 +1,4 @@
{ stdenv_32bit, lib, pkgs, pkgsi686Linux, callPackage,
{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage,
wineRelease ? "stable",
supportFlags
}:
@ -10,6 +10,7 @@ in with src; {
inherit src version supportFlags;
pkgArches = [ pkgsi686Linux ];
geckos = [ gecko32 ];
mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc ];
monos = [ mono ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
@ -17,6 +18,7 @@ in with src; {
name = "wine64-${version}";
inherit src version supportFlags;
pkgArches = [ pkgs ];
mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ];
geckos = [ gecko64 ];
monos = [ mono ];
configureFlags = [ "--enable-win64" ];
@ -28,6 +30,7 @@ in with src; {
stdenv = stdenv_32bit;
pkgArches = [ pkgs pkgsi686Linux ];
geckos = [ gecko32 gecko64 ];
mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc mingwW64.buildPackages.gcc ];
monos = [ mono ];
buildScript = ./builder-wow.sh;
platforms = [ "x86_64-linux" ];