about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/wordbook/default.nix
blob: 757fed5265f2eea23b8720c40969235c4c4ac6c8 (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
69
{ lib
, fetchFromGitHub
, python3
, meson
, ninja
, pkg-config
, glib
, gtk4
, libadwaita
, librsvg
, espeak-ng
, gobject-introspection
, wrapGAppsHook4
, appstream-glib
, desktop-file-utils
}:

python3.pkgs.buildPythonApplication rec {
  pname = "wordbook";
  version = "unstable-2022-11-02";
  format = "other";

  src = fetchFromGitHub {
    owner = "fushinari";
    repo = "Wordbook";
    rev = "2d79e9e9ef21ba4b54d0b46c764a1481a06f0f1b";
    hash = "sha256-ktusZEQ7m8P0kiH09r3XC6q9bQCWVCn543IMLKmULDo=";
  };

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    wrapGAppsHook4
    appstream-glib
    desktop-file-utils
    gobject-introspection
  ];

  buildInputs = [
    glib
    gtk4
    librsvg
    libadwaita
  ];

  propagatedBuildInputs = with python3.pkgs; [
    pygobject3
    wn
  ];

  # prevent double wrapping
  dontWrapGApps = true;

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

  meta = with lib; {
    description = "Offline English-English dictionary application built for GNOME";
    homepage = "https://github.com/fushinari/Wordbook";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ zendo ];
  };
}