1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 docbook2x,
7 pkg-config,
8 gtk3,
9 dconf,
10 gobject-introspection,
11 ibus,
12 python3,
13 wrapGAppsHook3,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "ibus-table";
18 version = "1.17.14";
19
20 src = fetchFromGitHub {
21 owner = "kaio";
22 repo = "ibus-table";
23 rev = version;
24 sha256 = "sha256-BPFKxJqc/p+lzUk7MHEY2j7IL6AVC/xpo5BG5YaR3vY=";
25 };
26
27 postPatch = ''
28 # Data paths will be set at run-time.
29 sed -e "/export IBUS_TABLE_LIB_LOCATION=/ s/^.*$//" \
30 -e "/export IBUS_TABLE_LOCATION=/ s/^.*$//" \
31 -i "engine/ibus-engine-table.in"
32 sed -e "/export IBUS_TABLE_BIN_PATH=/ s/^.*$//" \
33 -e "/export IBUS_TABLE_DATA_DIR=/ s/^.*$//" \
34 -i "engine/ibus-table-createdb.in"
35 sed -e "/export IBUS_PREFIX=/ s/^.*$//" \
36 -e "/export IBUS_DATAROOTDIR=/ s/^.$//" \
37 -e "/export IBUS_LOCALEDIR=/ s/^.$//" \
38 -i "setup/ibus-setup-table.in"
39 substituteInPlace engine/tabcreatedb.py --replace '/usr/share/ibus-table' $out/share/ibus-table
40 substituteInPlace engine/ibus_table_location.py \
41 --replace '/usr/libexec' $out/libexec \
42 --replace '/usr/share/ibus-table/' $out/share/ibus-table/
43 '';
44
45 buildInputs = [
46 dconf
47 gtk3
48 ibus
49 (python3.withPackages (
50 pypkgs: with pypkgs; [
51 dbus-python
52 pygobject3
53 (toPythonModule ibus)
54 ]
55 ))
56 ];
57
58 nativeBuildInputs = [
59 autoreconfHook
60 docbook2x
61 pkg-config
62 gobject-introspection
63 wrapGAppsHook3
64 ];
65
66 postUnpack = ''
67 substituteInPlace $sourceRoot/engine/Makefile.am \
68 --replace "docbook2man" "docbook2man --sgml"
69 '';
70
71 meta = with lib; {
72 isIbusEngine = true;
73 description = "IBus framework for table-based input methods";
74 mainProgram = "ibus-table-createdb";
75 homepage = "https://github.com/kaio/ibus-table/wiki";
76 license = licenses.lgpl21;
77 platforms = platforms.linux;
78 maintainers = with maintainers; [ mudri ];
79 };
80}