mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
0af05b343a
renamed checksums to kdeapps.sums added for all packages the pgp signature for new/removed packages check: https://community.kde.org/Applications/16.12_Release_Notes#Tarballs_that_we_have_split
255 lines
9.3 KiB
Bash
255 lines
9.3 KiB
Bash
# Maintainer: ponsfoot <cabezon dot hashimoto at gmail dot com>
|
|
|
|
#***********************************************************************
|
|
# License information:
|
|
#
|
|
# Mozc: 3-clause BSD
|
|
# uim-mozc: 3-clause BSD
|
|
#
|
|
# Mozc-UT dictionary
|
|
# altcanna, jinmei, skk: GPL
|
|
# hatena: unknown
|
|
# edict: Creative Commons Attribution-ShareAlike License (V3.0)
|
|
# ekimei: redistributable
|
|
# zip code: public domain
|
|
# niconico: unknown
|
|
# ruby/shell scripts: GPL
|
|
#
|
|
# ** CAUTION **
|
|
# CC-BY-SA (EDICT) is incompatible with GPL (some of the other dic data).
|
|
# You should not redistribute the binary of mozc-ut including edict
|
|
# (and niconico which unknown license) at least.
|
|
#
|
|
#***********************************************************************
|
|
# Upstreams:
|
|
#
|
|
# mozc
|
|
# http://code.google.com/p/mozc/
|
|
#
|
|
# Japanese zip code data by Japan Post
|
|
# http://www.post.japanpost.jp/zipcode/download.html
|
|
#
|
|
# Modified zip code data by Ibs
|
|
# http://zipcloud.ibsnet.co.jp/
|
|
#
|
|
# Mozc UT dictionary
|
|
# http://www.geocities.jp/ep3797/mozc_01.html
|
|
#
|
|
# uim-mozc by macuim
|
|
# http://code.google.com/p/macuim/
|
|
#
|
|
#***********************************************************************
|
|
# Changes to original mozc:
|
|
#
|
|
# 1. Add Mozc UT Dictionary
|
|
# 2. Add uim-mozc (optional)
|
|
#
|
|
#***********************************************************************
|
|
|
|
## Mozc compile option
|
|
_bldtype=Release
|
|
|
|
_mozcrev=5d0e6164f5e88248990fa9488eef42dc7f042c8b
|
|
_utdicver=20160905
|
|
_zipcoderel=201608
|
|
_uimmozcrev=321.3ea28b1
|
|
|
|
pkgbase=mozc
|
|
pkgname=('mozc' 'ibus-mozc' 'uim-mozc' 'emacs-mozc')
|
|
pkgver=2.18.2548.102.20160905
|
|
pkgrel=1
|
|
arch=('x86_64')
|
|
url="http://www.geocities.jp/ep3797/mozc_01.html"
|
|
license=('BSD' 'GPL' 'CC-BY-SA' 'custom')
|
|
makedepends=('python2' 'ruby' 'git' 'ninja' 'clang' 'ibus>=1.4.1' 'uim' 'qt')
|
|
source=(
|
|
mozc::git+https://github.com/google/mozc.git#commit=${_mozcrev}
|
|
http://downloads.sourceforge.net/project/pnsft-aur/mozc/mozcdic-ut-${_utdicver}.tar.bz2
|
|
http://downloads.sourceforge.net/project/pnsft-aur/mozc/edict-${_utdicver}.gz
|
|
EDICT_license.html
|
|
http://downloads.sourceforge.net/project/pnsft-aur/mozc/x-ken-all-${_zipcoderel}.zip
|
|
http://downloads.sourceforge.net/project/pnsft-aur/mozc/jigyosyo-${_zipcoderel}.zip
|
|
mod-generate-mozc-ut.sh
|
|
http://downloads.sourceforge.net/project/pnsft-aur/mozc/uim-mozc-${_uimmozcrev}.tar.xz
|
|
)
|
|
sha1sums=('SKIP'
|
|
'cb882107dcbf7451ae71bb29d91b1c12951d12eb'
|
|
'9f52caa8d87a893cbeb344660345fb2651f31d5a'
|
|
'e0ba18e67c1be8e3cfb8ecb30760597b215da255'
|
|
'a153bf7430f7054231ee4aacdf0b514839ac9ccb'
|
|
'e79ff28cf6581cb23b783b60cf38ddf540738302'
|
|
'66544a5b72988b3a8287cc59ff5a1e1a608673b9'
|
|
'22b7c2a5b0a7fef778ee72ebe5873a75e879d26b')
|
|
|
|
pkgver() {
|
|
. "${srcdir}/${pkgbase}/src/data/version/mozc_version_template.txt"
|
|
printf "%s.%s.%s.%s.%s" $MAJOR $MINOR $BUILD $REVISION $_utdicver
|
|
}
|
|
|
|
_mozcver=${pkgver%.$_utdicver}
|
|
|
|
prepare() {
|
|
cd "$srcdir"
|
|
|
|
ln -sf `which python2` ./python
|
|
PATH="${srcdir}:${PATH}"
|
|
|
|
cd "${srcdir}/mozc/"
|
|
|
|
git submodule update --init --recursive
|
|
|
|
# Generate zip code seed
|
|
msg "Generating zip code seed..."
|
|
python2 src/dictionary/gen_zip_code_seed.py \
|
|
--zip_code="${srcdir}/x-ken-all.csv" --jigyosyo="${srcdir}/JIGYOSYO.CSV" \
|
|
>> src/data/dictionary_oss/dictionary09.txt
|
|
msg "Done."
|
|
|
|
cd "${srcdir}/mozcdic-ut-${_utdicver}"
|
|
|
|
"${srcdir}/mod-generate-mozc-ut.sh"
|
|
msg "Generating UT dictionary seed..."
|
|
MOZCVER="$_mozcver" DICVER="$_utdicver" NICODIC="$_NICODIC" \
|
|
./generate-mozc-ut.sh
|
|
msg "Done."
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
|
|
# uim-mozc
|
|
cp -rf "${srcdir}/uim-mozc-${_uimmozcrev}/uim" unix/
|
|
# kill-line patch
|
|
patch -p0 -i "${srcdir}/uim-mozc-${_uimmozcrev}/mozc-kill-line.diff"
|
|
# Extract license part of uim-mozc
|
|
head -n 32 unix/uim/mozc.cc > unix/uim/LICENSE
|
|
}
|
|
|
|
build() {
|
|
msg2 '====================================================='
|
|
msg2 ' *** Build Info ***'
|
|
msg2 ' The following package files will be generated:'
|
|
for _p in ${pkgname[@]}
|
|
do
|
|
msg2 " * ${_p}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
|
|
done
|
|
msg2 '====================================================='
|
|
|
|
# Use Qt4
|
|
_rcc_loc=`pkg-config QtCore --variable=rcc_location`
|
|
_qt4dir=${_rcc_loc%%/bin/rcc}
|
|
_qt4i=`pkg-config --cflags-only-I QtGui`
|
|
CFLAGS+=" $_qt4i"
|
|
CXXFLAGS+=" $_qt4i"
|
|
|
|
msg "Starting make..."
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
|
|
_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 \
|
|
unix/uim/uim.gyp:uim-mozc "
|
|
|
|
unset CC CC_host CC_target CXX CXX_host CXX_target LINK AR AR_host AR_target \
|
|
NM NM_host NM_target READELF READELF_host READELF_target
|
|
QTDIR=$_qt4dir GYP_DEFINES="document_dir=/usr/share/licenses/${pkgbase}" \
|
|
python2 build_mozc.py gyp
|
|
python2 build_mozc.py build -c $_bldtype $_targets
|
|
|
|
sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g' \
|
|
out_linux/${_bldtype}/gen/unix/ibus/mozc.xml
|
|
}
|
|
|
|
package_mozc() {
|
|
pkgdesc="Mozc the Japanese Input Method with Mozc UT Dictionary"
|
|
arch=('x86_64')
|
|
groups=('mozc-im')
|
|
depends=('qt' 'zinnia')
|
|
install=mozc.install
|
|
provides=("mozc-ut=${pkgver}")
|
|
replaces=('mozc-ut' 'mozc-utils-gui-ut')
|
|
conflicts=('mozc-ut')
|
|
optdepends=('tegaki-models-zinnia-japanese: hand-writing recognition support')
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
install -D -m 755 out_linux/${_bldtype}/mozc_server "${pkgdir}/usr/lib/mozc/mozc_server"
|
|
install -m 755 out_linux/${_bldtype}/mozc_tool "${pkgdir}/usr/lib/mozc/mozc_tool"
|
|
|
|
install -d "${pkgdir}/usr/lib/mozc/documents/"
|
|
install -m 644 data/installer/*.html "${pkgdir}/usr/lib/mozc/documents/"
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}"
|
|
_licpath="${pkgdir}/usr/share/licenses/${pkgbase}"
|
|
install -D -m 644 LICENSE "${_licpath}/LICENSE_MOZC"
|
|
install -m 644 docs-ut/README "${_licpath}/README_MOZC-UT"
|
|
install -m 644 src/data/installer/*.html "$_licpath"
|
|
|
|
cd docs-ut/dictionaries
|
|
for d in *
|
|
do
|
|
install -d "${_licpath}/dictionaries/${d}"
|
|
install -m 644 "${d}"/* "${_licpath}/dictionaries/${d}"
|
|
done
|
|
install -m 644 "${srcdir}/EDICT_license.html" "${_licpath}/dictionaries/edict/license.html"
|
|
}
|
|
|
|
package_emacs-mozc() {
|
|
pkgdesc="Mozc for Emacs"
|
|
arch=('x86_64')
|
|
groups=('mozc-im')
|
|
depends=("mozc=${pkgver}" 'emacs')
|
|
install=emacs-mozc.install
|
|
provides=('emacs-mozc-ut')
|
|
conflicts=('emacs-mozc-ut')
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
install -D -m 755 out_linux/${_bldtype}/mozc_emacs_helper "${pkgdir}/usr/bin/mozc_emacs_helper"
|
|
install -d "${pkgdir}/usr/share/emacs/site-lisp/emacs-mozc/"
|
|
install -m 644 unix/emacs/mozc.el "${pkgdir}/usr/share/emacs/site-lisp/emacs-mozc"
|
|
}
|
|
|
|
package_ibus-mozc() {
|
|
pkgdesc="IBus engine module for Mozc"
|
|
arch=('x86_64')
|
|
groups=('mozc-im')
|
|
depends=("mozc=${pkgver}" 'ibus>=1.4.1')
|
|
provides=('ibus-mozc-ut')
|
|
conflicts=('ibus-mozc-ut')
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
install -D -m 755 out_linux/${_bldtype}/ibus_mozc "${pkgdir}/usr/lib/ibus-mozc/ibus-engine-mozc"
|
|
install -D -m 644 out_linux/${_bldtype}/gen/unix/ibus/mozc.xml "${pkgdir}/usr/share/ibus/component/mozc.xml"
|
|
install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}/usr/share/ibus-mozc/product_icon.png"
|
|
install -m 644 data/images/unix/ui-tool.png "${pkgdir}/usr/share/ibus-mozc/tool.png"
|
|
install -m 644 data/images/unix/ui-properties.png "${pkgdir}/usr/share/ibus-mozc/properties.png"
|
|
install -m 644 data/images/unix/ui-dictionary.png "${pkgdir}/usr/share/ibus-mozc/dictionary.png"
|
|
install -m 644 data/images/unix/ui-direct.png "${pkgdir}/usr/share/ibus-mozc/direct.png"
|
|
install -m 644 data/images/unix/ui-hiragana.png "${pkgdir}/usr/share/ibus-mozc/hiragana.png"
|
|
install -m 644 data/images/unix/ui-katakana_half.png "${pkgdir}/usr/share/ibus-mozc/katakana_half.png"
|
|
install -m 644 data/images/unix/ui-katakana_full.png "${pkgdir}/usr/share/ibus-mozc/katakana_full.png"
|
|
install -m 644 data/images/unix/ui-alpha_half.png "${pkgdir}/usr/share/ibus-mozc/alpha_half.png"
|
|
install -m 644 data/images/unix/ui-alpha_full.png "${pkgdir}/usr/share/ibus-mozc/alpha_full.png"
|
|
|
|
install -D -m 755 out_linux/${_bldtype}/mozc_renderer "${pkgdir}/usr/lib/mozc/mozc_renderer"
|
|
}
|
|
|
|
package_uim-mozc() {
|
|
pkgdesc="Mozc plugin module for uim"
|
|
arch=('x86_64')
|
|
groups=('mozc-im')
|
|
depends=("mozc=${pkgver}" 'uim')
|
|
install=uim-mozc.install
|
|
provides=('uim-mozc-ut')
|
|
conflicts=('uim-mozc-ut')
|
|
|
|
cd "${srcdir}/${pkgbase}-ut-${pkgver}/src"
|
|
install -D -m 755 out_linux/${_bldtype}/libuim-mozc.so "${pkgdir}/usr/lib/uim/plugin/libuim-mozc.so"
|
|
install -d "${pkgdir}/usr/share/uim"
|
|
install -m 644 ${srcdir}/uim-mozc-${_uimmozcrev}/scm/*.scm "${pkgdir}/usr/share/uim/"
|
|
install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}/usr/share/uim/pixmaps/mozc.png"
|
|
install -m 644 data/images/unix/ui-tool.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_selector.png"
|
|
install -m 644 data/images/unix/ui-properties.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_config_dialog.png"
|
|
install -m 644 data/images/unix/ui-dictionary.png "${pkgdir}/usr/share/uim/pixmaps/mozc_tool_dictionary_tool.png"
|
|
|
|
install -D -m 644 unix/uim/LICENSE "${pkgdir}/usr/share/licenses/${pkgbase}/uim-mozc/LICENSE"
|
|
}
|