chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / dx / dxvk_2 / package.nix
blobd8a00086abb6bfb636a3d108eee0a5dc1d5096cb
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   pkgsBuildHost,
6   glslang,
7   meson,
8   ninja,
9   pkg-config,
10   windows,
11   spirv-headers,
12   vulkan-headers,
13   SDL2,
14   glfw,
15   gitUpdater,
16   sdl2Support ? (!stdenv.hostPlatform.isWindows),
17   glfwSupport ? (!stdenv.hostPlatform.isWindows),
20 assert stdenv.hostPlatform.isWindows -> !glfwSupport && !sdl2Support;
22 let
23   inherit (stdenv) hostPlatform;
25   libPrefix = lib.optionalString (!hostPlatform.isWindows) "lib";
26   soVersion =
27     version:
28     if hostPlatform.isDarwin then
29       ".${version}${hostPlatform.extensions.sharedLibrary}"
30     else if hostPlatform.isWindows then
31       hostPlatform.extensions.sharedLibrary
32     else
33       "${hostPlatform.extensions.sharedLibrary}.${version}";
35   libglfw = "${libPrefix}glfw${soVersion "3"}";
36   libSDL2 = "${libPrefix}SDL2${lib.optionalString (!hostPlatform.isWindows) "-2.0"}${soVersion "0"}";
38 stdenv.mkDerivation (finalAttrs: {
39   pname = "dxvk";
40   version = "2.4";
42   src = fetchFromGitHub {
43     owner = "doitsujin";
44     repo = "dxvk";
45     rev = "v${finalAttrs.version}";
46     hash = "sha256-4U0Z1oR0BKIHZ6YNT/+8sFe2I/ZKmPecInMXUho4MHg=";
47     fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info
48   };
50   postPatch =
51     ''
52       substituteInPlace meson.build \
53         --replace-fail "dependency('glfw'" "dependency('glfw3'"
54       substituteInPlace subprojects/libdisplay-info/tool/gen-search-table.py \
55         --replace-fail "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3"
56     ''
57     + lib.optionalString glfwSupport ''
58       substituteInPlace src/wsi/glfw/wsi_platform_glfw.cpp \
59         --replace-fail '${libglfw}' '${lib.getLib glfw}/lib/${libglfw}'
60     ''
61     + lib.optionalString sdl2Support ''
62       substituteInPlace src/wsi/sdl2/wsi_platform_sdl2.cpp \
63         --replace-fail '${libSDL2}' '${lib.getLib SDL2}/lib/${libSDL2}'
64     '';
66   strictDeps = true;
68   nativeBuildInputs = [
69     glslang
70     meson
71     ninja
72   ] ++ lib.optionals (glfwSupport || sdl2Support) [ pkg-config ];
74   buildInputs =
75     [
76       spirv-headers
77       vulkan-headers
78     ]
79     ++ lib.optionals sdl2Support [ SDL2 ]
80     ++ lib.optionals glfwSupport [ glfw ]
81     ++ lib.optionals hostPlatform.isWindows [ windows.pthreads ];
83   # Build with the Vulkan SDK in nixpkgs.
84   preConfigure = ''
85     rm -rf include/spirv/include include/vulkan/include
86     mkdir -p include/spirv/include include/vulkan/include
87   '';
89   mesonBuildType = "release";
91   doCheck = true;
93   passthru.updateScript = gitUpdater { rev-prefix = "v"; };
95   __structuredAttrs = true;
97   meta = {
98     description = "Vulkan-based translation layer for Direct3D 8/9/10/11";
99     homepage = "https://github.com/doitsujin/dxvk";
100     changelog = "https://github.com/doitsujin/dxvk/releases";
101     maintainers = [ lib.maintainers.reckenrode ];
102     license = lib.licenses.zlib;
103     badPlatforms = lib.platforms.darwin;
104     platforms = lib.platforms.windows ++ lib.platforms.unix;
105   };