about summary refs log tree commit diff
path: root/pkgs/applications/video/gpu-screen-recorder/gpu-screen-recorder-gtk.nix
blob: b0c19e80a0be03a6130a34ae81e293f6913ba47c (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
{ stdenv
, lib
, fetchurl
, pkg-config
, desktop-file-utils
, makeWrapper
, meson
, ninja
, gtk3
, libayatana-appindicator
, libpulseaudio
, libdrm
, gpu-screen-recorder
, libglvnd
, libX11
, libXrandr
, wayland
, wrapGAppsHook3
, wrapperDir ? "/run/wrappers/bin"
}:

stdenv.mkDerivation {
  pname = "gpu-screen-recorder-gtk";
  version = "unstable-2024-07-05";

  # Snapshot tarballs use the following versioning format:
  # printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  src = fetchurl {
    url = "https://dec05eba.com/snapshot/gpu-screen-recorder-gtk.git.r311.c611c51.tar.gz";
    hash = "sha256-86EdmeZ2dlffSfJOrTVGPtYyL3j6DmCQIALX2rpeS1Y=";
  };
  sourceRoot = ".";

  nativeBuildInputs = [
    desktop-file-utils
    pkg-config
    makeWrapper
    meson
    ninja
    wrapGAppsHook3
  ];

  buildInputs = [
    gtk3
    libayatana-appindicator
    libpulseaudio
    libdrm
    libX11
    libXrandr
    wayland
  ];

  preFixup = let
    gpu-screen-recorder-wrapped = gpu-screen-recorder.override {
      inherit wrapperDir;
    };
  in ''
    gappsWrapperArgs+=(--prefix PATH : ${wrapperDir})
    gappsWrapperArgs+=(--suffix PATH : ${lib.makeBinPath [ gpu-screen-recorder-wrapped ]})
    # we also append /run/opengl-driver/lib as it otherwise fails to find libcuda.
    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd ]}:/run/opengl-driver/lib)
  '';

  meta = {
    description = "GTK frontend for gpu-screen-recorder.";
    mainProgram = "gpu-screen-recorder-gtk";
    homepage = "https://git.dec05eba.com/gpu-screen-recorder-gtk/about/";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ babbaj ];
    platforms = [ "x86_64-linux" ];
  };
}