Gentoo Archives: gentoo-commits

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