summaryrefslogtreecommitdiff
blob: 3c31f95316f33dc90d47bbcd415838fa4a5432f0 (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
73
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/insight/insight-6.6.ebuild,v 1.2 2007/07/30 07:47:55 vapier Exp $

inherit eutils flag-o-matic

export CTARGET=${CTARGET:-${CHOST}}
if [[ ${CTARGET} == ${CHOST} ]] ; then
	if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
		export CTARGET=${CATEGORY/cross-}
	fi
fi

DESCRIPTION="A graphical interface to the GNU debugger"
HOMEPAGE="http://sourceware.org/insight/"
SRC_URI="ftp://sources.redhat.com/pub/${PN}/releases/${P}.tar.bz2"

LICENSE="GPL-2 LGPL-2"
[[ ${CTARGET} != ${CHOST} ]] \
	&& SLOT="${CTARGET}" \
	|| SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
IUSE="nls"

RDEPEND="sys-libs/ncurses
	x11-libs/libX11"
DEPEND="${RDEPEND}
	nls? ( sys-devel/gettext )"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}-DESTDIR.patch
	epatch "${FILESDIR}"/${P}-burn-paths.patch
}

src_compile() {
	append-flags -fno-strict-aliasing # tcl code sucks
	strip-linguas -u bfd/po opcodes/po
	econf \
		--disable-werror \
		$(use_enable nls) \
		--enable-gdbtk \
		--disable-tui \
		--datadir=/usr/share/${PN} \
		|| die
	emake || die
}

src_install() {
	# the tcl-related subdirs are not parallel safe
	emake -j1 DESTDIR="${D}" install || die

	# Don't install docs when building a cross-insight
	if [[ ${CTARGET} == ${CHOST} ]] ; then
		dodoc gdb/gdbtk/{README,TODO}
	fi

	# the gui tcl code does not consider any of the configure
	# options given it ... instead, it requires the path to
	# be /usr/share/redhat/...
	mv "${D}"/usr/share/${PN}/redhat "${D}"/usr/share/ || die

	# scrub all the cruft we dont want
	local x
	cd "${D}"/usr/bin
	for x in * ; do
		[[ ${x} != *insight ]] && rm -f ${x}
	done
	cd "${D}"
	rm -rf usr/{include,man,share/{info,locale,man}}
	rm -rf usr/lib*
}