66b694f83e
Signed-off-by: David Wronek <david.wronek@mainlining.org>
110 lines
2.7 KiB
Nix
110 lines
2.7 KiB
Nix
## Configuration:
|
|
# Control you default wine config in nixpkgs-config:
|
|
# wine = {
|
|
# release = "stable"; # "stable", "unstable", "staging", "wayland"
|
|
# build = "wineWow"; # "wine32", "wine64", "wineWow"
|
|
# };
|
|
# Make additional configurations on demand:
|
|
# wine.override { wineBuild = "wine32"; wineRelease = "staging"; };
|
|
args@{
|
|
lib,
|
|
stdenv,
|
|
callPackage,
|
|
darwin,
|
|
wineRelease ? "stable",
|
|
wineBuild ?
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
"wineWow"
|
|
else if stdenv.hostPlatform.isAarch64 then
|
|
"wine64"
|
|
else
|
|
"wine32",
|
|
gettextSupport ? false,
|
|
fontconfigSupport ? false,
|
|
alsaSupport ? false,
|
|
gtkSupport ? false,
|
|
openglSupport ? false,
|
|
tlsSupport ? false,
|
|
gstreamerSupport ? false,
|
|
cupsSupport ? false,
|
|
dbusSupport ? false,
|
|
openclSupport ? false,
|
|
cairoSupport ? false,
|
|
odbcSupport ? false,
|
|
netapiSupport ? false,
|
|
cursesSupport ? false,
|
|
vaSupport ? false,
|
|
pcapSupport ? false,
|
|
v4lSupport ? false,
|
|
saneSupport ? false,
|
|
gphoto2Support ? false,
|
|
krb5Support ? false,
|
|
pulseaudioSupport ? false,
|
|
udevSupport ? false,
|
|
xineramaSupport ? false,
|
|
vulkanSupport ? false,
|
|
sdlSupport ? false,
|
|
usbSupport ? false,
|
|
mingwSupport ? stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64,
|
|
waylandSupport ? false,
|
|
x11Support ? false,
|
|
ffmpegSupport ? false,
|
|
embedInstallers ? false, # The Mono and Gecko MSI installers
|
|
moltenvk, # Allow users to override MoltenVK easily
|
|
smartcardSupport ? false,
|
|
}:
|
|
|
|
let
|
|
sources = callPackage ./sources.nix { };
|
|
|
|
supportFlags = lib.filterAttrs (
|
|
name: _:
|
|
!builtins.elem name [
|
|
"lib"
|
|
"stdenv"
|
|
"callPackage"
|
|
"darwin"
|
|
"wineRelease"
|
|
"wineBuild"
|
|
]
|
|
) args;
|
|
|
|
# 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)
|
|
);
|
|
in
|
|
if wineRelease == "yabridge" then
|
|
baseWine.overrideAttrs (old: {
|
|
env = old.env // {
|
|
NIX_CFLAGS_COMPILE = "-std=gnu17";
|
|
};
|
|
})
|
|
else
|
|
baseWine
|