1{ lib
2, stdenv
3, fetchurl
4, fetchFromGitHub
5, cmake
6, extra-cmake-modules
7, boost
8, python3
9, fcitx5
10}:
11
12let
13 table = fetchurl {
14 url = "https://download.fcitx-im.org/data/table.tar.gz";
15 sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
16 };
17 arpaVer = "20230712";
18 arpa = fetchurl {
19 url = "https://download.fcitx-im.org/data/lm_sc.arpa-${arpaVer}.tar.xz";
20 hash = "sha256-ut1iwWxjc3h6D9qPCc1FLRL2DVhohW9lHO7PGge6ujI=";
21 };
22 dictVer = "20230412";
23 dict = fetchurl {
24 url = "https://download.fcitx-im.org/data/dict-${dictVer}.tar.xz";
25 hash = "sha256-8F/Mr/loeQCqw9mtWoGyCIi1cyAUA/vNm7x5B9npdQc=";
26 };
27in
28stdenv.mkDerivation rec {
29 pname = "libime";
30 version = "1.1.0";
31
32 src = fetchFromGitHub {
33 owner = "fcitx";
34 repo = "libime";
35 rev = version;
36 sha256 = "sha256-r1Px93Ly7FzcRaPUNTHNcedzHPHocnUj8t8VMZqXkFM=";
37 fetchSubmodules = true;
38 };
39
40 prePatch = ''
41 ln -s ${table} data/$(stripHash ${table})
42 ln -s ${arpa} data/$(stripHash ${arpa})
43 ln -s ${dict} data/$(stripHash ${dict})
44 '';
45
46 nativeBuildInputs = [
47 cmake
48 extra-cmake-modules
49 python3
50 ];
51
52 buildInputs = [
53 boost
54 fcitx5
55 ];
56
57 meta = with lib; {
58 description = "A library to support generic input method implementation";
59 homepage = "https://github.com/fcitx/libime";
60 license = licenses.lgpl21Plus;
61 maintainers = with maintainers; [ poscat ];
62 platforms = platforms.linux;
63 };
64}