-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
77 lines (61 loc) · 3.16 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Maintainer: VojtechStep <me at vojtechstep dot eu>
# Based on modified PKGBUILD by: Nocifer <apmichalopoulos at gmail dot com>
# Based on original PKGBUILD by: UTUMI Hirosi <utuhiro78 at yahoo dot co dot jp>
# Contributor: Felix Yan <[email protected]>
# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
## The UT dictionary's upstream url: 'http://linuxplayers.g1.xrea.com/mozc-ut.html'
## Helpful internal stuff
_commit=7329757e1ad30e327c1ae823a8302c79482d6b9c
_major=2
_minor=26
_build=4632
_revision=102
_mozcver=${_major}.${_minor}.${_build}.${_revision}
_utdicdate=20220112
_utuserlink=37
_utfilelink=37590
pkgname='mozc-ut-common-emacs'
pkgver=${_mozcver}.${_utdicdate}
pkgrel=1
pkgdesc='The Open Source edition of Google Japanese Input bundled with the UT dictionary'
arch=('x86_64')
url='https://github.com/google/mozc'
license=('custom')
depends=()
makedepends=('bazel' 'git' 'pkgconf' 'python-six')
conflicts=('mozc' 'mozc-ut' 'mozc-ut2' 'mozc-neologd-ut' 'mozc-neologd-ut+ut2' 'mozc-ut-unified' 'mozc-ut-united' 'mozc-ut-common')
provides=("mozc=${_mozcver}" "mozc-ut=${_mozcver}.${_utdicdate}")
source=("${pkgname}-git::git+https://github.com/google/mozc.git#commit=${_commit}"
"https://osdn.net/downloads/users/${_utuserlink}/${_utfilelink}/mozcdic-ut-${_utdicdate}.tar.bz2")
sha256sums=('SKIP'
'0d22419db25dcbf1bccb4595414fdc78bc3ebf7088e0f076de4a91553f3db94b')
prepare() {
cd ${pkgname}-git
git submodule update --init --recursive
# Add the UT dictionary
cat ${srcdir}/mozcdic-ut-${_utdicdate}/mozcdic-ut-${_utdicdate}.txt >> src/data/dictionary_oss/dictionary00.txt
}
build() {
cd ${pkgname}-git/src
# Remove references to Android dev tools
# For some reason, the build requires them even when building for non-android targets
sed -i -e 's/^android_[ns]dk_repository(name = "android[ns]dk")/# \0/' WORKSPACE.bazel
env PATH="/usr/lib/jvm/java-11-openjdk/bin/:$PATH" bazel build server:mozc_server unix/emacs:mozc_emacs_helper --config oss_linux --compilation_mode opt
}
package() {
install -Dm644 mozcdic-ut-${_utdicdate}/LICENSE ${pkgdir}/usr/share/licenses/mozc/ut-dictionary
cd ${pkgname}-git/src
install -Dm644 ../LICENSE ${pkgdir}/usr/share/licenses/mozc/mozc
install -Dm644 data/installer/credits_en.html ${pkgdir}/usr/share/licenses/mozc/mozc-submodules
install -Dm755 bazel-bin/unix/emacs/mozc_emacs_helper ${pkgdir}/usr/bin/mozc_emacs_helper
install -Dm755 bazel-bin/server/mozc_server ${pkgdir}/usr/lib/mozc/mozc_server
echo "Installing Emacs package"
install -Dm755 unix/emacs/mozc.el ${pkgdir}/usr/share/emacs/site-lisp/mozc/mozc.el
emacs --batch -f batch-byte-compile ${pkgdir}/usr/share/emacs/site-lisp/mozc/mozc.el
emacs --batch --eval="(progn \
(let ((backup-inhibited t) \
(version-control 'never)) \
(make-directory-autoloads \
\"${pkgdir}/usr/share/emacs/site-lisp/mozc/\" \
\"${pkgdir}/usr/share/emacs/site-lisp/mozc/mozc-autoloads.el\")))"
}