summaryrefslogtreecommitdiff
path: root/pkgs/plover/plover.nix
blob: 17c106c01e63593ec598439f630f20870c75d429 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
  lib,
  config,
  stdenv,
  plover,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  versionCheckHook,
  appdirs,
  babel,
  evdev,
  mock,
  pyserial,
  pytestCheckHook,
  pytest-qt,
  plover-stroke,
  rtf-tokenize,
  setuptools,
  wcwidth,
  wheel,
  xlib,
  # Qt dependencies
  pyqt,
  wrapQtAppsHook,
}:

buildPythonPackage rec {
  pname = "plover";
  version = "4.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "openstenoproject";
    repo = "plover";
    tag = "v${version}";
    hash = "sha256-VpQT25bl8yPG4J9IwLkhSkBt31Y8BgPJdwa88WlreA8=";
  };

  postPatch = ''
    sed -i 's/,<77//g' pyproject.toml # pythonRelaxDepsHook doesn't work for this for some reason
  '';

  build-system = [
    babel
    setuptools
    pyqt
    wheel
  ];
  dependencies = [
    appdirs
    evdev
    pyqt
    pyserial
    plover-stroke
    rtf-tokenize
    setuptools
    wcwidth
    xlib
  ];
  nativeBuildInputs = [
    wrapQtAppsHook
  ];

  nativeCheckInputs = [
    pytestCheckHook
    versionCheckHook
    pytest-qt
    mock
  ];

  # Segfaults?!
  disabledTestPaths = [ "test/gui_qt/test_dictionaries_widget.py" ];

  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  dontWrapQtApps = true;

  pythonImportsCheck = [ "plover" ];

  meta = {
    description = "OpenSteno Plover stenography software";
    homepage = "https://www.openstenoproject.org/plover/";
    mainProgram = "plover";
    maintainers = with lib.maintainers; [
      twey
      kovirobi
      pandapip1
    ];
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
    broken = stdenv.hostPlatform.isDarwin;
  };
}