about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/keepmenu/default.nix
blob: 1e6735d656166d73344d2629583619b78601f480 (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
{ lib, python3Packages, fetchFromGitHub, xvfb-run, xdotool, dmenu }:

python3Packages.buildPythonApplication rec {
  pname = "keepmenu";
  version = "1.4.0";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "firecat53";
    repo = "keepmenu";
    rev = version;
    hash = "sha256-3vFg+9Nw+NhuPJbrmBahXwa13wXlBg5IMYwJ+unn88k=";
  };

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

  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

  propagatedBuildInputs = with python3Packages; [
    pykeepass
    pynput
  ];

  nativeCheckInputs = [ xvfb-run xdotool dmenu ];

  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 = with lib; {
    homepage = "https://github.com/firecat53/keepmenu";
    description = "Dmenu/Rofi frontend for Keepass databases";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ elliot ];
    platforms = platforms.linux;
  };
}