1{ fetchFromGitHub
2, freetype
3, gtk3
4, lib
5, meson
6, ninja
7, pkg-config
8, SDL2
9, stdenv
10, wrapGAppsHook3
11}:
12
13stdenv.mkDerivation rec {
14 pname = "gpuvis";
15 version = "0.1";
16
17 src = fetchFromGitHub {
18 owner = "mikesart";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-a9eAYDsiwyzZc4FAPo0wANysisIT4qCHLh2PrYswJtw=";
22 };
23
24 # patch dlopen path for gtk3
25 postPatch = ''
26 substituteInPlace src/hook_gtk3.h \
27 --replace "libgtk-3.so" "${lib.getLib gtk3}/lib/libgtk-3.so"
28 '';
29
30 nativeBuildInputs = [ pkg-config meson ninja wrapGAppsHook3 ];
31
32 buildInputs = [ SDL2 gtk3 freetype ];
33
34 CXXFLAGS = [
35 # GCC 13: error: 'uint32_t' has not been declared
36 "-include cstdint"
37 ];
38
39 meta = with lib; {
40 description = "GPU Trace Visualizer";
41 mainProgram = "gpuvis";
42 homepage = "https://github.com/mikesart/gpuvis";
43 license = licenses.mit;
44 maintainers = with maintainers; [ emantor ];
45 platforms = platforms.linux;
46 };
47}