From fd2703130c48a494f85805ed91dc45bfcd73aea2 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 16 Nov 2023 08:22:48 -0500 Subject: [PATCH 1/3] wine64Packages: 8.17 -> 8.20 https://www.winehq.org/announce/8.18 https://www.winehq.org/announce/8.19 https://www.winehq.org/announce/8.20 --- pkgs/applications/emulators/wine/base.nix | 1 + .../wine/darwin-metal-compat-pre8.18.patch | 12 ++++++++++++ .../emulators/wine/darwin-metal-compat.patch | 13 +++++++------ pkgs/applications/emulators/wine/sources.nix | 18 +++++++++--------- 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index 2e84a8f2091c..cb385018de4b 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -109,6 +109,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # uses property syntax in one place. The first patch is necessary only with older # versions of Wine. The second is needed on all versions of Wine. (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch) + (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.19.patch) ./darwin-metal-compat.patch # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs. ./darwin-qos.patch diff --git a/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch b/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch new file mode 100644 index 000000000000..181b2a0d1a47 --- /dev/null +++ b/pkgs/applications/emulators/wine/darwin-metal-compat-pre8.18.patch @@ -0,0 +1,12 @@ +diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m +--- a/dlls/winemac.drv/cocoa_display.m ++++ b/dlls/winemac.drv/cocoa_display.m +@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp + + device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease]; + if (device && [device respondsToSelector:@selector(registryID)]) +- ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID); ++ ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]); + + done: + [pool release]; diff --git a/pkgs/applications/emulators/wine/darwin-metal-compat.patch b/pkgs/applications/emulators/wine/darwin-metal-compat.patch index 181b2a0d1a47..8176be8ef383 100644 --- a/pkgs/applications/emulators/wine/darwin-metal-compat.patch +++ b/pkgs/applications/emulators/wine/darwin-metal-compat.patch @@ -1,12 +1,13 @@ diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m +index fbbe16efcbf..2db375ff3d5 100644 --- a/dlls/winemac.drv/cocoa_display.m +++ b/dlls/winemac.drv/cocoa_display.m -@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp +@@ -387,7 +387,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease]; if (device && [device respondsToSelector:@selector(registryID)]) -- ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID); -+ ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]); - - done: - [pool release]; +- return macdrv_get_gpu_info_from_registry_id(gpu, device.registryID); ++ return macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]); + else + return -1; + } diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix index 813d032bf964..1bd1d6a8214d 100644 --- a/pkgs/applications/emulators/wine/sources.nix +++ b/pkgs/applications/emulators/wine/sources.nix @@ -69,9 +69,9 @@ in rec { unstable = fetchurl rec { # NOTE: Don't forget to change the hash for staging as well. - version = "8.17"; + version = "8.20"; url = "https://dl.winehq.org/wine/source/8.x/wine-${version}.tar.xz"; - hash = "sha256-8BeFvTFix05l3rE6oK3XEeN8SERUcZvt0OjCsaNGm34="; + hash = "sha256-SNa3a9ZDBaICBX+8GdkiwfSWJfbRqYJZJ8ChhXJzmYI="; inherit (stable) patches; ## see http://wiki.winehq.org/Gecko @@ -88,9 +88,9 @@ in rec { ## see http://wiki.winehq.org/Mono mono = fetchurl rec { - version = "8.0.0"; + version = "8.1.0"; url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi"; - hash = "sha256-dbP0XcodyJhX/p6TLaeHEPZMxtSe8asMcjoXcIW0cRs="; + hash = "sha256-DtPsUzrvebLzEhVZMc97EIAAmsDFtMK8/rZ4rJSOCBA="; }; updateScript = writeShellScript "update-wine-unstable" '' @@ -116,8 +116,8 @@ in rec { staging = fetchFromGitHub rec { # https://github.com/wine-staging/wine-staging/releases - version = "8.17.1"; - hash = "sha256-h36NDFYsI0y8TG41IH10IdF4QEuBkBewQ3knZ9iwDpg="; + version = "8.20"; + hash = "sha256-CiWTXjUR1+GY+MO7djHfVUH71zSo3lpH9IaqS5zCeJ8="; owner = "wine-staging"; repo = "wine-staging"; rev = "v${version}"; @@ -127,12 +127,12 @@ in rec { wayland = fetchFromGitLab { # https://gitlab.collabora.com/alf/wine/-/tree/wayland - version = "8.0"; - hash = "sha256-whRnm21UyKZ4AQufNmctzivISVobnCeidmpYz65vlyk="; + version = "8.2"; + hash = "sha256-Eb2SFBIeQQ3cVZkUQcwNT5mcYe0ShFxBdMc3BlqkwTo="; domain = "gitlab.collabora.com"; owner = "alf"; repo = "wine"; - rev = "2f80bd757739f2dd8da41abceae6b87d2c568152"; + rev = "b2547ddf9e08cafce98cf7734d5c4ec926ef3536"; inherit (unstable) gecko32 gecko64; From fc2852466d8c28b4757cf51789cfd19353880d2e Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 16 Nov 2023 17:02:42 -0500 Subject: [PATCH 2/3] wineWow64Packages: fix build on Darwin --- pkgs/applications/emulators/wine/base.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index cb385018de4b..bb44f186cff5 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -37,8 +37,11 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # The Wine preloader must _not_ be linked to any system libraries, but `NIX_LDFLAGS` will link # to libintl, libiconv, and CoreFoundation no matter what. Delete the one that was built and # rebuild it with empty NIX_LDFLAGS. - rm loader/wine64-preloader - make loader/wine64-preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" + for preloader in wine-preloader wine64-preloader; do + rm loader/$preloader &> /dev/null \ + && ( echo "Relinking loader/$preloader"; make loader/$preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" ) \ + || echo "loader/$preloader not built, skipping relink." + done ''; }) // rec { inherit version src; @@ -109,8 +112,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # uses property syntax in one place. The first patch is necessary only with older # versions of Wine. The second is needed on all versions of Wine. (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch) - (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.19.patch) - ./darwin-metal-compat.patch + (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.18.patch) + (lib.optional (lib.versionAtLeast version "8.18") ./darwin-metal-compat.patch) # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs. ./darwin-qos.patch ] From bf7ad8cfbfa102a90463433e2c5027573b462479 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 18 Nov 2023 10:38:32 -0500 Subject: [PATCH 3/3] wine64Packages.minimal: mark broken on Darwin Darwin requires MinGW to build Wine because clang does not support `-mabi=ms`, which is required when building without MinGW . --- pkgs/applications/emulators/wine/base.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index bb44f186cff5..68814ca5ba58 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -207,6 +207,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { fromSource binaryNativeCode # mono, gecko ]; + broken = stdenv.isDarwin && !supportFlags.mingwSupport; description = if supportFlags.waylandSupport then "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)" else "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix"; platforms = if supportFlags.waylandSupport then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms; maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira reckenrode ];