1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools eutils
11 DESCRIPTION="A public domain curses library for DOS, OS/2, Win32, X11"
12 HOMEPAGE="http://pdcurses.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
15 LICENSE="MIT public-domain"
17 KEYWORDS="~amd64 ~x86"
18 # TODO: add SDL support
19 IUSE="doc examples nextaw Xaw3d"
21 RDEPEND="Xaw3d? ( x11-libs/libXaw3d )
23 nextaw? ( x11-libs/neXtaw )
24 !nextaw? ( x11-libs/libXaw )
32 if use nextaw && use Xaw3d ; then
33 elog "You have both nextaw and Xaw3d USE-flags set, Xaw3d will be used."
38 epatch "${FILESDIR}/${P}-configure.patch"
40 # Fixing soname problem
41 sed -i -e "s/\(\$(LD_RXLIB1)\)/\1 -Wl,-soname,libXcurses.so.${PV%.*}/" \
42 x11/Makefile.in || die
44 # Fixing absolute symlinks
45 sed -i -e 's:\(ln -f -s \)$(libdir)/:\1:' \
49 sed -i -e 's:\.\.[/\\]demos[/\\]::' \
50 demos/tuidemo.c || die
52 # If enabled, uses "manext" to create a 160K doc/PDCurses.txt
54 sed -i -e '/cd doc; $(MAKE)/d' \
58 # Removing the $(DEMOS) from all target
59 if ! use examples ; then
60 sed -i -e 's/\(^all:[\t a-zA-Z$()]*\) $(DEMOS)/\1/' \
61 x11/Makefile.in || die
70 $(use_with Xaw3d xaw3d)
74 emake DESTDIR="${D}" install || die
75 dodoc HISTORY IMPLEMNT README doc/*.txt || die
77 if use examples ; then
78 insinto /usr/share/doc/${PF}/examples
79 doins demos/*.[ch] || die
81 exeinto /usr/share/doc/${PF}/examples
83 # Which one is better?
84 #doins $(sed -e 's/^DEMOS[ \t]*=\(.*\)/\1/p' -e 'd' Makefile.in)
85 doexe $(sed -n -e 's/^DEMOS[ \t]*=\(.*\)/\1/p' Makefile.in) || die