wine: Make base.nix and package.nix not know about wineRelease (#487421)

This commit is contained in:
Artemis Tosini
2026-02-06 15:36:52 +00:00
committed by GitHub
3 changed files with 53 additions and 30 deletions
+4 -5
View File
@@ -18,7 +18,7 @@
pkg-config,
nixosTests,
supportFlags,
wineRelease,
pnameSuffix ? "",
patches,
moltenvk,
buildScript ? null,
@@ -95,9 +95,7 @@ stdenv.mkDerivation (
// {
inherit version src;
pname =
prevName
+ lib.optionalString (wineRelease != "stable" && wineRelease != "unstable") "-${wineRelease}";
pname = prevName + pnameSuffix;
# Fixes "Compiler cannot create executables" building wineWow with mingwSupport
strictDeps = true;
@@ -267,7 +265,8 @@ stdenv.mkDerivation (
)
)
);
env.NIX_CFLAGS_COMPILE = lib.optionalString (wineRelease == "yabridge") "-std=gnu17";
# Just here to avoid rebuilds for now.
env.NIX_CFLAGS_COMPILE = "";
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
# elements specified above.
+42 -7
View File
@@ -48,11 +48,38 @@
}:
let
wine-build =
build:
lib.getAttr build (
callPackage ./packages.nix {
inherit wineRelease;
sources = callPackage ./sources.nix { };
# Map user-facing release names to sources, pname suffix, and staging flag
releaseInfo = {
stable = {
src = sources.stable;
useStaging = false;
};
unstable = {
src = sources.unstable;
useStaging = false;
};
# Many versions have a "staging" variant, but when we say "staging",
# the version we want to use is "unstable".
staging = {
src = sources.unstable;
pnameSuffix = "-staging";
useStaging = true;
};
# "yabridge" enables staging too --- we are not interested in
# yabridge without the staging patches applied.
yabridge = {
src = sources.yabridge;
pnameSuffix = "-yabridge";
useStaging = true;
};
};
baseWine = lib.getAttr wineBuild (
callPackage ./packages.nix (
releaseInfo.${wineRelease}
// {
supportFlags = {
inherit
alsaSupport
@@ -90,6 +117,14 @@ let
};
inherit moltenvk;
}
);
)
);
in
wine-build wineBuild
if wineRelease == "yabridge" then
baseWine.overrideAttrs (old: {
env = old.env // {
NIX_CFLAGS_COMPILE = "-std=gnu17";
};
})
else
baseWine
+7 -18
View File
@@ -7,7 +7,9 @@
callPackage,
replaceVars,
moltenvk,
wineRelease ? "stable",
src,
pnameSuffix ? "",
useStaging ? false,
supportFlags,
# Staging native build deps
autoconf,
@@ -18,19 +20,6 @@
}:
let
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
@@ -48,7 +37,7 @@ in
supportFlags
patches
moltenvk
wineRelease
pnameSuffix
useStaging
# Forcing these `nativeBuildInputs` used in the `staging` to come
# from ambient `pkgs`, rather than being provided by
@@ -76,7 +65,7 @@ in
supportFlags
patches
moltenvk
wineRelease
pnameSuffix
useStaging
;
pkgArches = [ pkgs ];
@@ -98,7 +87,7 @@ in
supportFlags
patches
moltenvk
wineRelease
pnameSuffix
useStaging
;
stdenv = stdenv_32bit;
@@ -132,7 +121,7 @@ in
version
patches
moltenvk
wineRelease
pnameSuffix
useStaging
;
supportFlags = supportFlags // {