From 3c40ba828fba15ee08e6a2f34ed928c552077aa4 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Wed, 23 Apr 2025 11:37:05 +0200 Subject: [PATCH] wine: fix stable / yabridge builds with binutils 2.44 This patch is included in wine 10.2 onwards, so unstable / staging don't need it. --- pkgs/applications/emulators/wine/sources.nix | 31 ++++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix index d5e34fc625a5..38bbca910c7a 100644 --- a/pkgs/applications/emulators/wine/sources.nix +++ b/pkgs/applications/emulators/wine/sources.nix @@ -65,6 +65,23 @@ let source ${./update-lib.sh} ''; + # Needed for wine versions < 10.2 to fix compatibility with binutils 2.44 + # https://github.com/NixOS/nixpkgs/issues/399714 + # https://bugs.winehq.org/show_bug.cgi?id=57819 + # https://gitlab.winehq.org/wine/wine/-/merge_requests/7328 + patches-binutils-2_44-fix-wine-older-than-10_2 = [ + (pkgs.fetchpatch { + name = "ntdll-use-signed-type"; + url = "https://gitlab.winehq.org/wine/wine/-/commit/fd59962827a715d321f91c9bdb43f3e61f9ebbc.patch"; + hash = "sha256-PvFom9NJ32XZO1gYor9Cuk8+eaRFvmG572OAtNx1tks="; + }) + (pkgs.fetchpatch { + name = "winebuild-avoid using-idata-section"; + url = "https://gitlab.winehq.org/wine/wine/-/commit/c9519f68ea04915a60704534ab3afec5ec1b8fd7.patch"; + hash = "sha256-vA58SfAgCXoCT+NB4SRHi85AnI4kj9S2deHGp4L36vI="; + }) + ]; + inherit (pkgs) writeShellScript; in rec { @@ -96,7 +113,7 @@ rec { patches = [ # Also look for root certificates at $NIX_SSL_CERT_FILE ./cert-path.patch - ]; + ] ++ patches-binutils-2_44-fix-wine-older-than-10_2; updateScript = writeShellScript "update-wine-stable" ('' ${updateScriptPreamble} @@ -118,7 +135,11 @@ rec { version = "10.5"; url = "https://dl.winehq.org/wine/source/10.x/wine-${version}.tar.xz"; hash = "sha256-wDbsHvR2dHdKX5lFgwIuni62j+j8GLOox55oWzvsibw="; - inherit (stable) patches; + + patches = [ + # Also look for root certificates at $NIX_SSL_CERT_FILE + ./cert-path.patch + ]; # see https://gitlab.winehq.org/wine/wine-staging staging = fetchFromGitLab { @@ -177,7 +198,11 @@ rec { version = "9.21"; url = "https://dl.winehq.org/wine/source/9.x/wine-${version}.tar.xz"; hash = "sha256-REK0f/2bLqRXEA427V/U5vTYKdnbeaJeYFF1qYjKL/8="; - inherit (stable) patches; + + patches = [ + # Also look for root certificates at $NIX_SSL_CERT_FILE + ./cert-path.patch + ] ++ patches-binutils-2_44-fix-wine-older-than-10_2; # see https://gitlab.winehq.org/wine/wine-staging staging = fetchFromGitLab {