wine-wayland: fixed vkd3d dependency in wineWow builds and standardized the derivation
As recommended by @FlorianFranzen, the derivation for wine-wayland builds was moved from a separate "patch-like" derivation to base.nix, by setting the appropriate supportFlags. This was also done to solve an issue when building wineWow builds, where they would fail due to the 32-bit vkd3d not being linked appropriately.
This commit is contained in:
parent
c4367451b3
commit
74f85d3714
|
@ -4,19 +4,24 @@
|
|||
autoconf, hexdump, perl,
|
||||
supportFlags,
|
||||
patches,
|
||||
vkd3dArches,
|
||||
buildScript ? null, configureFlags ? []
|
||||
}:
|
||||
|
||||
with import ./util.nix { inherit lib; };
|
||||
|
||||
let
|
||||
vkd3d = callPackage ./vkd3d.nix {};
|
||||
patches' = patches;
|
||||
prevName = name;
|
||||
prevPlatforms = platforms;
|
||||
prevConfigFlags = configureFlags;
|
||||
in
|
||||
stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
||||
builder = buildScript;
|
||||
}) // rec {
|
||||
inherit name src configureFlags;
|
||||
inherit src;
|
||||
|
||||
name = if supportFlags.waylandSupport then "${prevName}-wayland" else prevName;
|
||||
|
||||
# Fixes "Compiler cannot create executables" building wineWow with mingwSupport
|
||||
strictDeps = true;
|
||||
|
@ -36,7 +41,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
|||
++ lib.optionals supportFlags.mingwSupport mingwGccs;
|
||||
|
||||
buildInputs = toBuildInputs pkgArches (with supportFlags; (pkgs:
|
||||
[ pkgs.freetype pkgs.perl pkgs.xorg.libX11 ]
|
||||
[ pkgs.freetype pkgs.perl ]
|
||||
++ lib.optional stdenv.isLinux pkgs.libcap
|
||||
++ lib.optional pngSupport pkgs.libpng
|
||||
++ lib.optional jpegSupport pkgs.libjpeg
|
||||
|
@ -66,7 +71,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
|||
++ lib.optional vulkanSupport pkgs.vulkan-loader
|
||||
++ lib.optional sdlSupport pkgs.SDL2
|
||||
++ lib.optional faudioSupport pkgs.faudio
|
||||
++ lib.optional vkd3dSupport vkd3d
|
||||
++ vkd3dArches
|
||||
++ lib.optionals gstreamerSupport (with pkgs.gst_all_1;
|
||||
[ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-libav
|
||||
(gst-plugins-bad.override { enableZbar = false; }) ])
|
||||
|
@ -79,12 +84,20 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
|||
CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration Security
|
||||
ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenAL OpenCL Cocoa Carbon
|
||||
])
|
||||
++ lib.optionals stdenv.isLinux (with pkgs.xorg; [
|
||||
libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext
|
||||
++ lib.optionals (stdenv.isLinux && !waylandSupport) (with pkgs.xorg; [
|
||||
libX11 libXi libXcursor libXrandr libXrender libXxf86vm libXcomposite libXext
|
||||
])
|
||||
++ lib.optionals waylandSupport (with pkgs; [
|
||||
wayland libxkbcommon wayland-protocols wayland.dev libxkbcommon.dev
|
||||
])));
|
||||
|
||||
patches = [ ] ++ patches';
|
||||
|
||||
configureFlags = prevConfigFlags
|
||||
++ lib.optionals supportFlags.waylandSupport [ "--with-wayland" ]
|
||||
++ lib.optionals supportFlags.vulkanSupport [ "--with-vulkan" ]
|
||||
++ lib.optionals supportFlags.vkd3dSupport [ "--with-vkd3d" ];
|
||||
|
||||
# Wine locates a lot of libraries dynamically through dlopen(). Add
|
||||
# them to the RPATH so that the user doesn't have to set them in
|
||||
# LD_LIBRARY_PATH.
|
||||
|
@ -93,6 +106,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
|||
# libpulsecommon.so is linked but not found otherwise
|
||||
++ lib.optionals supportFlags.pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio")
|
||||
(toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
|
||||
++ lib.optionals supportFlags.waylandSupport (map (x: "${lib.getLib x}/share/wayland-protocols")
|
||||
(toBuildInputs pkgArches (pkgs: [ pkgs.wayland-protocols ])))
|
||||
));
|
||||
|
||||
# Don't shrink the ELF RPATHs in order to keep the extra RPATH
|
||||
|
@ -146,11 +161,12 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) {
|
|||
|
||||
passthru = { inherit pkgArches; };
|
||||
meta = {
|
||||
inherit version platforms;
|
||||
inherit version;
|
||||
homepage = "https://www.winehq.org/";
|
||||
license = with lib.licenses; [ lgpl21Plus ];
|
||||
description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
|
||||
maintainers = with lib.maintainers; [ avnik raskin bendlas ];
|
||||
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;
|
||||
maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira ];
|
||||
mainProgram = "wine";
|
||||
};
|
||||
})
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
# Make additional configurations on demand:
|
||||
# wine.override { wineBuild = "wine32"; wineRelease = "staging"; };
|
||||
{ lib, stdenv, callPackage,
|
||||
pkgs,
|
||||
pkgsi686Linux,
|
||||
wineRelease ? "stable",
|
||||
wineBuild ? if stdenv.hostPlatform.system == "x86_64-linux" then "wineWow" else "wine32",
|
||||
pngSupport ? false,
|
||||
|
@ -47,6 +45,7 @@
|
|||
faudioSupport ? false,
|
||||
vkd3dSupport ? false,
|
||||
mingwSupport ? wineRelease != "stable",
|
||||
waylandSupport ? wineRelease == "wayland",
|
||||
embedInstallers ? false # The Mono and Gecko MSI installers
|
||||
}:
|
||||
|
||||
|
@ -60,7 +59,7 @@ let wine-build = build: release:
|
|||
gsmSupport gphoto2Support ldapSupport fontconfigSupport alsaSupport
|
||||
pulseaudioSupport xineramaSupport gtkSupport openclSupport xmlSupport tlsSupport
|
||||
openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport faudioSupport
|
||||
vkd3dSupport mingwSupport embedInstallers;
|
||||
vkd3dSupport mingwSupport waylandSupport embedInstallers;
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -69,13 +68,4 @@ in if wineRelease == "staging" then
|
|||
wineUnstable = wine-build wineBuild "unstable";
|
||||
}
|
||||
else
|
||||
(if wineRelease == "wayland" then
|
||||
callPackage ./wayland.nix {
|
||||
wineWayland = wine-build wineBuild "wayland";
|
||||
inherit pulseaudioSupport vulkanSupport vkd3dSupport;
|
||||
|
||||
pkgArches = lib.optionals (wineBuild == "wine32" || wineBuild == "wineWow") [ pkgsi686Linux ] ++ lib.optionals (wineBuild == "wine64" || wineBuild == "wineWow") [ pkgs ];
|
||||
}
|
||||
else
|
||||
wine-build wineBuild wineRelease
|
||||
)
|
||||
wine-build wineBuild wineRelease
|
||||
|
|
|
@ -3,12 +3,16 @@
|
|||
supportFlags
|
||||
}:
|
||||
|
||||
let src = lib.getAttr wineRelease (callPackage ./sources.nix {});
|
||||
let
|
||||
src = lib.getAttr wineRelease (callPackage ./sources.nix {});
|
||||
vkd3d = pkgs.callPackage ./vkd3d.nix {};
|
||||
vkd3d_i686 = pkgsi686Linux.callPackage ./vkd3d.nix {};
|
||||
in with src; {
|
||||
wine32 = pkgsi686Linux.callPackage ./base.nix {
|
||||
name = "wine-${version}";
|
||||
inherit src version supportFlags patches;
|
||||
pkgArches = [ pkgsi686Linux ];
|
||||
vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d_i686 ];
|
||||
geckos = [ gecko32 ];
|
||||
mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc ];
|
||||
monos = [ mono ];
|
||||
|
@ -18,6 +22,7 @@ in with src; {
|
|||
name = "wine64-${version}";
|
||||
inherit src version supportFlags patches;
|
||||
pkgArches = [ pkgs ];
|
||||
vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d ];
|
||||
mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ];
|
||||
geckos = [ gecko64 ];
|
||||
monos = [ mono ];
|
||||
|
@ -29,6 +34,7 @@ in with src; {
|
|||
inherit src version supportFlags patches;
|
||||
stdenv = stdenv_32bit;
|
||||
pkgArches = [ pkgs pkgsi686Linux ];
|
||||
vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d vkd3d_i686 ];
|
||||
geckos = [ gecko32 gecko64 ];
|
||||
mingwGccs = with pkgsCross; [ mingw32.buildPackages.gcc mingwW64.buildPackages.gcc ];
|
||||
monos = [ mono ];
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
{ stdenv, lib, callPackage, wineWayland, pkgArches, pulseaudioSupport, vulkanSupport, vkd3dSupport }:
|
||||
|
||||
with callPackage ./util.nix {};
|
||||
|
||||
(wineWayland.overrideAttrs (old: rec {
|
||||
name = "${old.name}-wayland";
|
||||
|
||||
buildInputs = (toBuildInputs pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs pkgArches (pkgs: [ pkgs.xorg.libX11 pkgs.xorg.libXi pkgs.xorg.libXcursor pkgs.xorg.libXrandr pkgs.xorg.libXrender pkgs.xorg.libXxf86vm pkgs.xorg.libXcomposite pkgs.xorg.libXext ])) old.buildInputs);
|
||||
|
||||
NIX_LDFLAGS = toString (map (path: "-rpath " + path) (
|
||||
map (x: "${lib.getLib x}/lib") ([ stdenv.cc.cc ] ++ buildInputs)
|
||||
# libpulsecommon.so is linked but not found otherwise
|
||||
++ lib.optionals pulseaudioSupport (map (x: "${lib.getLib x}/lib/pulseaudio")
|
||||
(toBuildInputs pkgArches (pkgs: [ pkgs.libpulseaudio ])))
|
||||
++ (map (x: "${lib.getLib x}/share/wayland-protocols")
|
||||
(toBuildInputs pkgArches (pkgs: [ pkgs.wayland-protocols ])))
|
||||
));
|
||||
|
||||
configureFlags = old.configureFlags
|
||||
++ [ "--with-wayland" ]
|
||||
++ lib.optionals vulkanSupport [ "--with-vulkan" ]
|
||||
++ lib.optionals vkd3dSupport [ "--with-vkd3d" ];
|
||||
|
||||
|
||||
meta = old.meta // {
|
||||
description = "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)";
|
||||
platforms = (lib.remove "x86_64-darwin" old.meta.platforms);
|
||||
maintainers = old.meta.maintainers ++ [ lib.maintainers.jmc-figueira ];
|
||||
};
|
||||
}))
|
Loading…
Reference in a new issue