1DESCRIPTION = "A multilingual user input method library"
2HOMEPAGE = "http://uim.freedesktop.org/"
3LICENSE = "BSD-3-Clause & LGPL-2.0-or-later"
4LIC_FILES_CHKSUM = "file://COPYING;md5=ab2826b41ca0ff4030d38cc39791d1c8"
5SECTION = "inputmethods"
6
7SRC_URI = "https://github.com/uim/uim/releases/download/${PV}/uim-${PV}.tar.bz2"
8SRC_URI:append:class-target = "\
9    file://uim-module-manager.patch \
10"
11SRC_URI[sha256sum] = "dbbd983768bf748449551644f330dbebe859bfeb6f024fea6697ac75131c7aa4"
12
13UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
14UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
15
16DEPENDS = "anthy fontconfig libxft libxt glib-2.0 ncurses intltool libedit"
17DEPENDS:append:class-target = " intltool-native gtk+ gtk+3 uim-native"
18
19RDEPENDS:uim = "libuim0 libedit"
20RDEPENDS:uim-anthy = "anthy libanthy0"
21RDEPENDS:uim-anthy:append:libc-glibc = " glibc-utils glibc-gconv-euc-jp"
22
23LEAD_SONAME = "libuim.so.1"
24
25COMPATIBLE_HOST:riscv64 = "null"
26COMPATIBLE_HOST:riscv32 = "null"
27
28inherit features_check autotools pkgconfig gettext qemu gtk-immodules-cache
29
30REQUIRED_DISTRO_FEATURES = "x11"
31
32GTKIMMODULES_PACKAGES = "uim-gtk2.0 uim-gtk3"
33
34EXTRA_OECONF += "--disable-emacs \
35    --with-libedit=${STAGING_EXECPREFIXDIR} \
36    --without-scim \
37    --without-m17nlib \
38    --without-prime \
39    --without-canna \
40    --without-mana \
41    --without-eb \
42"
43
44CONFIGUREOPTS:remove:class-target = "--disable-silent-rules"
45
46# https://github.com/uim/uim/issues/44
47PARALLEL_MAKE = ""
48
49#Because m4 file's find maxdepth=2, so copy the m4 files of the deep depth.
50do_configure:prepend () {
51    rm -rf ${S}/m4.generated/lt*.m4 ${S}/m4.generated/libtool.m4
52    rm -rf ${S}/sigscheme/libgcroots/m4/lt*.m4 ${S}/sigscheme/libgcroots/m4/libtool.m4
53    rm -rf ${S}/sigscheme/m4/lt*.m4 ${S}/sigscheme/m4/libtool.m4
54    cp ${S}/sigscheme/m4/* ${S}/m4/
55}
56
57do_install:append() {
58    rm -rf ${D}/${datadir}/applications
59}
60
61PACKAGES =+ "uim-xim uim-utils uim-skk uim-gtk2.0 uim-gtk3 uim-fep uim-anthy uim-common libuim0 libuim-dev"
62
63FILES:${PN} = "${bindir}/uim-help \
64    ${libdir}/uim/plugin/libuim-* \
65    ${libdir}/libuim-scm* \
66    ${libdir}/libgcroots* \
67    ${libdir}/uim/plugin/libuim-* \
68"
69
70FILES:libuim0 = "${libdir}/uim/plugin/libuim-custom-enabler.* \
71    ${libdir}/libuim-custom.so.* \
72    ${datadir}/locale/ja/LC_MESSAGES/uim.mo \
73    ${datadir}/locale/fr/LC_MESSAGES/uim.mo \
74    ${datadir}/locale/ko/LC_MESSAGES/uim.mo \
75    ${libdir}/libuim.so.* \
76"
77FILES:libuim-dev = "${libdir}/libuim*.a \
78    ${libdir}/libuim*.la \
79    ${libdir}/libuim*.so \
80    ${includedir}/uim \
81    ${libdir}/pkgconfig/uim.pc \
82"
83FILES:uim-anthy = "${libdir}/uim/plugin/libuim-anthy.* \
84    ${datadir}/uim/anthy*.scm \
85"
86FILES:${PN}-dbg += "${libdir}/*/*/*/.debug ${libdir}/*/*/.debug"
87FILES:${PN}-dev += "${libdir}/uim/plugin/*.la"
88
89FILES:uim-utils = "${bindir}/uim-sh \
90    ${bindir}/uim-module-manager \
91    ${libexecdir}/uim-helper-server \
92"
93FILES:uim-xim = "${bindir}/uim-xim \
94    ${libexecdir}/uim-candwin-*gtk \
95    ${libexecdir}/uim-candwin-*gtk3 \
96    ${datadir}/man/man1/uim-xim.1 \
97    ${sysconfdir}/X11/xinit/xinput.d/uim* \
98"
99FILES:uim-common = "${datadir}/uim/pixmaps/*.png \
100    ${datadir}/uim \
101"
102FILES:uim-fep = "${bindir}/uim-fep*"
103
104FILES:uim-gtk2.0 = "${libdir}/gtk-2.0 \
105    ${bindir}/uim-toolbar-gtk \
106    ${bindir}/uim-toolbar-gtk-systray \
107    ${bindir}/uim-*-gtk \
108    ${bindir}/uim-input-pad-ja \
109    ${libdir}/uim/uim-*-gtk \
110"
111FILES:uim-gtk3 = "${libdir}/gtk-3.0 \
112    ${bindir}/uim-toolbar-gtk3 \
113    ${bindir}/uim-toolbar-gtk3-systray \
114    ${bindir}/uim-*-gtk3 \
115    ${libdir}/uim/uim-*-gtk3 \
116"
117FILES:uim-skk = "${libdir}/uim/plugin/libuim-skk.* \
118    ${datadir}/uim/skk*.scm \
119"
120
121PACKAGE_WRITE_DEPS += "qemu-native"
122pkg_postinst:uim-anthy() {
123    if test -n "$D"; then
124        ${@qemu_run_binary(d, '$D', '${bindir}/uim-module-manager')} --register anthy --path $D${datadir}/uim
125    else
126		uim-module-manager --register anthy --path ${datadir}/uim
127    fi
128}
129
130pkg_prerm:uim-anthy() {
131    if test -n "$D"; then
132        ${@qemu_run_binary(d, '$D', '${bindir}/uim-module-manager')} --path $D${datadir}/uim --unregister anthy
133    else
134		uim-module-manager --path ${datadir}/uim --unregister anthy
135    fi
136}
137
138pkg_postinst:uim-skk() {
139    if test -n "$D"; then
140        ${@qemu_run_binary(d, '$D', '${bindir}/uim-module-manager')} --register skk --path $D${datadir}/uim
141    else
142		uim-module-manager --register skk --path ${datadir}/uim
143    fi
144}
145
146pkg_postrm:uim-skk() {
147    if test -n "$D"; then
148        ${@qemu_run_binary(d, '$D', '${bindir}/uim-module-manager')} --path $D${datadir}/uim --unregister skk
149    else
150		uim-module-manager --path ${datadir}/uim --unregister skk
151    fi
152}
153
154BBCLASSEXTEND = "native"
155