wine: cleanup Wayland

Makes base.nix less Wayland-centric. This means:
- Don't specify support in the meta.description (since even regular Wine supports it, it's specified everywhere)
- `x11Support` and `waylandSupport` are now set in `wine-packages.nix`, like every other flag (they are also now disabled on minimal)
- Disable Darwin in supported platforms if an incompatible supportFlag is true (not just `waylandSupport`)
- Add wineRelease name for every release other than "stable" or "unstable", instead of just "wayland"
  - This also fixes an inconsistency on wine-staging, where "-staging" was written after the version
This commit is contained in:
Martino Fontana 2024-02-05 23:21:29 +01:00
parent 2e2211a386
commit b2182b9130
4 changed files with 12 additions and 10 deletions

View File

@ -23,6 +23,8 @@ let
mingwGccsSuffixSalts = map (gcc: gcc.suffixSalt) mingwGccs;
};
} ./setup-hook-darwin.sh;
darwinUnsupportedFlags = [ "alsaSupport" "cairoSupport" "dbusSupport" "fontconfigSupport" "gtkSupport" "netapiSupport" "pulseaudioSupport" "udevSupport" "v4lSupport" "vaSupport" "waylandSupport" "x11Support" "xineramaSupport" ];
darwinUnsupported = builtins.any (name: builtins.getAttr name supportFlags) darwinUnsupportedFlags;
in
stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
builder = buildScript;
@ -47,7 +49,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
}) // rec {
inherit version src;
pname = prevName + lib.optionalString (wineRelease == "wayland") "-wayland";
pname = prevName + lib.optionalString (wineRelease != "stable" && wineRelease != "unstable") "-${wineRelease}";
# Fixes "Compiler cannot create executables" building wineWow with mingwSupport
strictDeps = true;
@ -209,8 +211,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
binaryNativeCode # mono, gecko
];
broken = stdenv.isDarwin && !supportFlags.mingwSupport;
description = if supportFlags.waylandSupport then "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)" else "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
platforms = if supportFlags.waylandSupport then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms;
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
platforms = if darwinUnsupported then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms;
maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira reckenrode ];
inherit mainProgram;
};

View File

@ -36,8 +36,8 @@
sdlSupport ? false,
usbSupport ? false,
mingwSupport ? false,
waylandSupport ? stdenv.isLinux,
x11Support ? stdenv.isLinux,
waylandSupport ? false,
x11Support ? false,
embedInstallers ? false, # The Mono and Gecko MSI installers
moltenvk ? darwin.moltenvk # Allow users to override MoltenVK easily
}:

View File

@ -7,12 +7,10 @@ let patch = (callPackage ./sources.nix {}).staging;
(mkBuildInputs wineUnstable.pkgArches pkgNames) ++ extra;
in assert lib.versions.majorMinor wineUnstable.version == lib.versions.majorMinor patch.version;
(lib.overrideDerivation wineUnstable (self: {
(lib.overrideDerivation (wineUnstable.override { wineRelease = "staging"; }) (self: {
buildInputs = build-inputs [ "perl" "util-linux" "autoconf" "gitMinimal" ] self.buildInputs;
nativeBuildInputs = [ autoconf hexdump perl python3 ] ++ self.nativeBuildInputs;
name = "${self.name}-staging";
prePatch = self.prePatch or "" + ''
patchShebangs tools
cp -r ${patch}/patches ${patch}/staging .

View File

@ -25,6 +25,8 @@ rec {
sdlSupport = true;
mingwSupport = true;
usbSupport = true;
waylandSupport = stdenv.isLinux;
x11Support = stdenv.isLinux;
};
full = base.override {
@ -50,6 +52,6 @@ rec {
staging = base.override { wineRelease = "staging"; };
stagingFull = full.override { wineRelease = "staging"; };
wayland = base.override { wineRelease = "wayland"; };
waylandFull = full.override { wineRelease = "wayland"; };
wayland = base.override { wineRelease = "wayland"; waylandSupport = true; };
waylandFull = full.override { wineRelease = "wayland"; waylandSupport = true; };
}