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