From 52b8951f6c669701b9759bc8344ebb6651a2834c Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 7 Apr 2025 18:53:07 -0400 Subject: [PATCH] winePackages: add pinned wine variant for yabridge --- pkgs/applications/emulators/wine/base.nix | 2 +- pkgs/applications/emulators/wine/default.nix | 12 +++- pkgs/applications/emulators/wine/sources.nix | 61 ++++++++++++++++---- pkgs/applications/emulators/wine/staging.nix | 4 +- pkgs/top-level/all-packages.nix | 5 +- pkgs/top-level/wine-packages.nix | 7 +++ 6 files changed, 73 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index 80c5cf781b97..230ecc058159 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -286,8 +286,8 @@ stdenv.mkDerivation ( passthru = { inherit pkgArches; - inherit (src) updateScript; tests = { inherit (nixosTests) wine; }; + updateScript = src.updateScript or null; }; meta = { inherit version; diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix index c39e373587ca..605f327a5f6b 100644 --- a/pkgs/applications/emulators/wine/default.nix +++ b/pkgs/applications/emulators/wine/default.nix @@ -90,10 +90,18 @@ let } ); + baseRelease = + { + staging = "unstable"; + yabridge = "yabridge"; + } + .${wineRelease} or null; in -if wineRelease == "staging" then +if baseRelease != null then callPackage ./staging.nix { - wineUnstable = wine-build wineBuild "unstable"; + wineUnstable = (wine-build wineBuild baseRelease).override { + inherit wineRelease; + }; } else wine-build wineBuild wineRelease diff --git a/pkgs/applications/emulators/wine/sources.nix b/pkgs/applications/emulators/wine/sources.nix index 31a67dd3c413..d5e34fc625a5 100644 --- a/pkgs/applications/emulators/wine/sources.nix +++ b/pkgs/applications/emulators/wine/sources.nix @@ -120,6 +120,18 @@ rec { hash = "sha256-wDbsHvR2dHdKX5lFgwIuni62j+j8GLOox55oWzvsibw="; inherit (stable) patches; + # see https://gitlab.winehq.org/wine/wine-staging + staging = fetchFromGitLab { + inherit version; + hash = "sha256-rXA/55rwQSJR247E4H7cQdTtXRmjomRbls7THV3jfcE="; + domain = "gitlab.winehq.org"; + owner = "wine"; + repo = "wine-staging"; + rev = "v${version}"; + + disabledPatchsets = [ ]; + }; + ## see http://wiki.winehq.org/Gecko gecko32 = fetchurl rec { version = "2.47.4"; @@ -147,8 +159,8 @@ rec { latest_mono=$(get_latest_lib_version wine-mono) update_staging() { - staging_url=$(get_source_attr staging.url) - set_source_attr staging hash "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\"" + staging_url=$(get_source_attr unstable.staging.url) + set_source_attr unstable.staging hash "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\"" } autobump unstable "$latest_unstable" "" update_staging @@ -160,16 +172,43 @@ rec { ''; }; - staging = fetchFromGitLab rec { - # https://gitlab.winehq.org/wine/wine-staging - inherit (unstable) version; - hash = "sha256-rXA/55rwQSJR247E4H7cQdTtXRmjomRbls7THV3jfcE="; - domain = "gitlab.winehq.org"; - owner = "wine"; - repo = "wine-staging"; - rev = "v${version}"; + yabridge = fetchurl rec { + # NOTE: This is a pinned version with staging patches; don't forget to update them as well + 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; - disabledPatchsets = [ ]; + # see https://gitlab.winehq.org/wine/wine-staging + staging = fetchFromGitLab { + inherit version; + hash = "sha256-FDNszRUvM1ewE9Ij4EkuihaX0Hf0eTb5r7KQHMdCX3U="; + domain = "gitlab.winehq.org"; + owner = "wine"; + repo = "wine-staging"; + rev = "v${version}"; + + disabledPatchsets = [ ]; + }; + + ## see http://wiki.winehq.org/Gecko + gecko32 = fetchurl rec { + version = "2.47.4"; + url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86.msi"; + hash = "sha256-Js7MR3BrCRkI9/gUvdsHTGG+uAYzGOnvxaf3iYV3k9Y="; + }; + gecko64 = fetchurl rec { + version = "2.47.4"; + url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86_64.msi"; + hash = "sha256-5ZC32YijLWqkzx2Ko6o9M3Zv3Uz0yJwtzCCV7LKNBm8="; + }; + + ## see http://wiki.winehq.org/Mono + mono = fetchurl rec { + version = "9.3.0"; + url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi"; + hash = "sha256-bKLArtCW/57CD69et2xrfX3oLZqIdax92fB5O/nD/TA="; + }; }; wayland = pkgs.lib.warnOnInstantiate "building wine with `wineRelease = \"wayland\"` is deprecated. Wine now builds with the wayland driver by default." stable; # added 2025-01-23 diff --git a/pkgs/applications/emulators/wine/staging.nix b/pkgs/applications/emulators/wine/staging.nix index ed3fe3125067..981d8f9e54f6 100644 --- a/pkgs/applications/emulators/wine/staging.nix +++ b/pkgs/applications/emulators/wine/staging.nix @@ -13,12 +13,12 @@ with callPackage ./util.nix { }; let - patch = (callPackage ./sources.nix { }).staging; + patch = wineUnstable.src.staging; build-inputs = pkgNames: extra: (mkBuildInputs wineUnstable.pkgArches pkgNames) ++ extra; in assert lib.versions.majorMinor wineUnstable.version == lib.versions.majorMinor patch.version; -(wineUnstable.override { wineRelease = "staging"; }).overrideAttrs (self: { +wineUnstable.overrideAttrs (self: { buildInputs = build-inputs ( [ "perl" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9aba2ffb0292..aa2ec3d8a8f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1248,11 +1248,11 @@ with pkgs; }; yabridge = callPackage ../tools/audio/yabridge { - wine = wineWowPackages.staging; + wine = wineWowPackages.yabridge; }; yabridgectl = callPackage ../tools/audio/yabridgectl { - wine = wineWowPackages.staging; + wine = wineWowPackages.yabridge; }; yafetch = callPackage ../tools/misc/yafetch { @@ -19287,6 +19287,7 @@ with pkgs; stagingFull wayland waylandFull + yabridge fonts ; } diff --git a/pkgs/top-level/wine-packages.nix b/pkgs/top-level/wine-packages.nix index 064c190af214..2656241d4acd 100644 --- a/pkgs/top-level/wine-packages.nix +++ b/pkgs/top-level/wine-packages.nix @@ -1,4 +1,5 @@ { + lib, stdenv, config, callPackage, @@ -63,4 +64,10 @@ rec { waylandFull = full.override { x11Support = false; }; + + yabridge = + let + yabridge = base.override { wineRelease = "yabridge"; }; + in + if wineBuild == "wineWow" then yabridge else lib.dontDistribute yabridge; }