1{ lib, stdenv, fetchFromGitHub, meson, ninja, wine, glslang }:
2
3let
4 # these are both embedded in the output files
5 rev = "83308675078e9ea263fa8c37af95afdd15b3ab71";
6 # git describe --tags
7 shortRev = builtins.substring 0 8 rev;
8 realVersion = "v2.8-302-g${shortRev}";
9in
10
11stdenv.mkDerivation rec {
12 pname = "vkd3d-proton";
13 version = "unstable-2023-04-21";
14
15 nativeBuildInputs = [ meson ninja wine glslang ];
16
17 src = fetchFromGitHub {
18 owner = "HansKristian-Work";
19 repo = pname;
20 inherit rev;
21 sha256 = "sha256-iLpVvYmWhqy0rbbyJoT+kxzIqp68Vsb/TkihGtQQucU=";
22 fetchSubmodules = true;
23 };
24
25 prePatch = ''
26 substituteInPlace meson.build \
27 --replace "vkd3d_build = vcs_tag(" \
28 "vkd3d_build = vcs_tag( fallback : '${shortRev}'", \
29 --replace "vkd3d_version = vcs_tag(" \
30 "vkd3d_version = vcs_tag( fallback : '${realVersion}'",
31 '';
32
33 meta = with lib; {
34 homepage = "https://github.com/HansKristian-Work/vkd3d-proton";
35 description =
36 "A fork of VKD3D, which aims to implement the full Direct3D 12 API on top of Vulkan";
37 license = licenses.lgpl21;
38 maintainers = with maintainers; [ expipiplus1 ];
39 platforms = platforms.all;
40 };
41}