2017-08-19 17:16:11 +00:00
|
|
|
# Template file for 'mozc'
|
|
|
|
pkgname=mozc
|
2018-02-02 20:26:05 +00:00
|
|
|
version=2.23.2785.102
|
|
|
|
revision=1
|
|
|
|
hostmakedepends="ninja pkg-config protobuf-devel python"
|
2018-03-05 20:05:28 +00:00
|
|
|
makedepends="gtk+-devel ibus-devel libzinnia-devel protobuf-devel qt5-devel
|
|
|
|
fcitx-devel"
|
2017-08-19 17:16:11 +00:00
|
|
|
depends="tegaki-zinnia-japanese>=0.3"
|
|
|
|
maintainer="Matthias von Faber <mvf@gmx.eu>"
|
|
|
|
homepage="https://github.com/google/mozc"
|
|
|
|
license="3-clause-BSD"
|
|
|
|
short_desc="Japanese IME (Open Source version of Google Japanese Input)"
|
|
|
|
build_wrksrc="mozc/src"
|
|
|
|
create_wrksrc=yes
|
|
|
|
distfiles="
|
2018-02-02 20:26:05 +00:00
|
|
|
https://github.com/fcitx/mozc/archive/44820a08db487fb1abe996f3ac2876457b05465d.tar.gz
|
2017-08-19 17:16:11 +00:00
|
|
|
https://github.com/bnoordhuis/gyp/archive/4ec6c4e3a94bd04a6da2858163d40b2429b8aad1.tar.gz
|
|
|
|
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684.tar.gz
|
|
|
|
"
|
|
|
|
checksum="
|
2018-02-02 20:26:05 +00:00
|
|
|
a426856e617cdc8c95618cfd1d1884ad697ca3327bdc0a2d289a1d7a74170861
|
2017-08-19 17:16:11 +00:00
|
|
|
009992eae3393ba7b2d2ba6249dbb3ac44157313f10e8add4d3086aef772c04b
|
|
|
|
0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1
|
|
|
|
"
|
|
|
|
|
2018-02-02 20:26:05 +00:00
|
|
|
if [ -n "$CROSS_BUILD" ]; then
|
|
|
|
hostmakedepends+=" qt5-devel"
|
|
|
|
fi
|
2018-01-14 21:41:52 +00:00
|
|
|
|
2018-02-02 20:26:05 +00:00
|
|
|
post_extract() {
|
|
|
|
ln -s mozc-* mozc
|
2018-03-05 20:05:28 +00:00
|
|
|
rm -rf mozc/src/unix/fcitx5
|
2017-08-19 17:16:11 +00:00
|
|
|
|
|
|
|
# symlink "submodules" into place
|
|
|
|
for _src_dest in gyp japanese-usage-dictionary:japanese_usage_dictionary; do
|
|
|
|
_src=${_src_dest%:*}
|
|
|
|
_dst=mozc/src/third_party/${_src_dest#*:}
|
|
|
|
rmdir $_dst
|
|
|
|
ln -sr $_src-* $_dst
|
|
|
|
done
|
2018-03-05 20:05:28 +00:00
|
|
|
|
|
|
|
if [ -n "$CROSS_BUILD" ]; then
|
|
|
|
# find fcitx4-config
|
|
|
|
sed -i -e "s;fcitx4-config;${XBPS_CROSS_BASE}/usr/bin/fcitx4-config;" mozc/src/unix/fcitx/fcitx.gyp
|
|
|
|
fi
|
2017-08-19 17:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
do_configure() {
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
*-musl) sed -i -e 's|PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_RECURSIVE|g' base/mutex.cc ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
2018-02-02 20:26:05 +00:00
|
|
|
local targets
|
|
|
|
targets="
|
|
|
|
server/server.gyp:mozc_server
|
|
|
|
gui/gui.gyp:mozc_tool
|
|
|
|
unix/emacs/emacs.gyp:mozc_emacs_helper
|
|
|
|
unix/ibus/ibus.gyp:ibus_mozc
|
|
|
|
renderer/renderer.gyp:mozc_renderer
|
2018-03-05 20:05:28 +00:00
|
|
|
unix/fcitx/fcitx.gyp:fcitx-mozc
|
2018-02-02 20:26:05 +00:00
|
|
|
"
|
2017-08-19 17:16:11 +00:00
|
|
|
GYP_DEFINES="
|
|
|
|
document_dir=/usr/share/licenses/${pkgname}
|
|
|
|
use_libprotobuf=1
|
|
|
|
use_libzinnia=1
|
|
|
|
" python build_mozc.py gyp --target_platform=Linux
|
2018-02-02 20:26:05 +00:00
|
|
|
python build_mozc.py build -c Release $targets
|
2017-08-19 17:16:11 +00:00
|
|
|
|
|
|
|
sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g' out_linux/Release/gen/unix/ibus/mozc.xml
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
install -D -m 755 out_linux/Release/mozc_server "${PKGDESTDIR}/usr/lib/mozc/mozc_server"
|
|
|
|
install -m 755 out_linux/Release/mozc_tool "${PKGDESTDIR}/usr/lib/mozc/mozc_tool"
|
|
|
|
|
|
|
|
head -n 29 server/mozc_server.cc > LICENSE
|
|
|
|
for i in LICENSE data/installer/*.html; do
|
|
|
|
vlicense "$i"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
ibus-mozc_package() {
|
|
|
|
short_desc="Mozc engine for IBus - Client of the Mozc input method"
|
|
|
|
depends="${sourcepkg}-${version}_${revision} ibus>=1.5.14"
|
|
|
|
pkg_install() {
|
|
|
|
install -D -m 755 out_linux/Release/ibus_mozc "${PKGDESTDIR}/usr/lib/ibus-mozc/ibus-engine-mozc"
|
|
|
|
install -D -m 644 out_linux/Release/gen/unix/ibus/mozc.xml "${PKGDESTDIR}/usr/share/ibus/component/mozc.xml"
|
|
|
|
install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${PKGDESTDIR}/usr/share/ibus-mozc/product_icon.png"
|
|
|
|
for i in data/images/unix/ui-*.png; do
|
|
|
|
install -m 644 "$i" "${PKGDESTDIR}/usr/share/ibus-mozc/${i##*/ui-}"
|
|
|
|
done
|
|
|
|
install -D -m 755 out_linux/Release/mozc_renderer "${PKGDESTDIR}/usr/lib/mozc/mozc_renderer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
emacs-mozc_package() {
|
|
|
|
pkgdesc="Mozc for Emacs"
|
|
|
|
depends="${sourcepkg}-${version}_${revision} emacs"
|
|
|
|
pkg_install() {
|
|
|
|
install -D -m 755 out_linux/Release/mozc_emacs_helper "${PKGDESTDIR}/usr/bin/mozc_emacs_helper"
|
|
|
|
install -D -m 644 unix/emacs/mozc.el "${PKGDESTDIR}/usr/share/emacs/site-lisp/emacs-mozc/mozc.el"
|
|
|
|
}
|
|
|
|
}
|
2018-01-14 21:41:52 +00:00
|
|
|
|
|
|
|
fcitx-mozc_package() {
|
2018-02-02 20:26:05 +00:00
|
|
|
short_desc="Mozc engine for fcitx - Client of the Mozc input method"
|
2018-01-14 21:41:52 +00:00
|
|
|
depends="${sourcepkg}-${version}_${revision} fcitx>=4.2.9"
|
2018-02-02 20:26:05 +00:00
|
|
|
homepage="https://fcitx-im.org/"
|
|
|
|
license="GPL-2"
|
2018-01-14 21:41:52 +00:00
|
|
|
pkg_install() {
|
2018-02-02 20:26:05 +00:00
|
|
|
install -D -m 644 out_linux/Release/fcitx-mozc.so "${PKGDESTDIR}/usr/lib/fcitx/fcitx-mozc.so"
|
2018-01-14 21:41:52 +00:00
|
|
|
install -D -m 644 unix/fcitx/fcitx-mozc.conf "${PKGDESTDIR}/usr/share/fcitx/addon/fcitx-mozc.conf"
|
|
|
|
install -D -m 644 unix/fcitx/mozc.conf "${PKGDESTDIR}/usr/share/fcitx/inputmethod/mozc.conf"
|
|
|
|
}
|
|
|
|
}
|