dxvk: 2.0 -> 2.1

https://github.com/doitsujin/dxvk/releases/tag/v2.1
This commit is contained in:
Randy Eckenrode 2023-01-27 00:50:05 -05:00
parent 67a2ceab6a
commit 81a86d07e6
No known key found for this signature in database
GPG key ID: 64C1CD4EC2A600D9
2 changed files with 19 additions and 5 deletions

View file

@ -9,8 +9,15 @@
, spirv-headers , spirv-headers
, vulkan-headers , vulkan-headers
, SDL2 , SDL2
, glfw
, pkgsBuildHost
, sdl2Support ? true
, glfwSupport ? false
}: }:
# SDL2 and GLFW support are mutually exclusive.
assert !sdl2Support || !glfwSupport;
let let
# DXVK 2.0+ no longer vendors certain dependencies. This derivation also needs to build on Darwin, # DXVK 2.0+ no longer vendors certain dependencies. This derivation also needs to build on Darwin,
# which does not currently support DXVK 2.0, so adapt conditionally for this situation. # which does not currently support DXVK 2.0, so adapt conditionally for this situation.
@ -36,13 +43,13 @@ let
./darwin-thread-primitives.patch ./darwin-thread-primitives.patch
]; ];
}; };
"2.0" = rec { "2.1" = rec {
version = "2.0"; version = "2.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "doitsujin"; owner = "doitsujin";
repo = "dxvk"; repo = "dxvk";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-mSNFvoILsvm+CpWV7uRlb7DkjV7ctClSUdteNcF5EAY="; hash = "sha256-A4KR11brfQbR56dGt371MRwMN/H6HFAU8TlFC97/bRs=";
fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info
}; };
patches = [ ]; patches = [ ];
@ -61,8 +68,14 @@ stdenv.mkDerivation {
++ lib.optionals isDxvk2 ( ++ lib.optionals isDxvk2 (
[ spirv-headers vulkan-headers ] [ spirv-headers vulkan-headers ]
++ lib.optional (!isWindows && sdl2Support) SDL2 ++ lib.optional (!isWindows && sdl2Support) SDL2
++ lib.optional (!isWindows && glfwSupport) glfw
); );
postPatch = lib.optionalString isDxvk2 ''
substituteInPlace "subprojects/libdisplay-info/tool/gen-search-table.py" \
--replace "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3"
'';
# Build with the Vulkan SDK in nixpkgs. # Build with the Vulkan SDK in nixpkgs.
preConfigure = '' preConfigure = ''
rm -rf include/spirv/include include/vulkan/include rm -rf include/spirv/include include/vulkan/include
@ -77,7 +90,8 @@ stdenv.mkDerivation {
"--buildtype" "release" "--buildtype" "release"
"--prefix" "${placeholder "out"}" "--prefix" "${placeholder "out"}"
] ]
++ lib.optionals isCross [ "--cross-file" "build-win${arch}.txt" ]; ++ lib.optionals isCross [ "--cross-file" "build-win${arch}.txt" ]
++ lib.optional glfwSupport "-Ddxvk_native_wsi=glfw";
doCheck = isDxvk2 && !isCross; doCheck = isDxvk2 && !isCross;

View file

@ -37210,7 +37210,7 @@ with pkgs;
dxvk = callPackage ../misc/dxvk { }; dxvk = callPackage ../misc/dxvk { };
dxvk_1 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "1.10"; }; dxvk_1 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "1.10"; };
dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.0"; }; dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.1"; };
ecdsatool = callPackage ../tools/security/ecdsatool { }; ecdsatool = callPackage ../tools/security/ecdsatool { };