summaryrefslogtreecommitdiff
blob: 3987f9421f6970a59b075372c8ec23654e7d2be3 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/slang/slang-1.4.9.ebuild,v 1.17 2004/03/02 16:43:47 iggy Exp $

inherit gcc

DESCRIPTION="Console display library used by most text viewer"
HOMEPAGE="http://space.mit.edu/~davis/slang/"
SRC_URI="ftp://space.mit.edu/pub/davis/slang/v1.4/${P}.tar.bz2"

LICENSE="GPL-2 | Artistic"
SLOT="0"
KEYWORDS="x86 ~ppc sparc alpha mips hppa amd64 ia64 ppc64 s390"
IUSE="cjk"

DEPEND=">=sys-libs/ncurses-5.2-r2"

src_compile() {
	if [ -n "`use cjk`" ]
	then
		# enable Kanji Support
		cp src/sl-feat.h src/sl-feat.h.bak
		sed "/SLANG_HAS_KANJI_SUPPORT/s/0/1/" \
			src/sl-feat.h.bak > src/sl-feat.h
	fi
	econf || die "econf failed"
	# emake doesn't work well with slang, so just use normal make.
	make all elf || die "make failed"
}

src_install() {
	make install install-elf DESTDIR=${D} || die "make install failed"
	( cd ${D}/usr/lib ; chmod 755 libslang.so.* )
	# remove the documentation... we want to install it ourselves
	rm -rf ${D}/usr/doc
	dodoc COPYING* NEWS README *.txt
	dodoc doc/*.txt doc/internal/*.txt doc/text/*.txt
	dohtml doc/*.html
}

pkg_postinst() {
	# ensure gcc uses the most recent slang.h (#16678)
	if [ "`gcc-major-version`" = "3" ]; then
		if [ -f "`gcc-libpath`/include/slang.h" ]; then
			einfo "Removing gcc buffered slang.h to avoid conflicts"
			rm -f `gcc-libpath`/include/slang.h
		fi
	fi
}