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:32
Message-Id: 1544292191.8a8de3cb391b2ae420e75b310bd56d7ca40d01c6.dilfridge@gentoo
1 commit: 8a8de3cb391b2ae420e75b310bd56d7ca40d01c6
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 8 17:58:25 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=8a8de3cb
7
8 sys-devel/binutils-hppa64: drop old
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 | 2 -
14 .../binutils-hppa64/binutils-hppa64-2.30-r3.ebuild | 393 ---------------------
15 .../binutils-hppa64/binutils-hppa64-2.31.1.ebuild | 393 ---------------------
16 3 files changed, 788 deletions(-)
17
18 diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
19 index f23bed67be8..2c22887f693 100644
20 --- a/sys-devel/binutils-hppa64/Manifest
21 +++ b/sys-devel/binutils-hppa64/Manifest
22 @@ -13,10 +13,8 @@ DIST binutils-2.29.1-patches-2.tar.xz 18528 BLAKE2B 514496d6c9609362782d66b6cecb
23 DIST binutils-2.29.1.tar.bz2 29123355 BLAKE2B 83de518a27bae0f13c57b1979493dd7f7cabae424cff5e8495d1f064da24b6ef9e1c19d1d1adad2dca7142372782023f66b4b4223170a49b96ba3834266fe878 SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592
24 DIST binutils-2.29.tar.bz2 29073316 BLAKE2B 0eb7bbefa1ac5f4d753ca9328d339a466d4f75c69d5d860802aded8e42ce4293f65c72a0f0596b170e90e1cc3ded23ea30576948cb875eea044cb02bb55bb2d3 SHA512 8148587d7e4f14ebcbcb3f984b116deaae5d4008228628acde14bc242a64a4b53faf1f6077a2c4ca4750e2f254b698ba506bd657f79e1202e87e7029b0069337
25 DIST binutils-2.30-patches-2.tar.xz 490272 BLAKE2B a28a5b5bb8faa33fec269f2c69d6ed0e4e7d5a9169861aa4b3c45511794e1e749c216862a8258c2029f1b40c511dcb2a0aeaecda57e75d52418f10d6f345718f SHA512 1686d5b58ee968f2000647acab2bee4c263d1c85fd43fed8c820fccfc0d7024a01211e7853cd5ce452fa90da500bc17309edf6dbc901c7fd6fc7b3e3d6f42581
26 -DIST binutils-2.30-patches-3.tar.xz 548804 BLAKE2B 428a1750233ae3f019e20cb5ed1d8e6fe6455181e8f5961dbfe7b66493d1c42050f889e45c02c1fc1a84d545c9e61f81ad6ffd5afc0b1099a702ccc7637c3abe SHA512 c91e902d1d9fc2e9782df04c93173c3207c771f1c063e2ff12c9336593c954ea3f1b2474a8fc045927d72fe18f7401874059599d100c4a1fd152081f05913d03
27 DIST binutils-2.30-patches-5.tar.xz 590864 BLAKE2B 71de4d08f92ab1898ad576a21763f955067cbbed543250888e0c5d51f4ef77d0d829049e9a835691cf2de03965fbcc9bcfa092eb304c03f9b885e7a3dadab286 SHA512 029b3be6ae9b8620f8580a35701bd4517b4e0232ff3cf9983b3808475c7443cbf500b6cace2c052df0bd1e47202838f4d2453238db28709a947117071d9ae804
28 DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839
29 -DIST binutils-2.31.1-patches-2.tar.xz 11232 BLAKE2B b8ac65872017c063650d4e04855efa3fd3e9faa566e81fa9fb3ae777c1337627023c1af85b708a7933b577a69652451ff488340d7cc9f035d3a3a655da0fc8d6 SHA512 2d0ee2e727586fc39cdb8abc7251c12dd350d18dd84103ddacc08978db48d45445c05b7ea5f095842f6e0350db94d593270b23a38920a01ca59c363decaa2a58
30 DIST binutils-2.31.1-patches-3.tar.xz 12640 BLAKE2B 3444b219dd02ad513e6c36214d649a8a74638382103c88ec8de76a579be0ee13f8d1450e3b8d82dfddad55f2f851b32aee910a99230c7d8673f8426fc79a4cd9 SHA512 67b23c17518305561d190a15cba4a1af18a0a3cf1d7e62583ac7667d2fa40e7c7ec024cc981009d5d1caf1939633ab55fc0a198b69af02dc7841be43ff1acd13
31 DIST binutils-2.31.1-patches-4.tar.xz 63460 BLAKE2B 6507d03a3b75fe4b65b3c58377baaf377e07aa3e5dee4f6f4cd25336f53a15b4249e72a107213062611c8674be2bcd478a8f1406940385e0b0e58ad5a7c61cc0 SHA512 aa9f2a5b9c2189c528f34c55cd2609eae5fb47e46b51a8f9aa595b0a1e2c3f103880dcc8f07e48b10971d669e4c2a7ce8a41be4763a1ebf9e956e3f1eade8f22
32 DIST binutils-2.31.1.tar.xz 20467996 BLAKE2B 6b914df1fbb7cf54f2159f71b2c2b09f3f6a569b7a3cb4cf9790d0a3733a7548bc0ea32334a178ed3b56e8b97656ae99c7abaf212601beeaeae9a0884c0f6051 SHA512 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
33
34 diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r3.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r3.ebuild
35 deleted file mode 100644
36 index da743be6046..00000000000
37 --- a/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r3.ebuild
38 +++ /dev/null
39 @@ -1,393 +0,0 @@
40 -# Copyright 1999-2018 Gentoo Foundation
41 -# Distributed under the terms of the GNU General Public License v2
42 -
43 -EAPI=6
44 -
45 -export CTARGET=hppa64-${CHOST#*-}
46 -
47 -inherit eutils libtool flag-o-matic gnuconfig multilib versionator
48 -
49 -DESCRIPTION="Tools necessary to build programs"
50 -HOMEPAGE="https://sourceware.org/binutils/"
51 -LICENSE="GPL-3+"
52 -IUSE="+cxx doc multitarget +nls static-libs test"
53 -
54 -# Variables that can be set here:
55 -# PATCH_VER - the patchset version
56 -# Default: empty, no patching
57 -# PATCH_BINUTILS_VER - the binutils version in the patchset name
58 -# - Default: PV
59 -# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
60 -# for the patchsets
61 -# Default: dilfridge :)
62 -
63 -PATCH_VER=3
64 -
65 -case ${PV} in
66 - 9999)
67 - BVER="git"
68 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
69 - inherit git-r3
70 - S=${WORKDIR}/binutils
71 - EGIT_CHECKOUT_DIR=${S}
72 - ;;
73 - *)
74 - BVER=${PV}
75 - SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz"
76 - ;;
77 -esac
78 -SLOT="${BVER}"
79 -KEYWORDS="-* ~hppa"
80 -
81 -#
82 -# The Gentoo patchset
83 -#
84 -PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}}
85 -PATCH_DEV=${PATCH_DEV:-dilfridge}
86 -
87 -[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
88 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
89 -
90 -#
91 -# The cross-compile logic
92 -#
93 -export CTARGET=${CTARGET:-${CHOST}}
94 -if [[ ${CTARGET} == ${CHOST} ]] ; then
95 - if [[ ${CATEGORY} == cross-* ]] ; then
96 - export CTARGET=${CATEGORY#cross-}
97 - fi
98 -fi
99 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
100 -
101 -#
102 -# The dependencies
103 -#
104 -RDEPEND="
105 - >=sys-devel/binutils-config-3
106 - sys-libs/zlib
107 -"
108 -DEPEND="${RDEPEND}
109 - doc? ( sys-apps/texinfo )
110 - test? ( dev-util/dejagnu )
111 - nls? ( sys-devel/gettext )
112 - sys-devel/flex
113 - virtual/yacc
114 -"
115 -if is_cross ; then
116 - # The build assumes the host has libiberty and such when cross-compiling
117 - # its build tools. We should probably make binutils itself build a local
118 - # copy to use, but until then, be lazy.
119 - DEPEND+=" >=sys-libs/binutils-libs-${PV}"
120 -fi
121 -
122 -MY_BUILDDIR=${WORKDIR}/build
123 -S=${WORKDIR}/${P/-hppa64/}
124 -
125 -src_unpack() {
126 - case ${PV} in
127 - 9999)
128 - git-r3_src_unpack;
129 - ;;
130 - *)
131 - default
132 - ;;
133 - esac
134 - mkdir -p "${MY_BUILDDIR}"
135 -}
136 -
137 -src_prepare() {
138 - if [[ ! -z ${PATCH_VER} ]] ; then
139 - einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
140 - eapply "${WORKDIR}/patch"/*.patch
141 - fi
142 -
143 - # This check should probably go somewhere else, like pkg_pretend.
144 - if [[ ${CTARGET} == *-uclibc* ]] ; then
145 - if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
146 - die "sorry, but this binutils doesn't yet support uClibc :("
147 - fi
148 - fi
149 -
150 - # Make sure our explicit libdir paths don't get clobbered. #562460
151 - sed -i \
152 - -e 's:@bfdlibdir@:@libdir@:g' \
153 - -e 's:@bfdincludedir@:@includedir@:g' \
154 - {bfd,opcodes}/Makefile.in || die
155 -
156 - # Fix locale issues if possible #122216
157 - if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
158 - einfo "Fixing misc issues in configure files"
159 - for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
160 - ebegin " Updating ${f/${S}\/}"
161 - patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
162 - || eerror "Please file a bug about this"
163 - eend $?
164 - done
165 - fi
166 -
167 - # Fix conflicts with newer glibc #272594
168 - if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
169 - sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
170 - fi
171 -
172 - # Apply things from PATCHES and user dirs
173 - default
174 -
175 - # Run misc portage update scripts
176 - gnuconfig_update
177 - elibtoolize --portage --no-uclibc
178 -}
179 -
180 -toolchain-binutils_bugurl() {
181 - printf "https://bugs.gentoo.org/"
182 -}
183 -toolchain-binutils_pkgversion() {
184 - printf "Gentoo ${BVER}"
185 - [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
186 -}
187 -
188 -src_configure() {
189 - # Setup some paths
190 - LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
191 - INCPATH=${LIBPATH}/include
192 - DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
193 - if is_cross ; then
194 - BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
195 - else
196 - BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
197 - fi
198 -
199 - # Make sure we filter $LINGUAS so that only ones that
200 - # actually work make it through #42033
201 - strip-linguas -u */po
202 -
203 - # Keep things sane
204 - strip-flags
205 -
206 - local x
207 - echo
208 - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
209 - einfo "$(printf '%10s' ${x}:) ${!x}"
210 - done
211 - echo
212 -
213 - cd "${MY_BUILDDIR}"
214 - local myconf=()
215 -
216 - # enable gold (installed as ld.gold) and ld's plugin architecture
217 - if use cxx ; then
218 - myconf+=( --enable-gold )
219 - myconf+=( --enable-plugins )
220 - fi
221 -
222 - if use nls ; then
223 - myconf+=( --without-included-gettext )
224 - else
225 - myconf+=( --disable-nls )
226 - fi
227 -
228 - myconf+=( --with-system-zlib )
229 -
230 - # For bi-arch systems, enable a 64bit bfd. This matches
231 - # the bi-arch logic in toolchain.eclass. #446946
232 - # We used to do it for everyone, but it's slow on 32bit arches. #438522
233 - case $(tc-arch) in
234 - ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
235 - esac
236 -
237 - use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
238 -
239 - [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
240 -
241 - is_cross && myconf+=(
242 - --with-sysroot="${EPREFIX}"/usr/${CTARGET}
243 - --enable-poison-system-directories
244 - )
245 -
246 - # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
247 - # on everyone in alpha (for now), we'll just enable it when possible
248 - has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
249 - has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
250 -
251 - # mips can't do hash-style=gnu ...
252 - if [[ $(tc-arch) != mips ]] ; then
253 - myconf+=( --enable-default-hash-style=gnu )
254 - fi
255 -
256 - myconf+=(
257 - --prefix="${EPREFIX}"/usr
258 - --host=${CHOST}
259 - --target=${CTARGET}
260 - --datadir="${EPREFIX}"${DATAPATH}
261 - --datarootdir="${EPREFIX}"${DATAPATH}
262 - --infodir="${EPREFIX}"${DATAPATH}/info
263 - --mandir="${EPREFIX}"${DATAPATH}/man
264 - --bindir="${EPREFIX}"${BINPATH}
265 - --libdir="${EPREFIX}"${LIBPATH}
266 - --libexecdir="${EPREFIX}"${LIBPATH}
267 - --includedir="${EPREFIX}"${INCPATH}
268 - --enable-obsolete
269 - --enable-shared
270 - --enable-threads
271 - # Newer versions (>=2.27) offer a configure flag now.
272 - --enable-relro
273 - # Newer versions (>=2.24) make this an explicit option. #497268
274 - --enable-install-libiberty
275 - --disable-werror
276 - --with-bugurl="$(toolchain-binutils_bugurl)"
277 - --with-pkgversion="$(toolchain-binutils_pkgversion)"
278 - $(use_enable static-libs static)
279 - ${EXTRA_ECONF}
280 - # Disable modules that are in a combined binutils/gdb tree. #490566
281 - --disable-{gdb,libdecnumber,readline,sim}
282 - # Strip out broken static link flags.
283 - # https://gcc.gnu.org/PR56750
284 - --without-stage1-ldflags
285 - )
286 - echo ./configure "${myconf[@]}"
287 - "${S}"/configure "${myconf[@]}" || die
288 -
289 - # Prevent makeinfo from running if doc is unset.
290 - if ! use doc ; then
291 - sed -i \
292 - -e '/^MAKEINFO/s:=.*:= true:' \
293 - Makefile || die
294 - fi
295 -}
296 -
297 -src_compile() {
298 - cd "${MY_BUILDDIR}"
299 - emake all
300 -
301 - # only build info pages if the user wants them
302 - if use doc ; then
303 - emake info
304 - fi
305 -
306 - # we nuke the manpages when we're left with junk
307 - # (like when we bootstrap, no perl -> no manpages)
308 - find . -name '*.1' -a -size 0 -delete
309 -}
310 -
311 -src_test() {
312 - cd "${MY_BUILDDIR}"
313 - emake -k check
314 -}
315 -
316 -src_install() {
317 - local x d
318 -
319 - cd "${MY_BUILDDIR}"
320 - emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
321 - rm -rf "${ED}"/${LIBPATH}/bin
322 - use static-libs || find "${ED}" -name '*.la' -delete
323 -
324 - # Newer versions of binutils get fancy with ${LIBPATH} #171905
325 - cd "${ED}"/${LIBPATH}
326 - for d in ../* ; do
327 - [[ ${d} == ../${BVER} ]] && continue
328 - mv ${d}/* . || die
329 - rmdir ${d} || die
330 - done
331 -
332 - # Now we collect everything intp the proper SLOT-ed dirs
333 - # When something is built to cross-compile, it installs into
334 - # /usr/$CHOST/ by default ... we have to 'fix' that :)
335 - if is_cross ; then
336 - cd "${ED}"/${BINPATH}
337 - for x in * ; do
338 - mv ${x} ${x/${CTARGET}-}
339 - done
340 -
341 - if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
342 - mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
343 - mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
344 - rm -r "${ED}"/usr/${CHOST}/{include,lib}
345 - fi
346 - fi
347 - insinto ${INCPATH}
348 - local libiberty_headers=(
349 - # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
350 - demangle.h
351 - dyn-string.h
352 - fibheap.h
353 - hashtab.h
354 - libiberty.h
355 - objalloc.h
356 - splay-tree.h
357 - )
358 - doins "${libiberty_headers[@]/#/${S}/include/}" || die
359 - if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
360 - mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
361 - rm -r "${ED}"/${LIBPATH}/lib
362 - fi
363 -
364 - # Generate an env.d entry for this binutils
365 - insinto /etc/env.d/binutils
366 - cat <<-EOF > "${T}"/env.d
367 - TARGET="${CTARGET}"
368 - VER="${BVER}"
369 - LIBPATH="${EPREFIX}${LIBPATH}"
370 - EOF
371 - newins "${T}"/env.d ${CTARGET}-${BVER}
372 -
373 - # Handle documentation
374 - if ! is_cross ; then
375 - cd "${S}"
376 - dodoc README
377 - docinto bfd
378 - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
379 - docinto binutils
380 - dodoc binutils/ChangeLog binutils/NEWS binutils/README
381 - docinto gas
382 - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
383 - docinto gprof
384 - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
385 - docinto ld
386 - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
387 - docinto libiberty
388 - dodoc libiberty/ChangeLog* libiberty/README
389 - docinto opcodes
390 - dodoc opcodes/ChangeLog*
391 - fi
392 -
393 - # Remove shared info pages
394 - rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
395 -
396 - # Trim all empty dirs
397 - find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
398 -
399 - # the hppa64 hack; this should go into 9999 as a PN-conditional
400 - # tweak the default fake list a little bit
401 - cd "${D}"/etc/env.d/binutils
402 - sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
403 -}
404 -
405 -pkg_postinst() {
406 - # Make sure this ${CTARGET} has a binutils version selected
407 - [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
408 - binutils-config ${CTARGET}-${BVER}
409 -}
410 -
411 -pkg_postrm() {
412 - local current_profile=$(binutils-config -c ${CTARGET})
413 -
414 - # If no other versions exist, then uninstall for this
415 - # target ... otherwise, switch to the newest version
416 - # Note: only do this if this version is unmerged. We
417 - # rerun binutils-config if this is a remerge, as
418 - # we want the mtimes on the symlinks updated (if
419 - # it is the same as the current selected profile)
420 - if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
421 - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
422 - choice=${choice//$'\n'/ }
423 - choice=${choice/* }
424 - if [[ -z ${choice} ]] ; then
425 - binutils-config -u ${CTARGET}
426 - else
427 - binutils-config ${choice}
428 - fi
429 - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then
430 - binutils-config ${CTARGET}-${BVER}
431 - fi
432 -}
433
434 diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1.ebuild
435 deleted file mode 100644
436 index 29675f0e5c2..00000000000
437 --- a/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1.ebuild
438 +++ /dev/null
439 @@ -1,393 +0,0 @@
440 -# Copyright 1999-2018 Gentoo Foundation
441 -# Distributed under the terms of the GNU General Public License v2
442 -
443 -EAPI=6
444 -
445 -export CTARGET=hppa64-${CHOST#*-}
446 -
447 -inherit eutils libtool flag-o-matic gnuconfig multilib versionator
448 -
449 -DESCRIPTION="Tools necessary to build programs"
450 -HOMEPAGE="https://sourceware.org/binutils/"
451 -LICENSE="GPL-3+"
452 -IUSE="+cxx doc multitarget +nls static-libs test"
453 -
454 -# Variables that can be set here:
455 -# PATCH_VER - the patchset version
456 -# Default: empty, no patching
457 -# PATCH_BINUTILS_VER - the binutils version in the patchset name
458 -# - Default: PV
459 -# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
460 -# for the patchsets
461 -# Default: dilfridge :)
462 -
463 -PATCH_VER=2
464 -
465 -case ${PV} in
466 - 9999)
467 - BVER="git"
468 - EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
469 - inherit git-r3
470 - S=${WORKDIR}/binutils
471 - EGIT_CHECKOUT_DIR=${S}
472 - ;;
473 - *)
474 - BVER=${PV}
475 - SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz"
476 - ;;
477 -esac
478 -SLOT=$(get_version_component_range 1-2)
479 -KEYWORDS="-* ~hppa"
480 -
481 -#
482 -# The Gentoo patchset
483 -#
484 -PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}}
485 -PATCH_DEV=${PATCH_DEV:-slyfox}
486 -
487 -[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
488 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
489 -
490 -#
491 -# The cross-compile logic
492 -#
493 -export CTARGET=${CTARGET:-${CHOST}}
494 -if [[ ${CTARGET} == ${CHOST} ]] ; then
495 - if [[ ${CATEGORY} == cross-* ]] ; then
496 - export CTARGET=${CATEGORY#cross-}
497 - fi
498 -fi
499 -is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
500 -
501 -#
502 -# The dependencies
503 -#
504 -RDEPEND="
505 - >=sys-devel/binutils-config-3
506 - sys-libs/zlib
507 -"
508 -DEPEND="${RDEPEND}
509 - doc? ( sys-apps/texinfo )
510 - test? ( dev-util/dejagnu )
511 - nls? ( sys-devel/gettext )
512 - sys-devel/flex
513 - virtual/yacc
514 -"
515 -if is_cross ; then
516 - # The build assumes the host has libiberty and such when cross-compiling
517 - # its build tools. We should probably make binutils itself build a local
518 - # copy to use, but until then, be lazy.
519 - DEPEND+=" >=sys-libs/binutils-libs-${PV}"
520 -fi
521 -
522 -MY_BUILDDIR=${WORKDIR}/build
523 -S=${WORKDIR}/${P/-hppa64/}
524 -
525 -src_unpack() {
526 - case ${PV} in
527 - 9999)
528 - git-r3_src_unpack;
529 - ;;
530 - *)
531 - default
532 - ;;
533 - esac
534 - mkdir -p "${MY_BUILDDIR}"
535 -}
536 -
537 -src_prepare() {
538 - if [[ ! -z ${PATCH_VER} ]] ; then
539 - einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
540 - eapply "${WORKDIR}/patch"/*.patch
541 - fi
542 -
543 - # This check should probably go somewhere else, like pkg_pretend.
544 - if [[ ${CTARGET} == *-uclibc* ]] ; then
545 - if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
546 - die "sorry, but this binutils doesn't yet support uClibc :("
547 - fi
548 - fi
549 -
550 - # Make sure our explicit libdir paths don't get clobbered. #562460
551 - sed -i \
552 - -e 's:@bfdlibdir@:@libdir@:g' \
553 - -e 's:@bfdincludedir@:@includedir@:g' \
554 - {bfd,opcodes}/Makefile.in || die
555 -
556 - # Fix locale issues if possible #122216
557 - if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
558 - einfo "Fixing misc issues in configure files"
559 - for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
560 - ebegin " Updating ${f/${S}\/}"
561 - patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
562 - || eerror "Please file a bug about this"
563 - eend $?
564 - done
565 - fi
566 -
567 - # Fix conflicts with newer glibc #272594
568 - if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
569 - sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
570 - fi
571 -
572 - # Apply things from PATCHES and user dirs
573 - default
574 -
575 - # Run misc portage update scripts
576 - gnuconfig_update
577 - elibtoolize --portage --no-uclibc
578 -}
579 -
580 -toolchain-binutils_bugurl() {
581 - printf "https://bugs.gentoo.org/"
582 -}
583 -toolchain-binutils_pkgversion() {
584 - printf "Gentoo ${BVER}"
585 - [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
586 -}
587 -
588 -src_configure() {
589 - # Setup some paths
590 - LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER}
591 - INCPATH=${LIBPATH}/include
592 - DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER}
593 - if is_cross ; then
594 - BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER}
595 - else
596 - BINPATH=/usr/${CTARGET}/binutils-bin/${BVER}
597 - fi
598 -
599 - # Make sure we filter $LINGUAS so that only ones that
600 - # actually work make it through #42033
601 - strip-linguas -u */po
602 -
603 - # Keep things sane
604 - strip-flags
605 -
606 - local x
607 - echo
608 - for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
609 - einfo "$(printf '%10s' ${x}:) ${!x}"
610 - done
611 - echo
612 -
613 - cd "${MY_BUILDDIR}"
614 - local myconf=()
615 -
616 - # enable gold (installed as ld.gold) and ld's plugin architecture
617 - if use cxx ; then
618 - myconf+=( --enable-gold )
619 - myconf+=( --enable-plugins )
620 - fi
621 -
622 - if use nls ; then
623 - myconf+=( --without-included-gettext )
624 - else
625 - myconf+=( --disable-nls )
626 - fi
627 -
628 - myconf+=( --with-system-zlib )
629 -
630 - # For bi-arch systems, enable a 64bit bfd. This matches
631 - # the bi-arch logic in toolchain.eclass. #446946
632 - # We used to do it for everyone, but it's slow on 32bit arches. #438522
633 - case $(tc-arch) in
634 - ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
635 - esac
636 -
637 - use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
638 -
639 - [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
640 -
641 - is_cross && myconf+=(
642 - --with-sysroot="${EPREFIX}"/usr/${CTARGET}
643 - --enable-poison-system-directories
644 - )
645 -
646 - # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
647 - # on everyone in alpha (for now), we'll just enable it when possible
648 - has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
649 - has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
650 -
651 - # mips can't do hash-style=gnu ...
652 - if [[ $(tc-arch) != mips ]] ; then
653 - myconf+=( --enable-default-hash-style=gnu )
654 - fi
655 -
656 - myconf+=(
657 - --prefix="${EPREFIX}"/usr
658 - --host=${CHOST}
659 - --target=${CTARGET}
660 - --datadir="${EPREFIX}"${DATAPATH}
661 - --datarootdir="${EPREFIX}"${DATAPATH}
662 - --infodir="${EPREFIX}"${DATAPATH}/info
663 - --mandir="${EPREFIX}"${DATAPATH}/man
664 - --bindir="${EPREFIX}"${BINPATH}
665 - --libdir="${EPREFIX}"${LIBPATH}
666 - --libexecdir="${EPREFIX}"${LIBPATH}
667 - --includedir="${EPREFIX}"${INCPATH}
668 - --enable-obsolete
669 - --enable-shared
670 - --enable-threads
671 - # Newer versions (>=2.27) offer a configure flag now.
672 - --enable-relro
673 - # Newer versions (>=2.24) make this an explicit option. #497268
674 - --enable-install-libiberty
675 - --disable-werror
676 - --with-bugurl="$(toolchain-binutils_bugurl)"
677 - --with-pkgversion="$(toolchain-binutils_pkgversion)"
678 - $(use_enable static-libs static)
679 - ${EXTRA_ECONF}
680 - # Disable modules that are in a combined binutils/gdb tree. #490566
681 - --disable-{gdb,libdecnumber,readline,sim}
682 - # Strip out broken static link flags.
683 - # https://gcc.gnu.org/PR56750
684 - --without-stage1-ldflags
685 - )
686 - echo ./configure "${myconf[@]}"
687 - "${S}"/configure "${myconf[@]}" || die
688 -
689 - # Prevent makeinfo from running if doc is unset.
690 - if ! use doc ; then
691 - sed -i \
692 - -e '/^MAKEINFO/s:=.*:= true:' \
693 - Makefile || die
694 - fi
695 -}
696 -
697 -src_compile() {
698 - cd "${MY_BUILDDIR}"
699 - emake all
700 -
701 - # only build info pages if the user wants them
702 - if use doc ; then
703 - emake info
704 - fi
705 -
706 - # we nuke the manpages when we're left with junk
707 - # (like when we bootstrap, no perl -> no manpages)
708 - find . -name '*.1' -a -size 0 -delete
709 -}
710 -
711 -src_test() {
712 - cd "${MY_BUILDDIR}"
713 - emake -k check
714 -}
715 -
716 -src_install() {
717 - local x d
718 -
719 - cd "${MY_BUILDDIR}"
720 - emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
721 - rm -rf "${ED}"/${LIBPATH}/bin
722 - use static-libs || find "${ED}" -name '*.la' -delete
723 -
724 - # Newer versions of binutils get fancy with ${LIBPATH} #171905
725 - cd "${ED}"/${LIBPATH}
726 - for d in ../* ; do
727 - [[ ${d} == ../${BVER} ]] && continue
728 - mv ${d}/* . || die
729 - rmdir ${d} || die
730 - done
731 -
732 - # Now we collect everything intp the proper SLOT-ed dirs
733 - # When something is built to cross-compile, it installs into
734 - # /usr/$CHOST/ by default ... we have to 'fix' that :)
735 - if is_cross ; then
736 - cd "${ED}"/${BINPATH}
737 - for x in * ; do
738 - mv ${x} ${x/${CTARGET}-}
739 - done
740 -
741 - if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
742 - mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
743 - mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
744 - rm -r "${ED}"/usr/${CHOST}/{include,lib}
745 - fi
746 - fi
747 - insinto ${INCPATH}
748 - local libiberty_headers=(
749 - # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
750 - demangle.h
751 - dyn-string.h
752 - fibheap.h
753 - hashtab.h
754 - libiberty.h
755 - objalloc.h
756 - splay-tree.h
757 - )
758 - doins "${libiberty_headers[@]/#/${S}/include/}" || die
759 - if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
760 - mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
761 - rm -r "${ED}"/${LIBPATH}/lib
762 - fi
763 -
764 - # Generate an env.d entry for this binutils
765 - insinto /etc/env.d/binutils
766 - cat <<-EOF > "${T}"/env.d
767 - TARGET="${CTARGET}"
768 - VER="${BVER}"
769 - LIBPATH="${EPREFIX}${LIBPATH}"
770 - EOF
771 - newins "${T}"/env.d ${CTARGET}-${BVER}
772 -
773 - # Handle documentation
774 - if ! is_cross ; then
775 - cd "${S}"
776 - dodoc README
777 - docinto bfd
778 - dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
779 - docinto binutils
780 - dodoc binutils/ChangeLog binutils/NEWS binutils/README
781 - docinto gas
782 - dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
783 - docinto gprof
784 - dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
785 - docinto ld
786 - dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
787 - docinto libiberty
788 - dodoc libiberty/ChangeLog* libiberty/README
789 - docinto opcodes
790 - dodoc opcodes/ChangeLog*
791 - fi
792 -
793 - # Remove shared info pages
794 - rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
795 -
796 - # Trim all empty dirs
797 - find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
798 -
799 - # the hppa64 hack; this should go into 9999 as a PN-conditional
800 - # tweak the default fake list a little bit
801 - cd "${D}"/etc/env.d/binutils
802 - sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
803 -}
804 -
805 -pkg_postinst() {
806 - # Make sure this ${CTARGET} has a binutils version selected
807 - [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
808 - binutils-config ${CTARGET}-${BVER}
809 -}
810 -
811 -pkg_postrm() {
812 - local current_profile=$(binutils-config -c ${CTARGET})
813 -
814 - # If no other versions exist, then uninstall for this
815 - # target ... otherwise, switch to the newest version
816 - # Note: only do this if this version is unmerged. We
817 - # rerun binutils-config if this is a remerge, as
818 - # we want the mtimes on the symlinks updated (if
819 - # it is the same as the current selected profile)
820 - if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${BVER} ]] ; then
821 - local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
822 - choice=${choice//$'\n'/ }
823 - choice=${choice/* }
824 - if [[ -z ${choice} ]] ; then
825 - binutils-config -u ${CTARGET}
826 - else
827 - binutils-config ${choice}
828 - fi
829 - elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${BVER} ]] ; then
830 - binutils-config ${CTARGET}-${BVER}
831 - fi
832 -}