wine: Get rid of overcomplicated overrride dance in default.nix

The new logic is much easier to read, and (I hope!) better documented.

As an added bonus, replace with the `with src` with a more targeted `let
inherit`.
This commit is contained in:
John Ericson
2026-02-05 14:37:23 -05:00
committed by Artemis Tosini
parent 55b792803a
commit ccf48cf16b
2 changed files with 27 additions and 18 deletions
+3 -16
View File
@@ -49,10 +49,10 @@
let
wine-build =
build: release:
build:
lib.getAttr build (
callPackage ./packages.nix {
wineRelease = release;
inherit wineRelease;
supportFlags = {
inherit
alsaSupport
@@ -91,18 +91,5 @@ let
inherit moltenvk;
}
);
baseRelease =
{
staging = "unstable";
yabridge = "yabridge";
}
.${wineRelease} or null;
in
if baseRelease != null then
(wine-build wineBuild baseRelease).override {
inherit wineRelease;
useStaging = true;
}
else
wine-build wineBuild wineRelease
wine-build wineBuild
+24 -2
View File
@@ -18,9 +18,27 @@
}:
let
src = lib.getAttr wineRelease (callPackage ./sources.nix { });
sources = callPackage ./sources.nix { };
# "staging" of course enables staging, but for "yabridge" we do too
# --- we are not interested in yabridge without the staging patches
# applied.
useStaging = wineRelease == "staging" || wineRelease == "yabridge";
# Map wineRelease to actual source. Many versions have a "staging"
# variant, but when we say "staging", the version we want to use is
# "unstable".
baseRelease = if wineRelease == "staging" then "unstable" else wineRelease;
src = lib.getAttr baseRelease (callPackage ./sources.nix { });
inherit (src)
version
patches
gecko32
gecko64
mono
;
in
with src;
{
wine32 = pkgsi686Linux.callPackage ./base.nix {
pname = "wine";
@@ -31,6 +49,7 @@ with src;
patches
moltenvk
wineRelease
useStaging
# Forcing these `nativeBuildInputs` used in the `staging` to come
# from ambient `pkgs`, rather than being provided by
# `pkgsi686Linux.callPackage` for that platform.
@@ -58,6 +77,7 @@ with src;
patches
moltenvk
wineRelease
useStaging
;
pkgArches = [ pkgs ];
mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ];
@@ -79,6 +99,7 @@ with src;
patches
moltenvk
wineRelease
useStaging
;
stdenv = stdenv_32bit;
pkgArches = [
@@ -112,6 +133,7 @@ with src;
patches
moltenvk
wineRelease
useStaging
;
supportFlags = supportFlags // {
mingwSupport = true;