about summary refs log tree commit diff
path: root/pkgs/tools/inputmethods/ibus-engines/ibus-uniemoji/default.nix
blob: 9ec45c65ee680d17df072ed235afaf8f5086da7c (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
{ lib, stdenv
, fetchFromGitHub
, gobject-introspection
, wrapGAppsHook3
, python3
, ibus
}:

let
  python = python3.withPackages (ps: with ps; [
    pygobject3
    (toPythonModule ibus)
    pyxdg
    levenshtein
  ]);
in stdenv.mkDerivation rec {
  pname = "ibus-uniemoji";
  version = "0.6.0";

  src = fetchFromGitHub {
    owner = "salty-horse";
    repo = "ibus-uniemoji";
    rev = "v${version}";
    sha256 = "121zh3q0li1k537fcvbd4ns4jgl9bbb9gm9ihy8cfxgirv38lcfa";
  };

  patches = [
    # Do not run wrapper script with Python,
    # the wrapped script will have Python in shebang anyway.
    ./allow-wrapping.patch
  ];


  nativeBuildInputs = [
    wrapGAppsHook3
    gobject-introspection
  ];

  buildInputs = [
    python
    ibus
  ];

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "SYSCONFDIR=${placeholder "out"}/etc"
    "PYTHON=${python.interpreter}"
  ];

  postFixup = ''
    wrapGApp $out/share/ibus-uniemoji/uniemoji.py
  '';

  meta = with lib; {
    isIbusEngine = true;
    description = "Input method (ibus) for entering unicode symbols and emoji by name";
    homepage = "https://github.com/salty-horse/ibus-uniemoji";
    license = with licenses; [ gpl3 mit ];
    platforms = platforms.linux;
    maintainers = with maintainers; [ aske ];
  };
}