1 |
commit: 35565322d84de69e9af61fe8e752f7f1d83979f0 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 16 12:28:16 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 16 12:28:34 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35565322 |
7 |
|
8 |
sys-devel/binutils-hppa64: bump up to 2.32, patchset 1 |
9 |
|
10 |
Initial patchset is based on current binutils-2.32 branch. |
11 |
|
12 |
Reported-by: Lars Wendler |
13 |
Bug: https://bugs.gentoo.org/677342 |
14 |
Package-Manager: Portage-2.3.60, Repoman-2.3.12 |
15 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
16 |
|
17 |
sys-devel/binutils-hppa64/Manifest | 2 + |
18 |
.../binutils-hppa64/binutils-hppa64-2.32.ebuild | 442 +++++++++++++++++++++ |
19 |
sys-devel/binutils-hppa64/metadata.xml | 27 +- |
20 |
3 files changed, 461 insertions(+), 10 deletions(-) |
21 |
|
22 |
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest |
23 |
index e6a949ca441..576a005fc35 100644 |
24 |
--- a/sys-devel/binutils-hppa64/Manifest |
25 |
+++ b/sys-devel/binutils-hppa64/Manifest |
26 |
@@ -16,3 +16,5 @@ DIST binutils-2.30-patches-5.tar.xz 590864 BLAKE2B 71de4d08f92ab1898ad576a21763f |
27 |
DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839 |
28 |
DIST binutils-2.31.1-patches-5.tar.xz 65896 BLAKE2B 7fb2c4c71336a77f3fef57a0430c511ef7326f8196d8f3a57a6d56aed464953172eeb0755f020387739cf27f709d0bc3de9c3c8b972a94f1480639465158e180 SHA512 c254f22b8ca662cf49cd5fc076d3e9b82d7f421420408c960c54310fc49462600325e7bc50f863cab7c8c49caebac3ac353dc24ab5947e8f01b98c11f43f57d2 |
29 |
DIST binutils-2.31.1.tar.xz 20467996 BLAKE2B 6b914df1fbb7cf54f2159f71b2c2b09f3f6a569b7a3cb4cf9790d0a3733a7548bc0ea32334a178ed3b56e8b97656ae99c7abaf212601beeaeae9a0884c0f6051 SHA512 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30 |
30 |
+DIST binutils-2.32-patches-1.tar.xz 93252 BLAKE2B 80d229be60c3377fe52ff3e74ee911b5dcfb9456d3f42a57662fbda3184ac1c63e698e592f804ac05c459527d0cd4bae7d8c9ef8caef02fdf4f17aa783f4ff81 SHA512 69999f60d89589dcf9e3cb18e50f153ab4ce05bdf3f3758fa322b5c4cb468aeda46c416da540995ddff1ea5e96354c264fa5ff0156c53685816d35117eb481e0 |
31 |
+DIST binutils-2.32.tar.xz 20774880 BLAKE2B d1bdbd9c8487c091665c197974ce4bdf520b7a67ed6997a81b87e6a0af9514a091458244f583acec5ae580ac2ee5e908f67f483b8e5263cd18ced794cb235da6 SHA512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a |
32 |
|
33 |
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.32.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.32.ebuild |
34 |
new file mode 100644 |
35 |
index 00000000000..c4ccb4ffd3b |
36 |
--- /dev/null |
37 |
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.32.ebuild |
38 |
@@ -0,0 +1,442 @@ |
39 |
+# Copyright 1999-2019 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+EAPI=6 |
43 |
+ |
44 |
+export CTARGET=hppa64-${CHOST#*-} |
45 |
+ |
46 |
+inherit eutils libtool flag-o-matic gnuconfig multilib versionator |
47 |
+ |
48 |
+DESCRIPTION="Tools necessary to build programs" |
49 |
+HOMEPAGE="https://sourceware.org/binutils/" |
50 |
+LICENSE="GPL-3+" |
51 |
+# USE="+cxx" is a transitional flag until llvm migrates to new flags: |
52 |
+# bug #677888 |
53 |
+IUSE="+cxx default-gold doc +gold multitarget +nls +plugins static-libs test" |
54 |
+REQUIRED_USE="cxx? ( gold plugins ) default-gold? ( gold )" |
55 |
+ |
56 |
+# Variables that can be set here: |
57 |
+# PATCH_VER - the patchset version |
58 |
+# Default: empty, no patching |
59 |
+# PATCH_BINUTILS_VER - the binutils version in the patchset name |
60 |
+# - Default: PV |
61 |
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/... |
62 |
+# for the patchsets |
63 |
+# Default: slyfox |
64 |
+ |
65 |
+PATCH_VER=1 |
66 |
+PATCH_DEV=slyfox |
67 |
+ |
68 |
+case ${PV} in |
69 |
+ 9999) |
70 |
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git" |
71 |
+ inherit git-r3 |
72 |
+ S=${WORKDIR}/binutils |
73 |
+ EGIT_CHECKOUT_DIR=${S} |
74 |
+ SLOT=${PV} |
75 |
+ ;; |
76 |
+ *.9999) |
77 |
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git" |
78 |
+ inherit git-r3 |
79 |
+ S=${WORKDIR}/binutils |
80 |
+ EGIT_CHECKOUT_DIR=${S} |
81 |
+ EGIT_BRANCH=$(get_version_component_range 1-2) |
82 |
+ EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch" |
83 |
+ SLOT=$(get_version_component_range 1-2) |
84 |
+ ;; |
85 |
+ *) |
86 |
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz" |
87 |
+ SLOT=$(get_version_component_range 1-2) |
88 |
+ # no keywords yet. Needs some testing |
89 |
+ #KEYWORDS="-* ~hppa" |
90 |
+ ;; |
91 |
+esac |
92 |
+ |
93 |
+# |
94 |
+# The Gentoo patchset |
95 |
+# |
96 |
+PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}} |
97 |
+PATCH_DEV=${PATCH_DEV:-slyfox} |
98 |
+ |
99 |
+[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI} |
100 |
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz" |
101 |
+ |
102 |
+# |
103 |
+# The cross-compile logic |
104 |
+# |
105 |
+export CTARGET=${CTARGET:-${CHOST}} |
106 |
+if [[ ${CTARGET} == ${CHOST} ]] ; then |
107 |
+ if [[ ${CATEGORY} == cross-* ]] ; then |
108 |
+ export CTARGET=${CATEGORY#cross-} |
109 |
+ fi |
110 |
+fi |
111 |
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } |
112 |
+ |
113 |
+# |
114 |
+# The dependencies |
115 |
+# |
116 |
+RDEPEND=" |
117 |
+ >=sys-devel/binutils-config-3 |
118 |
+ sys-libs/zlib |
119 |
+" |
120 |
+DEPEND="${RDEPEND} |
121 |
+ doc? ( sys-apps/texinfo ) |
122 |
+ test? ( dev-util/dejagnu ) |
123 |
+ nls? ( sys-devel/gettext ) |
124 |
+ sys-devel/flex |
125 |
+ virtual/yacc |
126 |
+" |
127 |
+ |
128 |
+MY_BUILDDIR=${WORKDIR}/build |
129 |
+S=${WORKDIR}/${P/-hppa64/} |
130 |
+ |
131 |
+src_unpack() { |
132 |
+ case ${PV} in |
133 |
+ *9999) |
134 |
+ git-r3_src_unpack |
135 |
+ ;; |
136 |
+ *) |
137 |
+ ;; |
138 |
+ esac |
139 |
+ default |
140 |
+ mkdir -p "${MY_BUILDDIR}" |
141 |
+} |
142 |
+ |
143 |
+src_prepare() { |
144 |
+ if [[ ! -z ${PATCH_VER} ]] ; then |
145 |
+ # Use upstream patch to enable development mode |
146 |
+ rm -v "${WORKDIR}/patch"/0000-Gentoo-Git-is-development.patch || die |
147 |
+ einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}" |
148 |
+ eapply "${WORKDIR}/patch"/*.patch |
149 |
+ fi |
150 |
+ |
151 |
+ # This check should probably go somewhere else, like pkg_pretend. |
152 |
+ if [[ ${CTARGET} == *-uclibc* ]] ; then |
153 |
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then |
154 |
+ die "sorry, but this binutils doesn't yet support uClibc :(" |
155 |
+ fi |
156 |
+ fi |
157 |
+ |
158 |
+ # Make sure our explicit libdir paths don't get clobbered. #562460 |
159 |
+ sed -i \ |
160 |
+ -e 's:@bfdlibdir@:@libdir@:g' \ |
161 |
+ -e 's:@bfdincludedir@:@includedir@:g' \ |
162 |
+ {bfd,opcodes}/Makefile.in || die |
163 |
+ |
164 |
+ # Fix locale issues if possible #122216 |
165 |
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then |
166 |
+ einfo "Fixing misc issues in configure files" |
167 |
+ for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do |
168 |
+ ebegin " Updating ${f/${S}\/}" |
169 |
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \ |
170 |
+ || eerror "Please file a bug about this" |
171 |
+ eend $? |
172 |
+ done |
173 |
+ fi |
174 |
+ |
175 |
+ # Fix conflicts with newer glibc #272594 |
176 |
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then |
177 |
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c |
178 |
+ fi |
179 |
+ |
180 |
+ # Apply things from PATCHES and user dirs |
181 |
+ default |
182 |
+ |
183 |
+ # Run misc portage update scripts |
184 |
+ gnuconfig_update |
185 |
+ elibtoolize --portage --no-uclibc |
186 |
+} |
187 |
+ |
188 |
+toolchain-binutils_bugurl() { |
189 |
+ printf "https://bugs.gentoo.org/" |
190 |
+} |
191 |
+toolchain-binutils_pkgversion() { |
192 |
+ printf "Gentoo ${PV}" |
193 |
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}" |
194 |
+} |
195 |
+ |
196 |
+src_configure() { |
197 |
+ # Setup some paths |
198 |
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV} |
199 |
+ INCPATH=${LIBPATH}/include |
200 |
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV} |
201 |
+ if is_cross ; then |
202 |
+ TOOLPATH=/usr/${CHOST}/${CTARGET} |
203 |
+ else |
204 |
+ TOOLPATH=/usr/${CTARGET} |
205 |
+ fi |
206 |
+ BINPATH=${TOOLPATH}/binutils-bin/${PV} |
207 |
+ |
208 |
+ # Make sure we filter $LINGUAS so that only ones that |
209 |
+ # actually work make it through #42033 |
210 |
+ strip-linguas -u */po |
211 |
+ |
212 |
+ # Keep things sane |
213 |
+ strip-flags |
214 |
+ |
215 |
+ local x |
216 |
+ echo |
217 |
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do |
218 |
+ einfo "$(printf '%10s' ${x}:) ${!x}" |
219 |
+ done |
220 |
+ echo |
221 |
+ |
222 |
+ cd "${MY_BUILDDIR}" |
223 |
+ local myconf=() |
224 |
+ |
225 |
+ if use plugins ; then |
226 |
+ myconf+=( --enable-plugins ) |
227 |
+ fi |
228 |
+ # enable gold (installed as ld.gold) and ld's plugin architecture |
229 |
+ if use gold ; then |
230 |
+ myconf+=( --enable-gold ) |
231 |
+ if use default-gold; then |
232 |
+ myconf+=( --enable-gold=default ) |
233 |
+ fi |
234 |
+ fi |
235 |
+ |
236 |
+ if use nls ; then |
237 |
+ myconf+=( --without-included-gettext ) |
238 |
+ else |
239 |
+ myconf+=( --disable-nls ) |
240 |
+ fi |
241 |
+ |
242 |
+ myconf+=( --with-system-zlib ) |
243 |
+ |
244 |
+ # For bi-arch systems, enable a 64bit bfd. This matches |
245 |
+ # the bi-arch logic in toolchain.eclass. #446946 |
246 |
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522 |
247 |
+ case $(tc-arch) in |
248 |
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;; |
249 |
+ esac |
250 |
+ |
251 |
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd ) |
252 |
+ |
253 |
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} ) |
254 |
+ |
255 |
+ is_cross && myconf+=( |
256 |
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET} |
257 |
+ --enable-poison-system-directories |
258 |
+ ) |
259 |
+ |
260 |
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+ |
261 |
+ # on everyone in alpha (for now), we'll just enable it when possible |
262 |
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt ) |
263 |
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt ) |
264 |
+ |
265 |
+ # mips can't do hash-style=gnu ... |
266 |
+ if [[ $(tc-arch) != mips ]] ; then |
267 |
+ myconf+=( --enable-default-hash-style=gnu ) |
268 |
+ fi |
269 |
+ |
270 |
+ myconf+=( |
271 |
+ --prefix="${EPREFIX}"/usr |
272 |
+ --host=${CHOST} |
273 |
+ --target=${CTARGET} |
274 |
+ --datadir="${EPREFIX}"${DATAPATH} |
275 |
+ --datarootdir="${EPREFIX}"${DATAPATH} |
276 |
+ --infodir="${EPREFIX}"${DATAPATH}/info |
277 |
+ --mandir="${EPREFIX}"${DATAPATH}/man |
278 |
+ --bindir="${EPREFIX}"${BINPATH} |
279 |
+ --libdir="${EPREFIX}"${LIBPATH} |
280 |
+ --libexecdir="${EPREFIX}"${LIBPATH} |
281 |
+ --includedir="${EPREFIX}"${INCPATH} |
282 |
+ --enable-obsolete |
283 |
+ --enable-shared |
284 |
+ --enable-threads |
285 |
+ # Newer versions (>=2.27) offer a configure flag now. |
286 |
+ --enable-relro |
287 |
+ # Newer versions (>=2.24) make this an explicit option. #497268 |
288 |
+ --enable-install-libiberty |
289 |
+ --disable-werror |
290 |
+ --with-bugurl="$(toolchain-binutils_bugurl)" |
291 |
+ --with-pkgversion="$(toolchain-binutils_pkgversion)" |
292 |
+ $(use_enable static-libs static) |
293 |
+ ${EXTRA_ECONF} |
294 |
+ # Disable modules that are in a combined binutils/gdb tree. #490566 |
295 |
+ --disable-{gdb,libdecnumber,readline,sim} |
296 |
+ # Strip out broken static link flags. |
297 |
+ # https://gcc.gnu.org/PR56750 |
298 |
+ --without-stage1-ldflags |
299 |
+ # Change SONAME to avoid conflict across |
300 |
+ # {native,cross}/binutils, binutils-libs. #666100 |
301 |
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st) |
302 |
+ ) |
303 |
+ echo ./configure "${myconf[@]}" |
304 |
+ "${S}"/configure "${myconf[@]}" || die |
305 |
+ |
306 |
+ # Prevent makeinfo from running if doc is unset. |
307 |
+ if ! use doc ; then |
308 |
+ sed -i \ |
309 |
+ -e '/^MAKEINFO/s:=.*:= true:' \ |
310 |
+ Makefile || die |
311 |
+ fi |
312 |
+} |
313 |
+ |
314 |
+src_compile() { |
315 |
+ cd "${MY_BUILDDIR}" |
316 |
+ # see Note [tooldir hack for ldscripts] |
317 |
+ emake tooldir="${EPREFIX}${TOOLPATH}" all |
318 |
+ |
319 |
+ # only build info pages if the user wants them |
320 |
+ if use doc ; then |
321 |
+ emake info |
322 |
+ fi |
323 |
+ |
324 |
+ # we nuke the manpages when we're left with junk |
325 |
+ # (like when we bootstrap, no perl -> no manpages) |
326 |
+ find . -name '*.1' -a -size 0 -delete |
327 |
+} |
328 |
+ |
329 |
+src_test() { |
330 |
+ cd "${MY_BUILDDIR}" |
331 |
+ # bug 637066 |
332 |
+ filter-flags -Wall -Wreturn-type |
333 |
+ emake -k check |
334 |
+} |
335 |
+ |
336 |
+src_install() { |
337 |
+ local x d |
338 |
+ |
339 |
+ cd "${MY_BUILDDIR}" |
340 |
+ # see Note [tooldir hack for ldscripts] |
341 |
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install |
342 |
+ rm -rf "${ED}"/${LIBPATH}/bin |
343 |
+ use static-libs || find "${ED}" -name '*.la' -delete |
344 |
+ |
345 |
+ # Newer versions of binutils get fancy with ${LIBPATH} #171905 |
346 |
+ cd "${ED}"/${LIBPATH} |
347 |
+ for d in ../* ; do |
348 |
+ [[ ${d} == ../${PV} ]] && continue |
349 |
+ mv ${d}/* . || die |
350 |
+ rmdir ${d} || die |
351 |
+ done |
352 |
+ |
353 |
+ # Now we collect everything intp the proper SLOT-ed dirs |
354 |
+ # When something is built to cross-compile, it installs into |
355 |
+ # /usr/$CHOST/ by default ... we have to 'fix' that :) |
356 |
+ if is_cross ; then |
357 |
+ cd "${ED}"/${BINPATH} |
358 |
+ for x in * ; do |
359 |
+ mv ${x} ${x/${CTARGET}-} |
360 |
+ done |
361 |
+ |
362 |
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then |
363 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH} |
364 |
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/ |
365 |
+ rm -r "${ED}"/usr/${CHOST}/{include,lib} |
366 |
+ fi |
367 |
+ fi |
368 |
+ insinto ${INCPATH} |
369 |
+ local libiberty_headers=( |
370 |
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir. |
371 |
+ demangle.h |
372 |
+ dyn-string.h |
373 |
+ fibheap.h |
374 |
+ hashtab.h |
375 |
+ libiberty.h |
376 |
+ objalloc.h |
377 |
+ splay-tree.h |
378 |
+ ) |
379 |
+ doins "${libiberty_headers[@]/#/${S}/include/}" || die |
380 |
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then |
381 |
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ |
382 |
+ rm -r "${ED}"/${LIBPATH}/lib |
383 |
+ fi |
384 |
+ |
385 |
+ # Generate an env.d entry for this binutils |
386 |
+ insinto /etc/env.d/binutils |
387 |
+ cat <<-EOF > "${T}"/env.d |
388 |
+ TARGET="${CTARGET}" |
389 |
+ VER="${PV}" |
390 |
+ LIBPATH="${EPREFIX}${LIBPATH}" |
391 |
+ EOF |
392 |
+ newins "${T}"/env.d ${CTARGET}-${PV} |
393 |
+ |
394 |
+ # Handle documentation |
395 |
+ if ! is_cross ; then |
396 |
+ cd "${S}" |
397 |
+ dodoc README |
398 |
+ docinto bfd |
399 |
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO |
400 |
+ docinto binutils |
401 |
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README |
402 |
+ docinto gas |
403 |
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README* |
404 |
+ docinto gprof |
405 |
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl |
406 |
+ docinto ld |
407 |
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO |
408 |
+ docinto libiberty |
409 |
+ dodoc libiberty/ChangeLog* libiberty/README |
410 |
+ docinto opcodes |
411 |
+ dodoc opcodes/ChangeLog* |
412 |
+ fi |
413 |
+ |
414 |
+ # Remove shared info pages |
415 |
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} |
416 |
+ |
417 |
+ # Trim all empty dirs |
418 |
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null |
419 |
+ |
420 |
+ # the hppa64 hack; this should go into 9999 as a PN-conditional |
421 |
+ # tweak the default fake list a little bit |
422 |
+ cd "${D}"/etc/env.d/binutils |
423 |
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die |
424 |
+} |
425 |
+ |
426 |
+pkg_postinst() { |
427 |
+ # Make sure this ${CTARGET} has a binutils version selected |
428 |
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 |
429 |
+ binutils-config ${CTARGET}-${PV} |
430 |
+} |
431 |
+ |
432 |
+pkg_postrm() { |
433 |
+ local current_profile=$(binutils-config -c ${CTARGET}) |
434 |
+ |
435 |
+ # If no other versions exist, then uninstall for this |
436 |
+ # target ... otherwise, switch to the newest version |
437 |
+ # Note: only do this if this version is unmerged. We |
438 |
+ # rerun binutils-config if this is a remerge, as |
439 |
+ # we want the mtimes on the symlinks updated (if |
440 |
+ # it is the same as the current selected profile) |
441 |
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then |
442 |
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}') |
443 |
+ choice=${choice//$'\n'/ } |
444 |
+ choice=${choice/* } |
445 |
+ if [[ -z ${choice} ]] ; then |
446 |
+ binutils-config -u ${CTARGET} |
447 |
+ else |
448 |
+ binutils-config ${choice} |
449 |
+ fi |
450 |
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then |
451 |
+ binutils-config ${CTARGET}-${PV} |
452 |
+ fi |
453 |
+} |
454 |
+# Note [slotting support] |
455 |
+# ----------------------- |
456 |
+# Gentoo's layout for binutils files is non-standard as Gentoo |
457 |
+# supports slotted installation for binutils. Many tools |
458 |
+# still expect binutils to reside in known locations. |
459 |
+# binutils-config package restores symlinks into known locations, |
460 |
+# like: |
461 |
+# /usr/bin/${CTARGET}-<tool> |
462 |
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips |
463 |
+# /usr/include/ |
464 |
+# |
465 |
+# Note [tooldir hack for ldscripts] |
466 |
+# --------------------------------- |
467 |
+# Build system does not allow ./configure to tweak every location |
468 |
+# we need for slotting binutils hence all the shuffling in |
469 |
+# src_install(). This note is about SCRIPTDIR define handling. |
470 |
+# |
471 |
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value |
472 |
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib' |
473 |
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time. |
474 |
+# Thus we can't just move files around after compilation finished. |
475 |
+# |
476 |
+# Our goal is the following: |
477 |
+# - at build-time set scriptdir to point to symlinked location: |
478 |
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case) |
479 |
+# - at install-time set scriptdir to point to slotted location: |
480 |
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV} |
481 |
|
482 |
diff --git a/sys-devel/binutils-hppa64/metadata.xml b/sys-devel/binutils-hppa64/metadata.xml |
483 |
index 40dbc384a3e..b8008c10fae 100644 |
484 |
--- a/sys-devel/binutils-hppa64/metadata.xml |
485 |
+++ b/sys-devel/binutils-hppa64/metadata.xml |
486 |
@@ -1,14 +1,21 @@ |
487 |
<?xml version="1.0" encoding="UTF-8"?> |
488 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
489 |
<pkgmetadata> |
490 |
-<maintainer type="project"> |
491 |
- <email>hppa@g.o</email> |
492 |
- <name>Gentoo Linux HPPA Development</name> |
493 |
-</maintainer> |
494 |
-<longdescription> |
495 |
-binutils for 64bit kernel on hppa. |
496 |
-</longdescription> |
497 |
-<use> |
498 |
- <flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag> |
499 |
-</use> |
500 |
+ <maintainer type="project"> |
501 |
+ <email>hppa@g.o</email> |
502 |
+ <name>Gentoo Linux HPPA Development</name> |
503 |
+ </maintainer> |
504 |
+ <maintainer type="project"> |
505 |
+ <email>toolchain@g.o</email> |
506 |
+ <name>Gentoo Toolchain Project</name> |
507 |
+ </maintainer> |
508 |
+ <longdescription> |
509 |
+ binutils for 64bit kernel on hppa. |
510 |
+ </longdescription> |
511 |
+ <use> |
512 |
+ <flag name="default-gold">Set ld to point to ld.gold instead of ld.bfd</flag> |
513 |
+ <flag name="gold">Build ld.gold linker</flag> |
514 |
+ <flag name="plugins">Enable plugin support in tools</flag> |
515 |
+ <flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag> |
516 |
+ </use> |
517 |
</pkgmetadata> |