Gentoo Archives: gentoo-commits

From: "Roy Marples (uberlord)" <uberlord@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-lib: ChangeLog freebsd-lib-6.2-r3.ebuild
Date: Tue, 23 Oct 2007 12:02:32
Message-Id: E1IkISZ-0003xT-5W@stork.gentoo.org
1 uberlord 07/10/23 12:02:11
2
3 Modified: ChangeLog
4 Added: freebsd-lib-6.2-r3.ebuild
5 Log:
6 Only install libthr as the treading library, #192711 thanks to Joe Peterson.
7 (Portage version: 2.1.3.15)
8
9 Revision Changes Path
10 1.57 sys-freebsd/freebsd-lib/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?rev=1.57&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?rev=1.57&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog?r1=1.56&r2=1.57
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v
19 retrieving revision 1.56
20 retrieving revision 1.57
21 diff -u -r1.56 -r1.57
22 --- ChangeLog 16 Oct 2007 08:52:16 -0000 1.56
23 +++ ChangeLog 23 Oct 2007 12:02:10 -0000 1.57
24 @@ -1,6 +1,13 @@
25 # ChangeLog for sys-freebsd/freebsd-lib
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.56 2007/10/16 08:52:16 uberlord Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.57 2007/10/23 12:02:10 uberlord Exp $
29 +
30 +*freebsd-lib-6.2-r3 (23 Oct 2007)
31 +
32 + 23 Oct 2007; Roy Marples <uberlord@g.o>
33 + +files/freebsd-lib-6.2-libthr.patch, +freebsd-lib-6.2-r3.ebuild:
34 + Only install libthr as the treading library, #192711 thanks to Joe Peterson.
35 + De-bashify the ebuild.
36
37 16 Oct 2007; Roy Marples <uberlord@g.o>
38 -files/freebsd-lib-6.2-sparc64.patch,
39
40
41
42 1.1 sys-freebsd/freebsd-lib/freebsd-lib-6.2-r3.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.2-r3.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.2-r3.ebuild?rev=1.1&content-type=text/plain
46
47 Index: freebsd-lib-6.2-r3.ebuild
48 ===================================================================
49 # Copyright 1999-2007 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.2-r3.ebuild,v 1.1 2007/10/23 12:02:10 uberlord Exp $
52
53 inherit bsdmk freebsd flag-o-matic toolchain-funcs
54
55 DESCRIPTION="FreeBSD's base system libraries"
56 SLOT="6.0"
57 KEYWORDS="~sparc-fbsd ~x86-fbsd"
58
59 IUSE="atm bluetooth ssl ipv6 kerberos nis gpib build bootstrap"
60
61 # Crypto is needed to have an internal OpenSSL header
62 # sys is needed for libalias, probably we can just extract that instead of
63 # extracting the whole tarball
64 SRC_URI="mirror://gentoo/${LIB}.tar.bz2
65 mirror://gentoo/${CONTRIB}.tar.bz2
66 mirror://gentoo/${CRYPTO}.tar.bz2
67 mirror://gentoo/${LIBEXEC}.tar.bz2
68 mirror://gentoo/${ETC}.tar.bz2
69 mirror://gentoo/${INCLUDE}.tar.bz2
70 nis? ( mirror://gentoo/${USBIN}.tar.bz2 )
71 build? (
72 mirror://gentoo/${SYS}.tar.bz2 )"
73
74 if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
75 RDEPEND="ssl? ( dev-libs/openssl )
76 kerberos? ( virtual/krb5 )
77 !sys-freebsd/freebsd-headers"
78 DEPEND="${RDEPEND}
79 >=sys-devel/flex-2.5.31-r2
80 =sys-freebsd/freebsd-sources-${RV}*
81 !bootstrap? ( app-arch/bzip2 )"
82
83 PROVIDE="virtual/libc
84 virtual/os-headers"
85
86 else
87 SRC_URI="${SRC_URI}
88 mirror://gentoo/${SYS}.tar.bz2"
89 fi
90
91 DEPEND="${DEPEND}
92 =sys-freebsd/freebsd-mk-defs-${RV}*"
93
94 S="${WORKDIR}/lib"
95
96 export CTARGET=${CTARGET:-${CHOST}}
97 if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
98 export CTARGET=${CATEGORY/cross-}
99 fi
100
101 pkg_setup() {
102 [ -c /dev/zero ] || \
103 die "You forgot to mount /dev; the compiled libc would break."
104
105 if ! use ssl && use kerberos; then
106 eerror "If you want kerberos support you need to enable ssl support, too."
107 fi
108
109 use atm || mymakeopts="${mymakeopts} NO_ATM= "
110 use bluetooth || mymakeopts="${mymakeopts} NO_BLUETOOTH= "
111 use ssl || mymakeopts="${mymakeopts} NO_OPENSSL= NO_CRYPT= "
112 use ipv6 || mymakeopts="${mymakeopts} NO_INET6= "
113 use kerberos || mymakeopts="${mymakeopts} NO_KERBEROS= "
114 use nis || mymakeopts="${mymakeopts} NO_NIS= "
115 use gpib || mymakeopts="${mymakeopts} NO_GPIB= "
116
117 mymakeopts="${mymakeopts} NO_OPENSSH= NO_BIND= NO_SENDMAIL= NO_LIBC_R= NO_LIBPTHREAD="
118
119 if [ "${CTARGET}" != "${CHOST}" ]; then
120 mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
121 mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
122 fi
123 }
124
125 PATCHES="${FILESDIR}/${PN}-bsdxml.patch
126 ${FILESDIR}/${PN}-6.0-pmc.patch
127 ${FILESDIR}/${PN}-6.0-gccfloat.patch
128 ${FILESDIR}/${PN}-6.0-flex-2.5.31.patch
129 ${FILESDIR}/${PN}-6.0-binutils-asm.patch
130 ${FILESDIR}/${PN}-6.0-ssp.patch
131 ${FILESDIR}/${PN}-6.1-csu.patch
132 ${FILESDIR}/${PN}-6.2-bluetooth.patch
133 ${FILESDIR}/${PN}-6.2-gcc41.patch
134 ${FILESDIR}/${PN}-6.2-dl_iterate_phdr.patch
135 ${FILESDIR}/${PN}-6.2-as-needed.patch
136 ${FILESDIR}/${PN}-6.2-libthr.patch"
137
138 # Here we disable and remove source which we don't need or want
139 # In order:
140 # - ncurses stuff
141 # - archiving libraries (have their own ebuild)
142 # - sendmail libraries (they are installed by sendmail)
143 # - SNMP library and dependency (have their own ebuilds)
144 #
145 # The rest are libraries we already have somewhere else because
146 # they are contribution.
147 # Note: libtelnet is an internal lib used by telnet and telnetd programs
148 # as it's not used in freebsd-lib package itself, it's pointless building
149 # it here.
150 REMOVE_SUBDIRS="libncurses libform libmenu libpanel libedit \
151 libz libbz2 libarchive \
152 libsm libsmdb libsmutil \
153 libbegemot libbsnmp \
154 libpam libpcap bind libwrap libmagic \
155 libcom_err libtelnet"
156
157 src_unpack() {
158 freebsd_src_unpack
159
160 sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
161 sed -i.bak -e 's:histedit.h::' "${WORKDIR}/include/Makefile"
162
163 # Upstream Display Managers default to using VT7
164 # We should make FreeBSD allow this by default
165 local x=
166 for x in "${WORKDIR}"/etc/etc.*/ttys ; do
167 sed -i.bak \
168 -e '/ttyv5[[:space:]]/ a\
169 # Display Managers default to VT7.\
170 # If you use the xdm init script, keep ttyv6 commented out\
171 # unless you force a different VT for the DM being used.' \
172 -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
173 || die "Failed to sed ${x}"
174 rm "${x}".bak
175 done
176
177 # Apply this patch for Gentoo/FreeBSD/SPARC64 to build correctly
178 # from catalyst, then don't do anything else
179 if use build; then
180 cd "${WORKDIR}"
181 # We may need this patch again if it uses the linker instructions
182 # remove this when tested
183 # epatch "${FILESDIR}/freebsd-sources-6.2-sparc64.patch"
184 return 0
185 fi
186
187 if [ "${CTARGET}" = "${CHOST}" ]; then
188 ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
189 else
190 sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
191 "${S}/libc/rpc/Makefile.inc" \
192 "${S}/libc/yp/Makefile.inc"
193 fi
194
195 if install --version 2> /dev/null | grep -q GNU; then
196 sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
197 fi
198
199 # Let arch-specific includes to be found
200 local machine
201 machine=$(tc-arch-kernel ${CTARGET})
202 ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine"
203
204 use bootstrap && dummy_mk libstand
205 }
206
207 src_compile() {
208 cd "${WORKDIR}/include"
209 $(freebsd_get_bmake) CC=$(tc-getCC) || die "make include failed"
210
211 use crosscompile_opts_headers-only && return 0
212
213 # Don't use ssp until properly fixed
214 append-flags $(test-flags -fno-stack-protector -fno-stack-protector-all)
215
216 strip-flags
217 if [ "${CTARGET}" != "${CHOST}" ]; then
218 export YACC='yacc -by'
219 CHOST=${CTARGET} tc-export CC LD CXX
220
221 local machine
222 machine=$(tc-arch-kernel ${CTARGET})
223
224 local csudir
225 if [ -d "${S}/csu/${machine}-elf" ]; then
226 csudir="${S}/csu/${machine}-elf"
227 else
228 csudir="${S}/csu/${machine}"
229 fi
230 cd "${csudir}"
231 $(freebsd_get_bmake) ${mymakeopts} || die "make csu failed"
232
233 append-flags "-isystem /usr/${CTARGET}/usr/include"
234 append-flags "-B ${csudir}"
235 append-ldflags "-B ${csudir}"
236 cd "${S}/libc"
237 $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
238
239 append-flags "-isystem ${WORKDIR}/lib/msun/${machine/i386/i387}"
240 cd "${S}/msun"
241 $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
242 else
243 # Forces to use the local copy of headers as they might be outdated in
244 # the system
245 append-flags "-isystem '${WORKDIR}/sys' -isystem '${WORKDIR}/include'"
246
247 cd "${S}"
248 NOFLAGSTRIP=yes freebsd_src_compile
249 fi
250 }
251
252 src_install() {
253 cd "${WORKDIR}/include"
254
255 [ "${CTARGET}" = "${CHOST}" ] \
256 && INCLUDEDIR="/usr/include" \
257 || INCLUDEDIR="/usr/${CTARGET}/usr/include"
258
259 einfo "Installing for ${CTARGET} in ${CHOST}.."
260
261 dodir "${INCLUDEDIR}"
262 $(freebsd_get_bmake) installincludes \
263 MACHINE=$(tc-arch-kernel) \
264 DESTDIR="${D}" INCLUDEDIR="${INCLUDEDIR}" || die "Install failed"
265
266 # Install math.h when crosscompiling, at this point
267 if [ "${CHOST}" != "${CTARGET}" ]; then
268 insinto "/usr/${CTARGET}/usr/include"
269 doins "${S}/msun/src/math.h"
270 fi
271
272 use crosscompile_opts_headers-only && return 0
273
274 if [ "${CTARGET}" != "${CHOST}" ]; then
275 local csudir
276 if [ -d "${S}/csu/$(tc-arch-kernel ${CTARGET})-elf" ]; then
277 csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})-elf"
278 else
279 csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})"
280 fi
281 cd "${csudir}"
282 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install \
283 FILESDIR="/usr/${CTARGET}/usr/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install csu failed"
284
285 cd "${S}/libc"
286 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
287 SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
288
289 cd "${S}/msun"
290 $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
291 INCLUDEDIR="/usr/${CTARGET}/usr/include" \
292 SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
293
294 dosym "usr/include" "/usr/${CTARGET}/sys-include"
295 else
296 cd "${S}"
297 mkinstall || die "Install failed"
298 fi
299
300 # Don't install the rest of the configuration files if crosscompiling
301 [ "${CTARGET}" != "${CHOST}" ] && return 0
302
303 # Add symlinks (-> libthr) for legacy threading libraries, since these are
304 # not built by us (they are disabled in FreeBSD-7 anyway).
305 dosym libthr.a /usr/lib/libpthread.a
306 dosym libthr.so /usr/lib/libpthread.so
307 dosym libthr.a /usr/lib/libc_r.a
308 dosym libthr.so /usr/lib/libc_r.so
309
310 # Add symlink (-> libthr) so previously built binaries still work.
311 dosym libthr.so.2 /lib/libpthread.so.2
312 dosym libthr.so.2 /lib/libc_r.so.6
313
314 # Compatibility symlinks to run FreeBSD 5.x binaries (ABI is mostly
315 # identical, remove when problems will actually happen)
316 dosym /lib/libc.so.6 /usr/lib/libc.so.5
317 dosym /lib/libm.so.4 /usr/lib/libm.so.3
318
319 # install libstand files
320 dodir /usr/include/libstand
321 insinto /usr/include/libstand
322 doins "${S}"/libstand/*.h
323
324 cd "${WORKDIR}/etc/"
325 insinto /etc
326 doins auth.conf nls.alias mac.conf netconfig
327
328 # Install ttys file
329 doins "etc.$(tc-arch-kernel)"/*
330
331 dodir /etc/sandbox.d
332 cat - > "${D}"/etc/sandbox.d/00freebsd <<EOF
333 # /dev/crypto is used mostly by OpenSSL on *BSD platforms
334 # leave it available as packages might use OpenSSL commands
335 # during compile or install phase.
336 SANDBOX_PREDICT="/dev/crypto"
337 EOF
338 }
339
340
341
342 --
343 gentoo-commits@g.o mailing list