/[gentoo-alt]/trunk/prefix/sys-libs/ncurses/ncurses-5.5-r1.ebuild
Gentoo

Contents of /trunk/prefix/sys-libs/ncurses/ncurses-5.5-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 941 - (show annotations) (download)
Sat Dec 31 14:40:17 2005 UTC (8 years, 7 months ago) by grobian
File size: 5272 byte(s)
Synced with mainline tree


1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="prefix"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 MY_PV=${PV:0:3}
10 PV_SNAP=${PV:4}
11 MY_P=${PN}-${MY_PV}
12 DESCRIPTION="console display library"
13 HOMEPAGE="http://www.gnu.org/software/ncurses/ http://dickey.his.com/ncurses/"
14 SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
15
16 LICENSE="MIT"
17 SLOT="5"
18 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sh ~sparc ~x86"
19 IUSE="gpm build bootstrap debug doc minimal unicode nocxx"
20
21 DEPEND="gpm? ( sys-libs/gpm )"
22
23 S=${WORKDIR}/${MY_P}
24
25 src_unpack() {
26 unpack ${A}
27 cd "${S}"
28 [[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh
29
30 epatch "${FILESDIR}/${P}-gfbsd.patch"
31 }
32
33 src_compile() {
34 tc-export BUILD_CC
35
36 # Protect the user from themselves #115036
37 unset TERMINFO
38
39 # From version 5.3, ncurses also build c++ bindings, and as
40 # we do not have a c++ compiler during bootstrap, disable
41 # building it. We will rebuild ncurses after gcc's second
42 # build in bootstrap.sh.
43 local myconf=""
44 ( use build || use bootstrap || use nocxx ) \
45 && myconf="${myconf} --without-cxx --without-cxx-binding --without-ada"
46
47 # First we build the regular ncurses ...
48 mkdir "${WORKDIR}"/narrowc
49 cd "${WORKDIR}"/narrowc
50 do_compile ${myconf}
51
52 # Then we build the UTF-8 version
53 if use unicode ; then
54 mkdir "${WORKDIR}"/widec
55 cd "${WORKDIR}"/widec
56 do_compile ${myconf} --enable-widec --includedir=${PREFIX}/usr/include/ncursesw
57 fi
58 }
59 do_compile() {
60 ECONF_SOURCE=${S}
61
62 local mylibprefix=""
63 [[ ${CHOST} == *-darwin* ]] && mylibprefix="${PREFIX}/usr"
64
65 # We need the basic terminfo files in /etc, bug #37026. We will
66 # add '--with-terminfo-dirs' and then populate /etc/terminfo in
67 # src_install() ...
68 # The chtype/mmask-t settings below are to retain ABI compat
69 # with ncurses-5.4 so dont change em !
70 econf \
71 --libdir=${mylibprefix}/$(get_libdir) \
72 --with-terminfo-dirs="${PREFIX}/etc/terminfo:${PREFIX}/usr/share/terminfo" \
73 --disable-termcap \
74 --with-shared \
75 --with-rcs-ids \
76 --without-ada \
77 --enable-symlinks \
78 --enable-const \
79 --with-chtype='long' \
80 --with-mmask-t='long' \
81 $(use_with debug) \
82 $(use_with gpm) \
83 "$@" \
84 || die "configure failed"
85
86 # A little hack to fix parallel builds ... they break when
87 # generating sources so if we generate the sources first (in
88 # non-parallel), we can then build the rest of the package
89 # in parallel. This is not really a perf hit since the source
90 # generation is quite small. -vapier
91 emake -j1 sources || die "make sources failed"
92 emake || die "make failed"
93 }
94
95 src_install() {
96 # install unicode version first so that the non-unicode
97 # files overwrite the unicode versions
98 if use unicode ; then
99 cd "${WORKDIR}"/widec
100 sed -i '2iexit 0' man/edit_man.sh
101 einstall || die "make widec install failed"
102 fi
103 cd "${WORKDIR}"/narrowc
104 einstall || die "make narrowc install failed"
105
106 if [[ ${CHOST} != *-darwin* ]] ; then
107 # Move static and extraneous ncurses libraries out of /lib
108 dodir /usr/$(get_libdir)
109 cd "${D}"/$(get_libdir)
110 mv lib{form,menu,panel}.so* *.a "${D}"/usr/$(get_libdir)/
111 gen_usr_ldscript lib{,n}curses.so
112 use unicode && gen_usr_ldscript lib{,n}cursesw.so
113 fi
114
115 # We need the basic terminfo files in /etc, bug #37026
116 einfo "Installing basic terminfo files in /etc..."
117 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} \
118 xterm xterm-color xterm-xfree86
119 do
120 local termfile=$(find "${D}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
121 local basedir=$(basename $(dirname "${termfile}"))
122
123 if [[ -n ${termfile} ]] ; then
124 dodir /etc/terminfo/${basedir}
125 mv ${termfile} "${D}"/etc/terminfo/${basedir}/
126 dosym ../../../../etc/terminfo/${basedir}/${x} \
127 /usr/share/terminfo/${basedir}/${x}
128 fi
129 done
130
131 # Build fails to create this ...
132 dosym ../share/terminfo /usr/$(get_libdir)/terminfo
133
134 echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > "${T}"/50ncurses
135 doenvd "${T}"/50ncurses
136
137 if use build ; then
138 cd "${D}"
139 rm -rf usr/share/man
140 cd usr/share/terminfo
141 cp -pPR l/linux n/nxterm v/vt100 "${T}"
142 rm -rf *
143 mkdir l x v
144 cp -pPR "${T}"/linux l
145 cp -pPR "${T}"/nxterm x/xterm
146 cp -pPR "${T}"/vt100 v
147 else
148 # Install xterm-debian terminfo entry to satisfy bug #18486
149 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${D}/usr/$(get_libdir):${D}/$(get_libdir) \
150 TERMINFO=${D}/usr/share/terminfo \
151 "${D}"/usr/bin/tic "${FILESDIR}"/xterm-debian.ti
152
153 if use minimal ; then
154 cp "${D}"/usr/share/terminfo/x/xterm-debian "${D}"/etc/terminfo/x/
155 rm -r "${D}"/usr/share/terminfo
156 fi
157
158 cd "${S}"
159 dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc
160 use doc && dohtml -r doc/html/
161 fi
162 }
163
164 pkg_preinst() {
165 if [[ ! -f ${ROOT}/etc/env.d/50ncurses ]] ; then
166 mkdir -p "${ROOT}"/etc/env.d
167 echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" > \
168 "${ROOT}"/etc/env.d/50ncurses
169 fi
170 }
171
172 pkg_postinst() {
173 # Old ncurses may still be around from old build tbz2's.
174 rm -f "${ROOT}"/lib/libncurses.so.5.[23] "${ROOT}"/usr/lib/lib{form,menu,panel}.so.5.[23]
175 if [[ $(get_libdir) != "lib" ]] ; then
176 rm -f "${ROOT}"/$(get_libdir)/libncurses.so.5.[23] \
177 "${ROOT}"/usr/$(get_libdir)/lib{form,menu,panel}.so.5.[23]
178 fi
179 }

  ViewVC Help
Powered by ViewVC 1.1.20