nixpkgs/pkgs/by-name/dx/dxvk_2/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
1.9 KiB
Nix
Raw Permalink Normal View History

{
lib,
stdenv,
fetchFromGitHub,
pkgsBuildHost,
glslang,
meson,
ninja,
windows,
spirv-headers,
vulkan-headers,
SDL2,
glfw,
gitUpdater,
sdl2Support ? true,
glfwSupport ? false,
2023-10-08 19:58:27 +00:00
}:
# SDL2 and GLFW support are mutually exclusive.
assert !sdl2Support || !glfwSupport;
let
isWindows = stdenv.hostPlatform.uname.system == "Windows";
in
stdenv.mkDerivation (finalAttrs: {
2023-10-08 19:58:27 +00:00
pname = "dxvk";
2024-04-06 21:13:43 +00:00
version = "2.3.1";
2023-10-08 19:58:27 +00:00
src = fetchFromGitHub {
owner = "doitsujin";
repo = "dxvk";
rev = "v${finalAttrs.version}";
2024-04-06 21:13:43 +00:00
hash = "sha256-lUzD1NHFLO4UqOg/BUr7PnYMJCMr1KBh3VNx8etbt8c=";
2023-10-08 19:58:27 +00:00
fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info
};
postPatch = ''
substituteInPlace "subprojects/libdisplay-info/tool/gen-search-table.py" \
--replace "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3"
'';
strictDeps = true;
nativeBuildInputs = [
glslang
meson
ninja
];
buildInputs =
[
spirv-headers
vulkan-headers
]
2023-10-08 19:58:27 +00:00
++ lib.optionals (!isWindows && sdl2Support) [ SDL2 ]
++ lib.optionals (!isWindows && glfwSupport) [ glfw ]
++ lib.optionals isWindows [ windows.pthreads ];
# Build with the Vulkan SDK in nixpkgs.
preConfigure = ''
rm -rf include/spirv/include include/vulkan/include
mkdir -p include/spirv/include include/vulkan/include
'';
mesonBuildType = "release";
mesonFlags = lib.optionals glfwSupport [ "-Ddxvk_native_wsi=glfw" ];
2023-10-08 19:58:27 +00:00
doCheck = true;
2023-10-08 19:58:27 +00:00
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
__structuredAttrs = true;
2023-10-08 19:58:27 +00:00
meta = {
description = "A Vulkan-based translation layer for Direct3D 9/10/11";
homepage = "https://github.com/doitsujin/dxvk";
changelog = "https://github.com/doitsujin/dxvk/releases";
maintainers = [ lib.maintainers.reckenrode ];
license = lib.licenses.zlib;
platforms = lib.platforms.windows ++ lib.platforms.linux;
};
})