From ff2aca9f4ae39834b0609158f1a5a55528026ebb Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 17 Feb 2022 08:29:25 -0500 Subject: wine: enable Vulkan on Darwin --- pkgs/applications/emulators/wine/base.nix | 3 ++- pkgs/applications/emulators/wine/default.nix | 6 ++++-- pkgs/applications/emulators/wine/packages.nix | 12 ++++++------ pkgs/applications/emulators/wine/vkd3d.nix | 8 ++++---- pkgs/top-level/wine-packages.nix | 4 ++-- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index 131f573288b..f13e224627a 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -5,6 +5,7 @@ supportFlags, patches, vkd3dArches, + moltenvk, buildScript ? null, configureFlags ? [] }: @@ -87,7 +88,7 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { ++ lib.optional pulseaudioSupport pkgs.libpulseaudio ++ lib.optional (xineramaSupport && !waylandSupport) pkgs.xorg.libXinerama ++ lib.optional udevSupport pkgs.udev - ++ lib.optional vulkanSupport pkgs.vulkan-loader + ++ lib.optional vulkanSupport (if stdenv.isDarwin then moltenvk else pkgs.vulkan-loader) ++ lib.optional sdlSupport pkgs.SDL2 ++ lib.optional usbSupport pkgs.libusb1 ++ vkd3dArches diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix index 082d5738985..37953f73c5d 100644 --- a/pkgs/applications/emulators/wine/default.nix +++ b/pkgs/applications/emulators/wine/default.nix @@ -6,7 +6,7 @@ # }; # Make additional configurations on demand: # wine.override { wineBuild = "wine32"; wineRelease = "staging"; }; -{ lib, stdenv, callPackage, +{ lib, stdenv, callPackage, darwin, wineRelease ? "stable", wineBuild ? if stdenv.hostPlatform.system == "x86_64-linux" then "wineWow" else "wine32", gettextSupport ? false, @@ -40,7 +40,8 @@ usbSupport ? false, mingwSupport ? wineRelease != "stable", waylandSupport ? wineRelease == "wayland", - embedInstallers ? false # The Mono and Gecko MSI installers + embedInstallers ? false, # The Mono and Gecko MSI installers + moltenvk ? darwin.moltenvk # Allow users to override MoltenVK easily }: let wine-build = build: release: @@ -55,6 +56,7 @@ let wine-build = build: release: tlsSupport openglSupport gstreamerSupport udevSupport vulkanSupport sdlSupport usbSupport vkd3dSupport mingwSupport waylandSupport embedInstallers; }; + inherit moltenvk; }); in if wineRelease == "staging" then diff --git a/pkgs/applications/emulators/wine/packages.nix b/pkgs/applications/emulators/wine/packages.nix index cb857daef0a..bf3f57aff0f 100644 --- a/pkgs/applications/emulators/wine/packages.nix +++ b/pkgs/applications/emulators/wine/packages.nix @@ -1,16 +1,16 @@ -{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage, +{ stdenv_32bit, lib, pkgs, pkgsi686Linux, pkgsCross, callPackage, moltenvk, wineRelease ? "stable", supportFlags }: let src = lib.getAttr wineRelease (callPackage ./sources.nix {}); - vkd3d = pkgs.callPackage ./vkd3d.nix {}; - vkd3d_i686 = pkgsi686Linux.callPackage ./vkd3d.nix {}; + vkd3d = pkgs.callPackage ./vkd3d.nix { inherit moltenvk; }; + vkd3d_i686 = pkgsi686Linux.callPackage ./vkd3d.nix { inherit moltenvk; }; in with src; { wine32 = pkgsi686Linux.callPackage ./base.nix { name = "wine-${version}"; - inherit src version supportFlags patches; + inherit src version supportFlags patches moltenvk; pkgArches = [ pkgsi686Linux ]; vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d_i686 ]; geckos = [ gecko32 ]; @@ -20,7 +20,7 @@ in with src; { }; wine64 = callPackage ./base.nix { name = "wine64-${version}"; - inherit src version supportFlags patches; + inherit src version supportFlags patches moltenvk; pkgArches = [ pkgs ]; vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d ]; mingwGccs = with pkgsCross; [ mingwW64.buildPackages.gcc ]; @@ -31,7 +31,7 @@ in with src; { }; wineWow = callPackage ./base.nix { name = "wine-wow-${version}"; - inherit src version supportFlags patches; + inherit src version supportFlags patches moltenvk; stdenv = stdenv_32bit; pkgArches = [ pkgs pkgsi686Linux ]; vkd3dArches = lib.optionals supportFlags.vkd3dSupport [ vkd3d vkd3d_i686 ]; diff --git a/pkgs/applications/emulators/wine/vkd3d.nix b/pkgs/applications/emulators/wine/vkd3d.nix index 303d33df217..ac7c399cd97 100644 --- a/pkgs/applications/emulators/wine/vkd3d.nix +++ b/pkgs/applications/emulators/wine/vkd3d.nix @@ -1,6 +1,5 @@ -{ lib, stdenv, fetchurl, vulkan-headers, spirv-headers, vulkan-loader }: +{ lib, stdenv, fetchurl, moltenvk, vulkan-headers, spirv-headers, vulkan-loader }: -#TODO: MoltenVK #TODO: unstable stdenv.mkDerivation rec { @@ -12,7 +11,8 @@ stdenv.mkDerivation rec { sha256 = "0szr1lw3xbgi9qjm13d1q4gyzzwv8i5wfxiwjg6dmwphrc7h6jxh"; }; - buildInputs = [ vulkan-headers spirv-headers vulkan-loader ]; + buildInputs = [ vulkan-headers spirv-headers ] + ++ [ (if stdenv.isDarwin then moltenvk else vulkan-loader) ]; enableParallelBuilding = true; @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { description = "A 3d library build on top on Vulkan with a similar api to DirectX 12"; homepage = "https://source.winehq.org/git/vkd3d.git"; license = licenses.lgpl21; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = [ maintainers.marius851000 ]; }; } diff --git a/pkgs/top-level/wine-packages.nix b/pkgs/top-level/wine-packages.nix index d15ac9f0c9b..c8bdaeb426e 100644 --- a/pkgs/top-level/wine-packages.nix +++ b/pkgs/top-level/wine-packages.nix @@ -12,7 +12,7 @@ rec { fontconfigSupport = stdenv.isLinux; alsaSupport = stdenv.isLinux; openglSupport = true; - vulkanSupport = stdenv.isLinux; + vulkanSupport = true; tlsSupport = true; cupsSupport = true; dbusSupport = stdenv.isLinux; @@ -40,7 +40,7 @@ rec { gphoto2Support = true; krb5Support = true; ldapSupport = true; - vkd3dSupport = stdenv.isLinux; + vkd3dSupport = true; embedInstallers = true; }; -- cgit 1.4.1