Gentoo Archives: gentoo-commits

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