Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-hppa64/
Date: Sat, 08 Dec 2018 18:03:31
Message-Id: 1544292191.a2429266ec0588051085d0e1e074cc5fdc903621.dilfridge@gentoo
1 commit: a2429266ec0588051085d0e1e074cc5fdc903621
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 8 17:57:43 2018 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 8 18:03:11 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2429266
7
8 sys-devel/binutils-hppa64: patchlevel bump
9
10 Package-Manager: Portage-2.3.52, Repoman-2.3.12
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 sys-devel/binutils-hppa64/Manifest | 1 +
14 .../binutils-hppa64-2.31.1-r2.ebuild | 391 +++++++++++++++++++++
15 2 files changed, 392 insertions(+)
16
17 diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
18 index 3f56ede6a0b..f23bed67be8 100644
19 --- a/sys-devel/binutils-hppa64/Manifest
20 +++ b/sys-devel/binutils-hppa64/Manifest
21 @@ -18,4 +18,5 @@ DIST binutils-2.30-patches-5.tar.xz 590864 BLAKE2B 71de4d08f92ab1898ad576a21763f
22 DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839
23 DIST binutils-2.31.1-patches-2.tar.xz 11232 BLAKE2B b8ac65872017c063650d4e04855efa3fd3e9faa566e81fa9fb3ae777c1337627023c1af85b708a7933b577a69652451ff488340d7cc9f035d3a3a655da0fc8d6 SHA512 2d0ee2e727586fc39cdb8abc7251c12dd350d18dd84103ddacc08978db48d45445c05b7ea5f095842f6e0350db94d593270b23a38920a01ca59c363decaa2a58
24 DIST binutils-2.31.1-patches-3.tar.xz 12640 BLAKE2B 3444b219dd02ad513e6c36214d649a8a74638382103c88ec8de76a579be0ee13f8d1450e3b8d82dfddad55f2f851b32aee910a99230c7d8673f8426fc79a4cd9 SHA512 67b23c17518305561d190a15cba4a1af18a0a3cf1d7e62583ac7667d2fa40e7c7ec024cc981009d5d1caf1939633ab55fc0a198b69af02dc7841be43ff1acd13
25 +DIST binutils-2.31.1-patches-4.tar.xz 63460 BLAKE2B 6507d03a3b75fe4b65b3c58377baaf377e07aa3e5dee4f6f4cd25336f53a15b4249e72a107213062611c8674be2bcd478a8f1406940385e0b0e58ad5a7c61cc0 SHA512 aa9f2a5b9c2189c528f34c55cd2609eae5fb47e46b51a8f9aa595b0a1e2c3f103880dcc8f07e48b10971d669e4c2a7ce8a41be4763a1ebf9e956e3f1eade8f22
26 DIST binutils-2.31.1.tar.xz 20467996 BLAKE2B 6b914df1fbb7cf54f2159f71b2c2b09f3f6a569b7a3cb4cf9790d0a3733a7548bc0ea32334a178ed3b56e8b97656ae99c7abaf212601beeaeae9a0884c0f6051 SHA512 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
27
28 diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r2.ebuild
29 new file mode 100644
30 index 00000000000..4fd4d3e753a
31 --- /dev/null
32 +++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r2.ebuild
33 @@ -0,0 +1,391 @@
34 +# Copyright 1999-2018 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +export CTARGET=hppa64-${CHOST#*-}
40 +
41 +inherit eutils libtool flag-o-matic gnuconfig multilib versionator
42 +
43 +DESCRIPTION="Tools necessary to build programs"
44 +HOMEPAGE="https://sourceware.org/binutils/"
45 +LICENSE="GPL-3+"
46 +IUSE="+cxx doc multitarget +nls static-libs test"
47 +
48 +# Variables that can be set here:
49 +# PATCH_VER - the patchset version
50 +# Default: empty, no patching
51 +# PATCH_BINUTILS_VER - the binutils version in the patchset name
52 +# - Default: PV
53 +# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
54 +# for the patchsets
55 +# Default: slyfox
56 +
57 +PATCH_VER=4
58 +PATCH_DEV=dilfridge
59 +
60 +case ${PV} in
61 + 9999)
62 + BVER="git"
63 + EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
64 + inherit git-r3
65 + S=${WORKDIR}/binutils
66 + EGIT_CHECKOUT_DIR=${S}
67 + ;;
68 + *)
69 + BVER=${PV}
70 + SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz"
71 + ;;
72 +esac
73 +SLOT=$(get_version_component_range 1-2)
74 +KEYWORDS="-* ~hppa"
75 +
76 +#
77 +# The Gentoo patchset
78 +#
79 +PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}}
80 +PATCH_DEV=${PATCH_DEV:-slyfox}
81 +
82 +[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
83 + https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
84 +
85 +#
86 +# The cross-compile logic
87 +#
88 +export CTARGET=${CTARGET:-${CHOST}}
89 +if [[ ${CTARGET} == ${CHOST} ]] ; then
90 + if [[ ${CATEGORY} == cross-* ]] ; then
91 + export CTARGET=${CATEGORY#cross-}
92 + fi
93 +fi
94 +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
95 +
96 +#
97 +# The dependencies
98 +#
99 +RDEPEND="
100 + >=sys-devel/binutils-config-3
101 + sys-libs/zlib
102 +"
103 +DEPEND="${RDEPEND}
104 + doc? ( sys-apps/texinfo )
105 + test? ( dev-util/dejagnu )
106 + nls? ( sys-devel/gettext )
107 + sys-devel/flex
108 + virtual/yacc
109 +"
110 +
111 +MY_BUILDDIR=${WORKDIR}/build
112 +S=${WORKDIR}/${P/-hppa64/}
113 +
114 +src_unpack() {
115 + case ${PV} in
116 + 9999)
117 + git-r3_src_unpack;
118 + ;;
119 + *)
120 + default
121 + ;;
122 + esac
123 + mkdir -p "${MY_BUILDDIR}"
124 +}
125 +
126 +src_prepare() {
127 + if [[ ! -z ${PATCH_VER} ]] ; then
128 + einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
129 + eapply "${WORKDIR}/patch"/*.patch
130 + fi
131 +
132 + # This check should probably go somewhere else, like pkg_pretend.
133 + if [[ ${CTARGET} == *-uclibc* ]] ; then
134 + if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
135 + die "sorry, but this binutils doesn't yet support uClibc :("
136 + fi
137 + fi
138 +
139 + # Make sure our explicit libdir paths don't get clobbered. #562460
140 + sed -i \
141 + -e 's:@bfdlibdir@:@libdir@:g' \
142 + -e 's:@bfdincludedir@:@includedir@:g' \
143 + {bfd,opcodes}/Makefile.in || die
144 +
145 + # Fix locale issues if possible #122216
146 + if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
147 + einfo "Fixing misc issues in configure files"
148 + for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
149 + ebegin " Updating ${f/${S}\/}"
150 + patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
151 + || eerror "Please file a bug about this"
152 + eend $?
153 + done
154 + fi
155 +
156 + # Fix conflicts with newer glibc #272594
157 + if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
158 + sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
159 + fi
160 +
161 + # Apply things from PATCHES and user dirs
162 + default
163 +
164 + # Run misc portage update scripts
165 + gnuconfig_update
166 + elibtoolize --portage --no-uclibc
167 +}
168 +
169 +toolchain-binutils_bugurl() {
170 + printf "https://bugs.gentoo.org/"
171 +}
172 +toolchain-binutils_pkgversion() {
173 + printf "Gentoo ${BVER}"
174 + [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
175 +}
176 +
177 +src_configure() {
178 + # Setup some paths
179 + LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
180 + INCPATH=${LIBPATH}/include
181 + DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
182 + if is_cross ; then
183 + BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
184 + else
185 + BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
186 + fi
187 +
188 + # Make sure we filter $LINGUAS so that only ones that
189 + # actually work make it through #42033
190 + strip-linguas -u */po
191 +
192 + # Keep things sane
193 + strip-flags
194 +
195 + local x
196 + echo
197 + for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
198 + einfo "$(printf '%10s' ${x}:) ${!x}"
199 + done
200 + echo
201 +
202 + cd "${MY_BUILDDIR}"
203 + local myconf=()
204 +
205 + # enable gold (installed as ld.gold) and ld's plugin architecture
206 + if use cxx ; then
207 + myconf+=( --enable-gold )
208 + myconf+=( --enable-plugins )
209 + fi
210 +
211 + if use nls ; then
212 + myconf+=( --without-included-gettext )
213 + else
214 + myconf+=( --disable-nls )
215 + fi
216 +
217 + myconf+=( --with-system-zlib )
218 +
219 + # For bi-arch systems, enable a 64bit bfd. This matches
220 + # the bi-arch logic in toolchain.eclass. #446946
221 + # We used to do it for everyone, but it's slow on 32bit arches. #438522
222 + case $(tc-arch) in
223 + ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
224 + esac
225 +
226 + use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
227 +
228 + [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
229 +
230 + is_cross && myconf+=(
231 + --with-sysroot="${EPREFIX}"/usr/${CTARGET}
232 + --enable-poison-system-directories
233 + )
234 +
235 + # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
236 + # on everyone in alpha (for now), we'll just enable it when possible
237 + has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
238 + has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
239 +
240 + # mips can't do hash-style=gnu ...
241 + if [[ $(tc-arch) != mips ]] ; then
242 + myconf+=( --enable-default-hash-style=gnu )
243 + fi
244 +
245 + myconf+=(
246 + --prefix="${EPREFIX}"/usr
247 + --host=${CHOST}
248 + --target=${CTARGET}
249 + --datadir="${EPREFIX}"${DATAPATH}
250 + --datarootdir="${EPREFIX}"${DATAPATH}
251 + --infodir="${EPREFIX}"${DATAPATH}/info
252 + --mandir="${EPREFIX}"${DATAPATH}/man
253 + --bindir="${EPREFIX}"${BINPATH}
254 + --libdir="${EPREFIX}"${LIBPATH}
255 + --libexecdir="${EPREFIX}"${LIBPATH}
256 + --includedir="${EPREFIX}"${INCPATH}
257 + --enable-obsolete
258 + --enable-shared
259 + --enable-threads
260 + # Newer versions (>=2.27) offer a configure flag now.
261 + --enable-relro
262 + # Newer versions (>=2.24) make this an explicit option. #497268
263 + --enable-install-libiberty
264 + --disable-werror
265 + --with-bugurl="$(toolchain-binutils_bugurl)"
266 + --with-pkgversion="$(toolchain-binutils_pkgversion)"
267 + $(use_enable static-libs static)
268 + ${EXTRA_ECONF}
269 + # Disable modules that are in a combined binutils/gdb tree. #490566
270 + --disable-{gdb,libdecnumber,readline,sim}
271 + # Strip out broken static link flags.
272 + # https://gcc.gnu.org/PR56750
273 + --without-stage1-ldflags
274 + # Change SONAME to avoid conflict across
275 + # {native,cross}/binutils, binutils-libs. #666100
276 + --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
277 + )
278 + echo ./configure "${myconf[@]}"
279 + "${S}"/configure "${myconf[@]}" || die
280 +
281 + # Prevent makeinfo from running if doc is unset.
282 + if ! use doc ; then
283 + sed -i \
284 + -e '/^MAKEINFO/s:=.*:= true:' \
285 + Makefile || die
286 + fi
287 +}
288 +
289 +src_compile() {
290 + cd "${MY_BUILDDIR}"
291 + emake all
292 +
293 + # only build info pages if the user wants them
294 + if use doc ; then
295 + emake info
296 + fi
297 +
298 + # we nuke the manpages when we're left with junk
299 + # (like when we bootstrap, no perl -> no manpages)
300 + find . -name '*.1' -a -size 0 -delete
301 +}
302 +
303 +src_test() {
304 + cd "${MY_BUILDDIR}"
305 + emake -k check
306 +}
307 +
308 +src_install() {
309 + local x d
310 +
311 + cd "${MY_BUILDDIR}"
312 + emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
313 + rm -rf "${ED}"/${LIBPATH}/bin
314 + use static-libs || find "${ED}" -name '*.la' -delete
315 +
316 + # Newer versions of binutils get fancy with ${LIBPATH} #171905
317 + cd "${ED}"/${LIBPATH}
318 + for d in ../* ; do
319 + [[ ${d} == ../${BVER} ]] && continue
320 + mv ${d}/* . || die
321 + rmdir ${d} || die
322 + done
323 +
324 + # Now we collect everything intp the proper SLOT-ed dirs
325 + # When something is built to cross-compile, it installs into
326 + # /usr/$CHOST/ by default ... we have to 'fix' that :)
327 + if is_cross ; then
328 + cd "${ED}"/${BINPATH}
329 + for x in * ; do
330 + mv ${x} ${x/${CTARGET}-}
331 + done
332 +
333 + if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
334 + mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
335 + mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
336 + rm -r "${ED}"/usr/${CHOST}/{include,lib}
337 + fi
338 + fi
339 + insinto ${INCPATH}
340 + local libiberty_headers=(
341 + # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
342 + demangle.h
343 + dyn-string.h
344 + fibheap.h
345 + hashtab.h
346 + libiberty.h
347 + objalloc.h
348 + splay-tree.h
349 + )
350 + doins "${libiberty_headers[@]/#/${S}/include/}" || die
351 + if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
352 + mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
353 + rm -r "${ED}"/${LIBPATH}/lib
354 + fi
355 +
356 + # Generate an env.d entry for this binutils
357 + insinto /etc/env.d/binutils
358 + cat <<-EOF > "${T}"/env.d
359 + TARGET="${CTARGET}"
360 + VER="${BVER}"
361 + LIBPATH="${EPREFIX}${LIBPATH}"
362 + EOF
363 + newins "${T}"/env.d ${CTARGET}-${BVER}
364 +
365 + # Handle documentation
366 + if ! is_cross ; then
367 + cd "${S}"
368 + dodoc README
369 + docinto bfd
370 + dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
371 + docinto binutils
372 + dodoc binutils/ChangeLog binutils/NEWS binutils/README
373 + docinto gas
374 + dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
375 + docinto gprof
376 + dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
377 + docinto ld
378 + dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
379 + docinto libiberty
380 + dodoc libiberty/ChangeLog* libiberty/README
381 + docinto opcodes
382 + dodoc opcodes/ChangeLog*
383 + fi
384 +
385 + # Remove shared info pages
386 + rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
387 +
388 + # Trim all empty dirs
389 + find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
390 +
391 + # the hppa64 hack; this should go into 9999 as a PN-conditional
392 + # tweak the default fake list a little bit
393 + cd "${D}"/etc/env.d/binutils
394 + sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
395 +}
396 +
397 +pkg_postinst() {
398 + # Make sure this ${CTARGET} has a binutils version selected
399 + [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
400 + binutils-config ${CTARGET}-${BVER}
401 +}
402 +
403 +pkg_postrm() {
404 + local current_profile=$(binutils-config -c ${CTARGET})
405 +
406 + # If no other versions exist, then uninstall for this
407 + # target ... otherwise, switch to the newest version
408 + # Note: only do this if this version is unmerged. We
409 + # rerun binutils-config if this is a remerge, as
410 + # we want the mtimes on the symlinks updated (if
411 + # it is the same as the current selected profile)
412 + if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
413 + local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
414 + choice=${choice//$'\n'/ }
415 + choice=${choice/* }
416 + if [[ -z ${choice} ]] ; then
417 + binutils-config -u ${CTARGET}
418 + else
419 + binutils-config ${choice}
420 + fi
421 + elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then
422 + binutils-config ${CTARGET}-${BVER}
423 + fi
424 +}