summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ke/keepmenu/package.nix
blob: 9468e009466eee6199a4a962c9263909551b27c3 (plain)
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
{
  dmenu,
  fetchFromGitHub,
  lib,
  python3Packages,
  xdotool,
  xsel,
  xvfb-run,
}:

python3Packages.buildPythonApplication (finalAttrs: {
  pname = "keepmenu";
  version = "1.5.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "firecat53";
    repo = "keepmenu";
    rev = finalAttrs.version;
    hash = "sha256-MUtwQ9V5PcczR2mISMs8EcFGkDAPmuYSvNW+COC4Bhw=";
  };

  nativeBuildInputs = with python3Packages; [
    hatchling
    hatch-vcs
  ];

  propagatedBuildInputs = with python3Packages; [
    pykeepass
    pynput
  ];

  nativeCheckInputs = [
    dmenu
    xdotool
    xsel
    xvfb-run
  ];

  postPatch = ''
    substituteInPlace tests/keepmenu-config.ini tests/tests.py \
      --replace "/usr/bin/dmenu" "dmenu"
  '';

  checkPhase = ''
    runHook preCheck

    xvfb-run python tests/tests.py

    runHook postCheck
  '';

  pythonImportsCheck = [ "keepmenu" ];

  meta = {
    homepage = "https://github.com/firecat53/keepmenu";
    description = "Dmenu/Rofi frontend for Keepass databases";
    mainProgram = "keepmenu";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ elliot ];
    platforms = lib.platforms.linux;
  };
})