summary refs log tree commit diff
path: root/pkgs/applications/video/screenkey/default.nix
blob: 83ebf1db9b4e0550babc6393a2213cdb47f13730 (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
{ lib
, fetchFromGitLab
, wrapGAppsHook
, xorg
, gobject-introspection
, gtk3
, libappindicator-gtk3
, slop
, python3
}:

python3.pkgs.buildPythonApplication rec {
  pname = "screenkey";
  version = "1.5";

  src = fetchFromGitLab {
    owner = pname;
    repo = pname;
    rev = "v${version}";
    hash = "sha256-kWktKzRyWHGd1lmdKhPwrJoSzAIN2E5TKyg30uhM4Ug=";
  };

  nativeBuildInputs = [
    wrapGAppsHook
    # for setup hook
    gobject-introspection
  ];

  buildInputs = [
    gtk3
    libappindicator-gtk3
  ];

  propagatedBuildInputs = with python3.pkgs; [
    babel
    pycairo
    pygobject3
    dbus-python
  ];

  # Prevent double wrapping because of wrapGAppsHook
  dontWrapGApps = true;

  preFixup = ''
    makeWrapperArgs+=(
      --prefix PATH ":" "${lib.makeBinPath [ slop ]}"
      "''${gappsWrapperArgs[@]}"
      )
  '';

  # screenkey does not have any tests
  doCheck = false;

  # Fix CDLL python calls for non absolute paths of xorg libraries
  postPatch = ''
    substituteInPlace Screenkey/xlib.py \
      --replace libX11.so.6 ${lib.getLib xorg.libX11}/lib/libX11.so.6 \
      --replace libXtst.so.6 ${lib.getLib xorg.libXtst}/lib/libXtst.so.6
  '';

  meta = with lib; {
    homepage = "https://www.thregr.org/~wavexx/software/screenkey/";
    description = "A screencast tool to display your keys inspired by Screenflick";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = [ maintainers.rasendubi ];
  };
}