diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix index 55a4172b402a..1d34ce36b5b1 100644 --- a/pkgs/applications/emulators/wine/default.nix +++ b/pkgs/applications/emulators/wine/default.nix @@ -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 diff --git a/pkgs/applications/emulators/wine/packages.nix b/pkgs/applications/emulators/wine/packages.nix index b5d6942ae914..6070c68b64c2 100644 --- a/pkgs/applications/emulators/wine/packages.nix +++ b/pkgs/applications/emulators/wine/packages.nix @@ -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;