summary refs log tree commit diff
path: root/pkgs/tools/inputmethods/ibus-engines/ibus-rime/default.nix
blob: af3fcbe4e2cccdb03b68a957357ac7e5c80a2f05 (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
{ lib
, stdenv
, fetchFromGitHub
, cmake
, gdk-pixbuf
, glib
, ibus
, libnotify
, librime
, pkg-config
, rime-data
}:

stdenv.mkDerivation rec {
  pname = "ibus-rime";
  version = "1.5.0";

  src = fetchFromGitHub {
    owner = "rime";
    repo = "ibus-rime";
    rev = version;
    sha256 = "0gdxg6ia0i31jn3cvh1nrsjga1j31hf8a2zfgg8rzn25chrfr319";
  };

  buildInputs = [ gdk-pixbuf glib ibus libnotify librime rime-data ];
  nativeBuildInputs = [ cmake pkg-config ];

  cmakeFlags = [ "-DRIME_DATA_DIR=${rime-data}/share/rime-data" ];

  prePatch = ''
    substituteInPlace CMakeLists.txt \
       --replace 'DESTINATION "''${RIME_DATA_DIR}"' \
                 'DESTINATION "''${CMAKE_INSTALL_DATADIR}/rime-data"'
  '';

  meta = with lib; {
    isIbusEngine = true;
    description = "Rime input method engine for IBus";
    homepage = "https://rime.im/";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ pengmeiyu ];
  };
}