wine-wayland: fixed wineWow builds with wayland support

This commit is contained in:
jmc-figueira 2022-01-13 22:59:25 +00:00
parent abdbf22a30
commit c4367451b3
No known key found for this signature in database
GPG key ID: DC7AE56AE98E02D7
3 changed files with 29 additions and 15 deletions

View file

@ -1,6 +1,7 @@
## build described at http://wiki.winehq.org/Wine64
source $stdenv/setup
preFlags="${configureFlags}"
unpackPhase
cd $TMP/$sourceRoot
@ -11,14 +12,14 @@ mkdir -p $TMP/wine-wow $TMP/wine64
cd $TMP/wine64
sourceRoot=`pwd`
configureFlags="--enable-win64"
configureFlags="${preFlags} --enable-win64"
configurePhase
buildPhase
# checkPhase
cd $TMP/wine-wow
sourceRoot=`pwd`
configureFlags="--with-wine64=../wine64"
configureFlags="${preFlags} --with-wine64=../wine64"
configurePhase
buildPhase
# checkPhase

View file

@ -7,6 +7,8 @@
# 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,
@ -70,7 +72,9 @@ else
(if wineRelease == "wayland" then
callPackage ./wayland.nix {
wineWayland = wine-build wineBuild "wayland";
inherit vulkanSupport vkd3dSupport;
inherit pulseaudioSupport vulkanSupport vkd3dSupport;
pkgArches = lib.optionals (wineBuild == "wine32" || wineBuild == "wineWow") [ pkgsi686Linux ] ++ lib.optionals (wineBuild == "wine64" || wineBuild == "wineWow") [ pkgs ];
}
else
wine-build wineBuild wineRelease

View file

@ -1,21 +1,30 @@
{ lib, callPackage, wineWayland, vulkanSupport, vkd3dSupport }:
{ stdenv, lib, callPackage, wineWayland, pkgArches, pulseaudioSupport, vulkanSupport, vkd3dSupport }:
with callPackage ./util.nix {};
(lib.overrideDerivation wineWayland (self: {
buildInputs = (toBuildInputs wineWayland.pkgArches (pkgs: [ pkgs.wayland pkgs.libxkbcommon pkgs.wayland-protocols pkgs.wayland.dev pkgs.libxkbcommon.dev ])) ++ (lib.subtractLists (toBuildInputs wineWayland.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 ])) self.buildInputs);
(wineWayland.overrideAttrs (old: rec {
name = "${old.name}-wayland";
name = "${self.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);
configureFlags = self.configureFlags
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 = wineWayland.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" wineWayland.meta.platforms);
maintainers = wineWayland.meta.maintainers ++ [ lib.maintainers.jmc-figueira ];
};
}
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 ];
};
}))