1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 qmake,
6 vulkan-loader,
7 wayland,
8 wrapQtAppsHook,
9 x11Support ? true,
10 qtx11extras,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "vulkan-caps-viewer";
15 version = "4.02";
16
17 src = fetchFromGitHub {
18 owner = "SaschaWillems";
19 repo = "VulkanCapsViewer";
20 rev = version;
21 hash = "sha256-89W/1E9IJaPUzeki0vegXzprGFAFIgb1mRx0OMC4+ec=";
22 # Note: this derivation strictly requires vulkan-header to be the same it was developed against.
23 # To help us, they've put it in a git-submodule.
24 # The result will work with any vulkan-loader version.
25 fetchSubmodules = true;
26 };
27
28 nativeBuildInputs = [
29 qmake
30 wrapQtAppsHook
31 ];
32
33 buildInputs = [
34 vulkan-loader
35 wayland
36 ]
37 ++ lib.lists.optionals x11Support [ qtx11extras ];
38
39 patchPhase = ''
40 substituteInPlace vulkanCapsViewer.pro \
41 --replace '/usr/' "/"
42 '';
43
44 qmakeFlags = [
45 "CONFIG+=release"
46 ];
47
48 installFlags = [ "INSTALL_ROOT=$(out)" ];
49
50 meta = with lib; {
51 mainProgram = "vulkanCapsViewer";
52 description = "Vulkan hardware capability viewer";
53 longDescription = ''
54 Client application to display hardware implementation details for GPUs supporting the Vulkan API by Khronos.
55 The hardware reports can be submitted to a public online database that allows comparing different devices, browsing available features, extensions, formats, etc.
56 '';
57 homepage = "https://vulkan.gpuinfo.org/";
58 platforms = platforms.unix;
59 license = licenses.gpl2Only;
60 maintainers = with maintainers; [ pedrohlc ];
61 changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${version}";
62 # never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
63 broken = stdenv.hostPlatform.isDarwin;
64 };
65}