summaryrefslogtreecommitdiff
blob: d88ea9804f906327b0d104cca3b99d1a38341903 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libedit/libedit-20061103.ebuild,v 1.4 2009/01/04 22:15:44 angelos Exp $

inherit eutils toolchain-funcs

DESCRIPTION="BSD replacement for libreadline"
HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/"
SRC_URI="mirror://gentoo/${P}.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc-fbsd ~x86 ~x86-fbsd"
IUSE="elibc_glibc"

DEPEND="sys-libs/ncurses
	!<=sys-freebsd/freebsd-lib-6.2_rc1"

S=${WORKDIR}/netbsd-cvs

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}"/${PN}-20061103-debian-to-gentoo.patch

	if use elibc_glibc; then
		mv "${WORKDIR}"/glibc-*/*.c .
		epatch "${FILESDIR}/${P}-glibc.patch"
	fi

	# FreeBSD's __weak_reference macro differs from NetBSD's
	epatch "${FILESDIR}/${P}-freebsd.patch"
}

src_compile() {
	emake -j1 .depend || die "depend"
	emake || die "make"
}

src_install() {
	into /
	dolib.so libedit.so || die "dolib.so"
	into /usr
	dolib.a libedit.a || die "dolib.a"
	insinto /usr/include
	doins histedit.h || die "doins histedit.h"
	insinto /usr/include/libedit
	doins readline/readline.h || die "doins readline.h"
	doman *.[35]

	gen_usr_ldscript libedit.so
}