]> Pileus Git - ~andy/sunrise/blob - x11-libs/pdcurses/pdcurses-2.8.ebuild
51f5cb6e3686b5a659112236ca1f08edf44365ad
[~andy/sunrise] / x11-libs / pdcurses / pdcurses-2.8.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit autotools eutils
6
7 MY_P=${P/pdc/PDC}
8
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"
12
13 KEYWORDS="~x86"
14
15 LICENSE="public-domain GPL-2"
16 SLOT="0"
17 IUSE="debug doc examples latin1 nextaw Xaw3d"
18
19 DEPEND="x11-libs/libX11
20         x11-libs/libXmu
21         x11-libs/libXt
22         x11-libs/libXpm
23         x11-proto/xproto
24         nextaw? ( x11-libs/neXtaw )
25         Xaw3d? ( x11-libs/Xaw3d )
26         !nextaw? ( !Xaw3d? ( x11-libs/libXaw ) )"
27 RDEPEND="${DEPEND}"
28
29 S=${WORKDIR}/${MY_P}
30
31 pkg_setup() {
32         if use Xaw3d && use nextaw ; then
33                 elog "You have both Xaw3d and nextaw USE-flags set,"
34                 elog "Xaw3d will be used."
35         fi
36 }
37
38 src_unpack() {
39         unpack ${A}
40         cd "${S}"
41
42         epatch "${FILESDIR}/${P}-configure.patch"
43
44         # Fixing -jX problems:
45         sed -i \
46                 -e 's/\(PDCurses.man:\)/\1 manext/' \
47                 tools/Makefile.in || die "sed failed"
48
49         # Fixing soname problem:
50         sed -i \
51                 -e "s/\(\$(LD_RXLIB1)\)/\1 -Wl,-soname,libXcurses.so.${PV%.*}/" \
52                 pdcurses/Makefile.in || die "sed failed"
53
54         eautoreconf
55 }
56
57 src_compile() {
58
59         if ! use examples ; then
60                 sed -i \
61                         -e 's/\(^all[ \t]::[\t a-z]*\) demos/\1/' \
62                         -e '/demos/d' \
63                         Makefile.in || die "sed failed"
64         fi
65
66         if ! use doc ; then
67                 sed -i \
68                         -e '/tools/d' \
69                         Makefile.in || die "sed failed"
70         fi
71
72         econf \
73                 $(use_with Xaw3d xaw3d) \
74                 $(use_with nextaw) \
75                 $(use_enable debug) \
76                 $(use_enable latin1) \
77                 || die "econf failed"
78         emake || die "emake failed"
79 }
80
81 src_install() {
82         emake DESTDIR="${D}" install || die "emake install failed"
83         dodoc HISTORY README TODO doc/*
84
85         if use doc ; then
86                 dodoc tools/PDCurses.man
87         fi
88         if use examples ; then
89                 insinto /usr/share/${PN}/examples
90                 cd demos
91                 doins *.{h,c} $(sed -e 's/^DEMOS[ \t]*=\ \(.*\)/\1/p' -e 'd' Makefile.in)
92         fi
93
94 }