Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 663880
Collapse All | Expand All

(-)a/app-text/cmigemo/cmigemo-1.3c-r3.ebuild (+95 lines)
Line 0 Link Here
1
# Copyright 1999-2018 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
inherit flag-o-matic toolchain-funcs
6
7
MY_P="${P}-MIT"
8
DESCRIPTION="C/Migemo -- Migemo library implementation in C"
9
HOMEPAGE="http://www.kaoriya.net/#CMIGEMO"
10
SRC_URI="http://www.kaoriya.net/dist/var/${MY_P}.tar.bz2"
11
12
LICENSE="MIT"
13
SLOT="0"
14
KEYWORDS="~alpha ~amd64 ~ppc ~x86"
15
IUSE="emacs unicode vim-syntax"
16
17
DEPEND=">=app-dicts/migemo-dict-200812[unicode=]
18
	dev-lang/perl
19
	|| (
20
		net-misc/curl
21
		net-misc/wget
22
		net-misc/fetch
23
	)
24
	app-i18n/nkf"
25
RDEPEND="${RDEPEND}
26
	emacs? ( >=app-text/migemo-0.40-r1 )"
27
28
S="${WORKDIR}/${MY_P}"
29
30
PATCHES=(
31
	# Bug #246953
32
	"${FILESDIR}"/${P}-gentoo.patch
33
	"${FILESDIR}"/${P}-ldflags.patch
34
)
35
36
src_prepare() {
37
	default
38
39
	touch dict/SKK-JISYO.L || die
40
	if use unicode ; then
41
		sed -i -e "/gcc:/s/euc-jp/utf-8/" dict/dict.mak || die
42
	fi
43
44
	# Bug #255813
45
	sed -i -e "/^docdir/s:/doc/migemo:/share/doc/${PF}:" compile/config.mk.in || die
46
}
47
48
src_compile() {
49
	append-flags -fPIC
50
	# parallel make b0rked
51
	emake -j1 \
52
		CC="$(tc-getCC)" \
53
		CFLAGS="${CFLAGS}" \
54
		LDFLAGS="${LDFLAGS}" \
55
		gcc-all
56
}
57
58
src_install() {
59
	# parallel make b0rked
60
	emake -j1 \
61
		prefix="${D}/usr" \
62
		libdir="${D}/usr/$(get_libdir)" \
63
		gcc-install
64
65
	local encoding
66
	if use unicode ; then
67
		encoding="utf-8"
68
	else
69
		encoding="euc-jp"
70
	fi
71
72
	mv "${D}/usr/share/migemo/${encoding}/"*.dat "${D}/usr/share/migemo/" || die
73
	rm -rf "${D}/usr/share/migemo/"{cp932,euc-jp,utf-8} || die
74
75
	if use vim-syntax ; then
76
		insinto /usr/share/vim/vimfiles/plugin
77
		doins tools/migemo.vim
78
	fi
79
80
	dodoc doc/{README_j,TODO_j,vimigemo}.txt
81
}
82
83
pkg_postinst() {
84
	if use emacs ; then
85
		elog
86
		elog "Please add to your ~/.emacs"
87
		elog "    (setq migemo-command \"cmigemo\")"
88
		elog "    (setq migemo-options '(\"-q\" \"--emacs\" \"-i\" \"\\\\a\"))"
89
		elog "    (setq migemo-dictionary \"/usr/share/migemo/migemo-dict\")"
90
		elog "    (setq migemo-user-dictionary nil)"
91
		elog "    (setq migemo-regex-dictionary nil)"
92
		elog "to use cmigemo instead of migemo under emacs."
93
		elog
94
	fi
95
}

Return to bug 663880