1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools eutils
9 DESCRIPTION="A public domain curses library for DOS, OS/2, Win32 and X11"
10 HOMEPAGE="http://pdcurses.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
15 LICENSE="public-domain GPL-2"
17 IUSE="debug doc examples latin1 nextaw Xaw3d"
19 DEPEND="x11-libs/libX11
24 nextaw? ( x11-libs/neXtaw )
25 Xaw3d? ( x11-libs/Xaw3d )
26 !nextaw? ( !Xaw3d? ( x11-libs/libXaw ) )"
32 if use Xaw3d && use nextaw ; then
33 elog "You have both Xaw3d and nextaw USE-flags set,"
34 elog "Xaw3d will be used."
42 epatch "${FILESDIR}/${P}-configure.patch"
44 # Fixing -jX problems:
46 -e 's/\(PDCurses.man:\)/\1 manext/' \
47 tools/Makefile.in || die "sed failed"
49 # Fixing soname problem:
51 -e "s/\(\$(LD_RXLIB1)\)/\1 -Wl,-soname,libXcurses.so.${PV%.*}/" \
52 pdcurses/Makefile.in || die "sed failed"
59 if ! use examples ; then
61 -e 's/\(^all[ \t]::[\t a-z]*\) demos/\1/' \
63 Makefile.in || die "sed failed"
69 Makefile.in || die "sed failed"
73 $(use_with Xaw3d xaw3d) \
76 $(use_enable latin1) \
78 emake || die "emake failed"
82 emake DESTDIR="${D}" install || die "emake install failed"
83 dodoc HISTORY README TODO doc/*
86 dodoc tools/PDCurses.man
88 if use examples ; then
89 insinto /usr/share/${PN}/examples
91 doins *.{h,c} $(sed -e 's/^DEMOS[ \t]*=\ \(.*\)/\1/p' -e 'd' Makefile.in)