Skip to content

Commit 893c611

Browse files
authored
winePackages: add pinned wine variant for yabridge (#396982)
2 parents 05621a9 + 12cafc6 commit 893c611

File tree

6 files changed

+75
-19
lines changed

6 files changed

+75
-19
lines changed

pkgs/applications/emulators/wine/base.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ stdenv.mkDerivation (
286286

287287
passthru = {
288288
inherit pkgArches;
289-
inherit (src) updateScript;
290289
tests = { inherit (nixosTests) wine; };
290+
updateScript = src.updateScript or null;
291291
};
292292
meta = {
293293
inherit version;
@@ -301,9 +301,10 @@ stdenv.mkDerivation (
301301
inherit badPlatforms platforms;
302302
maintainers = with lib.maintainers; [
303303
avnik
304-
raskin
305304
bendlas
306305
jmc-figueira
306+
kira-bruneau
307+
raskin
307308
reckenrode
308309
];
309310
inherit mainProgram;

pkgs/applications/emulators/wine/default.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,18 @@ let
9090
}
9191
);
9292

93+
baseRelease =
94+
{
95+
staging = "unstable";
96+
yabridge = "yabridge";
97+
}
98+
.${wineRelease} or null;
9399
in
94-
if wineRelease == "staging" then
100+
if baseRelease != null then
95101
callPackage ./staging.nix {
96-
wineUnstable = wine-build wineBuild "unstable";
102+
wineUnstable = (wine-build wineBuild baseRelease).override {
103+
inherit wineRelease;
104+
};
97105
}
98106
else
99107
wine-build wineBuild wineRelease

pkgs/applications/emulators/wine/sources.nix

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ rec {
120120
hash = "sha256-wDbsHvR2dHdKX5lFgwIuni62j+j8GLOox55oWzvsibw=";
121121
inherit (stable) patches;
122122

123+
# see https://gitlab.winehq.org/wine/wine-staging
124+
staging = fetchFromGitLab {
125+
inherit version;
126+
hash = "sha256-rXA/55rwQSJR247E4H7cQdTtXRmjomRbls7THV3jfcE=";
127+
domain = "gitlab.winehq.org";
128+
owner = "wine";
129+
repo = "wine-staging";
130+
rev = "v${version}";
131+
132+
disabledPatchsets = [ ];
133+
};
134+
123135
## see http://wiki.winehq.org/Gecko
124136
gecko32 = fetchurl rec {
125137
version = "2.47.4";
@@ -147,8 +159,8 @@ rec {
147159
latest_mono=$(get_latest_lib_version wine-mono)
148160
149161
update_staging() {
150-
staging_url=$(get_source_attr staging.url)
151-
set_source_attr staging hash "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\""
162+
staging_url=$(get_source_attr unstable.staging.url)
163+
set_source_attr unstable.staging hash "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\""
152164
}
153165
154166
autobump unstable "$latest_unstable" "" update_staging
@@ -160,16 +172,43 @@ rec {
160172
'';
161173
};
162174

163-
staging = fetchFromGitLab rec {
164-
# https://gitlab.winehq.org/wine/wine-staging
165-
inherit (unstable) version;
166-
hash = "sha256-rXA/55rwQSJR247E4H7cQdTtXRmjomRbls7THV3jfcE=";
167-
domain = "gitlab.winehq.org";
168-
owner = "wine";
169-
repo = "wine-staging";
170-
rev = "v${version}";
175+
yabridge = fetchurl rec {
176+
# NOTE: This is a pinned version with staging patches; don't forget to update them as well
177+
version = "9.21";
178+
url = "https://dl.winehq.org/wine/source/9.x/wine-${version}.tar.xz";
179+
hash = "sha256-REK0f/2bLqRXEA427V/U5vTYKdnbeaJeYFF1qYjKL/8=";
180+
inherit (stable) patches;
181+
182+
# see https://gitlab.winehq.org/wine/wine-staging
183+
staging = fetchFromGitLab {
184+
inherit version;
185+
hash = "sha256-FDNszRUvM1ewE9Ij4EkuihaX0Hf0eTb5r7KQHMdCX3U=";
186+
domain = "gitlab.winehq.org";
187+
owner = "wine";
188+
repo = "wine-staging";
189+
rev = "v${version}";
190+
191+
disabledPatchsets = [ ];
192+
};
193+
194+
## see http://wiki.winehq.org/Gecko
195+
gecko32 = fetchurl rec {
196+
version = "2.47.4";
197+
url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86.msi";
198+
hash = "sha256-Js7MR3BrCRkI9/gUvdsHTGG+uAYzGOnvxaf3iYV3k9Y=";
199+
};
200+
gecko64 = fetchurl rec {
201+
version = "2.47.4";
202+
url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86_64.msi";
203+
hash = "sha256-5ZC32YijLWqkzx2Ko6o9M3Zv3Uz0yJwtzCCV7LKNBm8=";
204+
};
171205

172-
disabledPatchsets = [ ];
206+
## see http://wiki.winehq.org/Mono
207+
mono = fetchurl rec {
208+
version = "9.3.0";
209+
url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi";
210+
hash = "sha256-bKLArtCW/57CD69et2xrfX3oLZqIdax92fB5O/nD/TA=";
211+
};
173212
};
174213

175214
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

pkgs/applications/emulators/wine/staging.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
with callPackage ./util.nix { };
1414

1515
let
16-
patch = (callPackage ./sources.nix { }).staging;
16+
patch = wineUnstable.src.staging;
1717
build-inputs = pkgNames: extra: (mkBuildInputs wineUnstable.pkgArches pkgNames) ++ extra;
1818
in
1919
assert lib.versions.majorMinor wineUnstable.version == lib.versions.majorMinor patch.version;
2020

21-
(wineUnstable.override { wineRelease = "staging"; }).overrideAttrs (self: {
21+
wineUnstable.overrideAttrs (self: {
2222
buildInputs = build-inputs (
2323
[
2424
"perl"

pkgs/top-level/all-packages.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,11 +1248,11 @@ with pkgs;
12481248
};
12491249

12501250
yabridge = callPackage ../tools/audio/yabridge {
1251-
wine = wineWowPackages.staging;
1251+
wine = wineWowPackages.yabridge;
12521252
};
12531253

12541254
yabridgectl = callPackage ../tools/audio/yabridgectl {
1255-
wine = wineWowPackages.staging;
1255+
wine = wineWowPackages.yabridge;
12561256
};
12571257

12581258
yafetch = callPackage ../tools/misc/yafetch {
@@ -19282,6 +19282,7 @@ with pkgs;
1928219282
stagingFull
1928319283
wayland
1928419284
waylandFull
19285+
yabridge
1928519286
fonts
1928619287
;
1928719288
}

pkgs/top-level/wine-packages.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
lib,
23
stdenv,
34
config,
45
callPackage,
@@ -63,4 +64,10 @@ rec {
6364
waylandFull = full.override {
6465
x11Support = false;
6566
};
67+
68+
yabridge =
69+
let
70+
yabridge = base.override { wineRelease = "yabridge"; };
71+
in
72+
if wineBuild == "wineWow" then yabridge else lib.dontDistribute yabridge;
6673
}

0 commit comments

Comments
 (0)