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