1 |
commit: 0354a974002823c2a8e987d49607fc0cdcf79ad1 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 28 13:44:55 2018 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 28 14:23:06 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0354a974 |
7 |
|
8 |
sys-devel/binutils-hppa64: Version bump |
9 |
|
10 |
Package-Manager: Portage-2.3.20, Repoman-2.3.6 |
11 |
|
12 |
sys-devel/binutils-hppa64/Manifest | 2 + |
13 |
.../binutils-hppa64/binutils-hppa64-2.30.ebuild | 392 +++++++++++++++++++++ |
14 |
2 files changed, 394 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest |
17 |
index 2144a9c9b22..4dceb00bfc5 100644 |
18 |
--- a/sys-devel/binutils-hppa64/Manifest |
19 |
+++ b/sys-devel/binutils-hppa64/Manifest |
20 |
@@ -24,3 +24,5 @@ DIST binutils-2.29-patches-1.0.tar.xz 7548 BLAKE2B b5365ba6849f8809528ed13ce0b0e |
21 |
DIST binutils-2.29.1-patches-2.tar.xz 18528 BLAKE2B 514496d6c9609362782d66b6cecbe3fe617f96dfb86e174a80d0b9113cbd4fce9d760fa61660ba2cfafbe1e482e955391cb8d3ef78d2c166c82796416a7ee106 SHA512 b60a3af9cd6a681f32a59fc4a30602ee1290f75cc93c8ad38ab0de17a7f30538a751b801dbaf079e3d514b9671e34e91742c4c9c953a8c9794505b571b7e80f0 |
22 |
DIST binutils-2.29.1.tar.bz2 29123355 BLAKE2B 83de518a27bae0f13c57b1979493dd7f7cabae424cff5e8495d1f064da24b6ef9e1c19d1d1adad2dca7142372782023f66b4b4223170a49b96ba3834266fe878 SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592 |
23 |
DIST binutils-2.29.tar.bz2 29073316 BLAKE2B 0eb7bbefa1ac5f4d753ca9328d339a466d4f75c69d5d860802aded8e42ce4293f65c72a0f0596b170e90e1cc3ded23ea30576948cb875eea044cb02bb55bb2d3 SHA512 8148587d7e4f14ebcbcb3f984b116deaae5d4008228628acde14bc242a64a4b53faf1f6077a2c4ca4750e2f254b698ba506bd657f79e1202e87e7029b0069337 |
24 |
+DIST binutils-2.30-patches-1.tar.xz 13884 BLAKE2B 86d160144e4ae3213838ccd07d008a96f210dbe8d894f2043420bd0003f8e0611564f77dadf60780da61278bbac41130922703fef69ba8ac451bcae5d9c65cf4 SHA512 cf38328bac920c1159e73727a9bb46bd462fa60650c90ee8a3d6221d447c678fdd79c6886efc52e35897d535dd717c1dc363bcb3f201aacd15ace078694456da |
25 |
+DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839 |
26 |
|
27 |
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.30.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.30.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..d0aeded72c5 |
30 |
--- /dev/null |
31 |
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.30.ebuild |
32 |
@@ -0,0 +1,392 @@ |
33 |
+# Copyright 1999-2018 Gentoo Foundation |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI=6 |
37 |
+ |
38 |
+export CTARGET=hppa64-${CHOST#*-} |
39 |
+ |
40 |
+inherit eutils libtool flag-o-matic gnuconfig multilib versionator |
41 |
+ |
42 |
+DESCRIPTION="Tools necessary to build programs" |
43 |
+HOMEPAGE="https://sourceware.org/binutils/" |
44 |
+LICENSE="GPL-3+" |
45 |
+IUSE="+cxx doc multitarget +nls static-libs test" |
46 |
+ |
47 |
+# Variables that can be set here: |
48 |
+# PATCH_VER - the patchset version |
49 |
+# Default: empty, no patching |
50 |
+# PATCH_BINUTILS_VER - the binutils version in the patchset name |
51 |
+# - Default: PV |
52 |
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/... |
53 |
+# for the patchsets |
54 |
+# Default: dilfridge :) |
55 |
+ |
56 |
+PATCH_VER=1 |
57 |
+ |
58 |
+case ${PV} in |
59 |
+ 9999) |
60 |
+ BVER="git" |
61 |
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git" |
62 |
+ inherit git-r3 |
63 |
+ S=${WORKDIR}/binutils |
64 |
+ EGIT_CHECKOUT_DIR=${S} |
65 |
+ ;; |
66 |
+ *) |
67 |
+ BVER=${PV} |
68 |
+ SRC_URI="mirror://gnu/binutils/binutils-${BVER}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${BVER}.tar.xz" |
69 |
+ ;; |
70 |
+esac |
71 |
+SLOT="${BVER}" |
72 |
+#KEYWORDS="-* ~hppa" |
73 |
+ |
74 |
+# |
75 |
+# The Gentoo patchset |
76 |
+# |
77 |
+PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${BVER}} |
78 |
+PATCH_DEV=${PATCH_DEV:-dilfridge} |
79 |
+ |
80 |
+[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI} |
81 |
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz" |
82 |
+ |
83 |
+# |
84 |
+# The cross-compile logic |
85 |
+# |
86 |
+export CTARGET=${CTARGET:-${CHOST}} |
87 |
+if [[ ${CTARGET} == ${CHOST} ]] ; then |
88 |
+ if [[ ${CATEGORY} == cross-* ]] ; then |
89 |
+ export CTARGET=${CATEGORY#cross-} |
90 |
+ fi |
91 |
+fi |
92 |
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } |
93 |
+ |
94 |
+# |
95 |
+# The dependencies |
96 |
+# |
97 |
+RDEPEND=" |
98 |
+ >=sys-devel/binutils-config-3 |
99 |
+ sys-libs/zlib |
100 |
+" |
101 |
+DEPEND="${RDEPEND} |
102 |
+ doc? ( sys-apps/texinfo ) |
103 |
+ test? ( dev-util/dejagnu ) |
104 |
+ nls? ( sys-devel/gettext ) |
105 |
+ sys-devel/flex |
106 |
+ virtual/yacc |
107 |
+" |
108 |
+if is_cross ; then |
109 |
+ # The build assumes the host has libiberty and such when cross-compiling |
110 |
+ # its build tools. We should probably make binutils itself build a local |
111 |
+ # copy to use, but until then, be lazy. |
112 |
+ DEPEND+=" >=sys-libs/binutils-libs-${PV}" |
113 |
+fi |
114 |
+ |
115 |
+MY_BUILDDIR=${WORKDIR}/build |
116 |
+ |
117 |
+src_unpack() { |
118 |
+ case ${PV} in |
119 |
+ 9999) |
120 |
+ git-r3_src_unpack; |
121 |
+ ;; |
122 |
+ *) |
123 |
+ default |
124 |
+ ;; |
125 |
+ esac |
126 |
+ mkdir -p "${MY_BUILDDIR}" |
127 |
+} |
128 |
+ |
129 |
+src_prepare() { |
130 |
+ if [[ ! -z ${PATCH_VER} ]] ; then |
131 |
+ einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}" |
132 |
+ eapply "${WORKDIR}/patch"/*.patch |
133 |
+ fi |
134 |
+ |
135 |
+ # This check should probably go somewhere else, like pkg_pretend. |
136 |
+ if [[ ${CTARGET} == *-uclibc* ]] ; then |
137 |
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then |
138 |
+ die "sorry, but this binutils doesn't yet support uClibc :(" |
139 |
+ fi |
140 |
+ fi |
141 |
+ |
142 |
+ # Make sure our explicit libdir paths don't get clobbered. #562460 |
143 |
+ sed -i \ |
144 |
+ -e 's:@bfdlibdir@:@libdir@:g' \ |
145 |
+ -e 's:@bfdincludedir@:@includedir@:g' \ |
146 |
+ {bfd,opcodes}/Makefile.in || die |
147 |
+ |
148 |
+ # Fix locale issues if possible #122216 |
149 |
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then |
150 |
+ einfo "Fixing misc issues in configure files" |
151 |
+ for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do |
152 |
+ ebegin " Updating ${f/${S}\/}" |
153 |
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \ |
154 |
+ || eerror "Please file a bug about this" |
155 |
+ eend $? |
156 |
+ done |
157 |
+ fi |
158 |
+ |
159 |
+ # Fix conflicts with newer glibc #272594 |
160 |
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then |
161 |
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c |
162 |
+ fi |
163 |
+ |
164 |
+ # Apply things from PATCHES and user dirs |
165 |
+ default |
166 |
+ |
167 |
+ # Run misc portage update scripts |
168 |
+ gnuconfig_update |
169 |
+ elibtoolize --portage --no-uclibc |
170 |
+} |
171 |
+ |
172 |
+toolchain-binutils_bugurl() { |
173 |
+ printf "https://bugs.gentoo.org/" |
174 |
+} |
175 |
+toolchain-binutils_pkgversion() { |
176 |
+ printf "Gentoo ${BVER}" |
177 |
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}" |
178 |
+} |
179 |
+ |
180 |
+src_configure() { |
181 |
+ # Setup some paths |
182 |
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${BVER} |
183 |
+ INCPATH=${LIBPATH}/include |
184 |
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${BVER} |
185 |
+ if is_cross ; then |
186 |
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${BVER} |
187 |
+ else |
188 |
+ BINPATH=/usr/${CTARGET}/binutils-bin/${BVER} |
189 |
+ fi |
190 |
+ |
191 |
+ # Make sure we filter $LINGUAS so that only ones that |
192 |
+ # actually work make it through #42033 |
193 |
+ strip-linguas -u */po |
194 |
+ |
195 |
+ # Keep things sane |
196 |
+ strip-flags |
197 |
+ |
198 |
+ local x |
199 |
+ echo |
200 |
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do |
201 |
+ einfo "$(printf '%10s' ${x}:) ${!x}" |
202 |
+ done |
203 |
+ echo |
204 |
+ |
205 |
+ cd "${MY_BUILDDIR}" |
206 |
+ local myconf=() |
207 |
+ |
208 |
+ # enable gold (installed as ld.gold) and ld's plugin architecture |
209 |
+ if use cxx ; then |
210 |
+ myconf+=( --enable-gold ) |
211 |
+ myconf+=( --enable-plugins ) |
212 |
+ fi |
213 |
+ |
214 |
+ if use nls ; then |
215 |
+ myconf+=( --without-included-gettext ) |
216 |
+ else |
217 |
+ myconf+=( --disable-nls ) |
218 |
+ fi |
219 |
+ |
220 |
+ myconf+=( --with-system-zlib ) |
221 |
+ |
222 |
+ # For bi-arch systems, enable a 64bit bfd. This matches |
223 |
+ # the bi-arch logic in toolchain.eclass. #446946 |
224 |
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522 |
225 |
+ case $(tc-arch) in |
226 |
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;; |
227 |
+ esac |
228 |
+ |
229 |
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd ) |
230 |
+ |
231 |
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} ) |
232 |
+ |
233 |
+ is_cross && myconf+=( |
234 |
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET} |
235 |
+ --enable-poison-system-directories |
236 |
+ ) |
237 |
+ |
238 |
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+ |
239 |
+ # on everyone in alpha (for now), we'll just enable it when possible |
240 |
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt ) |
241 |
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt ) |
242 |
+ |
243 |
+ # mips can't do hash-style=gnu ... |
244 |
+ if [[ $(tc-arch) != mips ]] ; then |
245 |
+ myconf+=( --enable-default-hash-style=gnu ) |
246 |
+ fi |
247 |
+ |
248 |
+ myconf+=( |
249 |
+ --prefix="${EPREFIX}"/usr |
250 |
+ --host=${CHOST} |
251 |
+ --target=${CTARGET} |
252 |
+ --datadir="${EPREFIX}"${DATAPATH} |
253 |
+ --datarootdir="${EPREFIX}"${DATAPATH} |
254 |
+ --infodir="${EPREFIX}"${DATAPATH}/info |
255 |
+ --mandir="${EPREFIX}"${DATAPATH}/man |
256 |
+ --bindir="${EPREFIX}"${BINPATH} |
257 |
+ --libdir="${EPREFIX}"${LIBPATH} |
258 |
+ --libexecdir="${EPREFIX}"${LIBPATH} |
259 |
+ --includedir="${EPREFIX}"${INCPATH} |
260 |
+ --enable-obsolete |
261 |
+ --enable-shared |
262 |
+ --enable-threads |
263 |
+ # Newer versions (>=2.27) offer a configure flag now. |
264 |
+ --enable-relro |
265 |
+ # Newer versions (>=2.24) make this an explicit option. #497268 |
266 |
+ --enable-install-libiberty |
267 |
+ --disable-werror |
268 |
+ --with-bugurl="$(toolchain-binutils_bugurl)" |
269 |
+ --with-pkgversion="$(toolchain-binutils_pkgversion)" |
270 |
+ $(use_enable static-libs static) |
271 |
+ ${EXTRA_ECONF} |
272 |
+ # Disable modules that are in a combined binutils/gdb tree. #490566 |
273 |
+ --disable-{gdb,libdecnumber,readline,sim} |
274 |
+ # Strip out broken static link flags. |
275 |
+ # https://gcc.gnu.org/PR56750 |
276 |
+ --without-stage1-ldflags |
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 |
+ env -i ROOT="${ROOT}" 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 |
+} |