Unverified Commit dcc45043 authored by Artemis Tosini's avatar Artemis Tosini Committed by GitHub
Browse files

wine: Get rid of overcomplicated `overrride` dance in `default.nix` (#487387)

parents 51b1f1e7 ccf48cf1
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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;