summary refs log tree commit diff
path: root/pkgs/misc/flashfocus/default.nix
blob: b74464de4f6806088877cb36339dd3127892d97d (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
{ lib, python3, netcat-openbsd }:

python3.pkgs.buildPythonApplication rec {
  pname = "flashfocus";
  version = "2.2.3";

  src = python3.pkgs.fetchPypi {
    inherit pname version;
    sha256 = "0cn44hryvz2wl7xklaslxsb3l2i3f8jkgmml0n9v2ks22j5l4r4h";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "pyyaml>=5.1,<6.0" "pyyaml>=5.1"

    substituteInPlace bin/nc_flash_window \
      --replace "nc" "${lib.getExe netcat-openbsd}"
  '';

  nativeBuildInputs = with python3.pkgs; [
    pytest-runner
  ];

  propagatedBuildInputs = with python3.pkgs; [
    i3ipc
    xcffib
    click
    cffi
    xpybutil
    marshmallow
    pyyaml
  ];

  # Tests require access to a X session
  doCheck = false;

  pythonImportsCheck = [ "flashfocus" ];

  meta = with lib; {
    homepage = "https://github.com/fennerm/flashfocus";
    description = "Simple focus animations for tiling window managers";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ artturin ];
  };
}