summaryrefslogtreecommitdiff
blob: 6e93fa9e0178c639a9a50ee6840be0f40c54c31d (plain)
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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="6"
USE_RUBY="ruby24 ruby25 ruby26"
NEED_EMACS="24"

inherit elisp ruby-single

DESCRIPTION="One Japanese input methods on Emacs"
HOMEPAGE="http://openlab.ring.gr.jp/skk/"
SRC_URI="http://openlab.ring.gr.jp/skk/maintrunk/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
IUSE="ruby"
RESTRICT="test"

DEPEND=""
RDEPEND="|| (
		app-i18n/skk-jisyo
		virtual/skkserv
	)
	ruby? ( ${RUBY_DEPS} )"

SITEFILE="50${PN}-gentoo.el"

src_prepare() {
	echo "(setq PREFIX \"${ED}/usr\")" >>SKK-CFG
	echo "(setq SKK_LISPDIR \"${ED}/${SITELISP}/${PN}\")" >>SKK-CFG

	echo "(add-to-list 'load-path (expand-file-name \"..\"))" >> nicola/NICOLA-DDSKK-CFG

	default

	rm -f skk-lookup.el
	if use ruby; then
		cp bayesian/*.el . || die
	fi
	cp tut-code/*.el . || die
}

src_compile() {
	emake elc info

	emake -C nicola
}

src_install() {
	local lispdir=${SITELISP}/${PN}
	emake install-elc
	elisp-compile "${ED}"/${lispdir}/skk-setup.el
	rm -f "${ED}"/${lispdir}/leim-list.el
	elisp-site-file-install "${FILESDIR}"/${SITEFILE}

	dodoc ChangeLog* README.md READMEs/{AUTHORS,CODENAME,Contributors,FAQ,NEWS,PROPOSAL,TODO}*
	doinfo doc/skk.info

	local exts=( nicola tut-code ) d f
	elisp-install ${PN} nicola/*.{el,elc}
	if use ruby; then
		dobin bayesian/bskk
		exts+=( bayesian )
	fi
	for d in ${exts[@]}; do
		docinto ${d}
		for f in ${d}/{ChangeLog,README}*; do
			[[ -s ${f} ]] && dodoc ${f}
		done
	done
}