about summary refs log tree commit diff
path: root/pkgs/applications/misc/gpu-viewer/default.nix
blob: 329babc36c686faa07e1398e1577d9d9242e297d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{ lib
, fetchFromGitHub
, pkg-config
, meson
, ninja
, gtk4
, libadwaita
, python3Packages
, gobject-introspection
, vulkan-tools
, python3
, wrapGAppsHook4
, gdk-pixbuf
, lsb-release
, glxinfo
, vdpauinfo
, clinfo
}:

python3.pkgs.buildPythonApplication rec {
  pname = "gpu-viewer";
  version = "3.04";

  format = "other";

  src = fetchFromGitHub {
    owner = "arunsivaramanneo";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-+FDBHSVBTUHnhu2n7i9W1zIZe2wjY+OuFwQOJZojuzs=";
  };

  nativeBuildInputs = [
    pkg-config
    meson
    ninja
    gobject-introspection
    wrapGAppsHook4
  ];

  buildInputs = [
    gtk4
    libadwaita
    vulkan-tools
    gdk-pixbuf
  ];

  pythonPath = with python3Packages; [
    pygobject3
    click
  ];

  # Prevent double wrapping
  dontWrapGApps = true;

  postFixup = ''
    makeWrapper ${python3.interpreter} $out/bin/gpu-viewer \
      --prefix PATH : "${lib.makeBinPath [ clinfo glxinfo lsb-release vdpauinfo vulkan-tools ]}" \
      --add-flags "$out/share/gpu-viewer/Files/GPUViewer.py" \
      --prefix PYTHONPATH : "$PYTHONPATH" \
      --chdir "$out/share/gpu-viewer/Files" \
      ''${makeWrapperArgs[@]} \
      ''${gappsWrapperArgs[@]}
  '';


  meta = with lib; {
    homepage = "https://github.com/arunsivaramanneo/GPU-Viewer";
    description = "A front-end to glxinfo, vulkaninfo, clinfo and es2_info";
    changelog = "https://github.com/arunsivaramanneo/GPU-Viewer/releases/tag/v${version}";
    maintainers = with maintainers; [ GaetanLepage ];
    license = licenses.gpl3;
    platforms = platforms.linux;
    mainProgram = "gpu-viewer";
  };
}