summaryrefslogtreecommitdiff
blob: 98e4e14b988bbf22ee50792f69a6baaa392c29b6 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="8"

inherit toolchain-funcs

DESCRIPTION="Vietnamese input keyboard for X"
HOMEPAGE="https://xvnkb.sourceforge.net/"
SRC_URI="https://${PN}.sourceforge.net/${P}.tar.bz2"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="amd64 ppc x86"
IUSE="spell xft"

RDEPEND="x11-libs/libX11:=
	xft? ( x11-libs/libXft:= )"
DEPEND="${RDEPEND}
	x11-base/xorg-proto"
BDEPEND="xft? ( virtual/pkgconfig )"

PATCHES=(
	"${FILESDIR}"/${PN}-cc.patch
	"${FILESDIR}"/${P}-ldflags.patch
)

src_prepare() {
	default
	tc-export CC
}

src_configure() {
	# *not* autotools
	./configure \
		$(usex spell '' '--no-spellcheck') \
		$(usex xft '' '--no-xft') \
		--use-extstroke \
		|| die "./configure failed"
}

src_install() {
	dobin ${PN}
	dobin tools/${PN}_ctrl

	dolib.so ${PN}.so.${PV}
	dosym ${PN}.so.${PV} /usr/$(get_libdir)/${PN}.so

	einstalldocs
	dodoc -r doc/. scripts contrib
}

pkg_postinst() {
	elog "Remember to"
	elog "$ export LANG=en_US.UTF-8"
	elog "(or any other UTF-8 locale) and"
	elog "$ export LD_PRELOAD=/usr/$(get_libdir)/${PN}.so"
	elog "before starting X Window"
	elog "More documents are in ${EROOT}/usr/share/doc/${PF}"

	ewarn "Programs with suid/sgid will have LD_PRELOAD cleared"
	ewarn "You have to unset suid/sgid to use with ${PN}"
}