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/gdb/
Date: Tue, 12 Mar 2019 21:35:47
Message-Id: 1552426534.a5b9b8dd1ffbc3d326bc0b13315bcdd411d7a044.slyfox@gentoo
1 commit: a5b9b8dd1ffbc3d326bc0b13315bcdd411d7a044
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 12 21:32:35 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 12 21:35:34 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5b9b8dd
7
8 sys-devel/gdb: bump up to 8.3.50.20190312, bug #679564
9
10 binutils-2.32 fixed long-standing bug in handling compressed
11 sections alignment: https://sourceware.org/PR23919
12
13 Unfortunately it broke older binutils and gdb versions as they
14 don't handle the correct section format.
15
16 The change pulls in gdb snapshot from recently created gdb-8.3
17 branch. That should allow handling of debug data created by
18 binutils-2.32.
19
20 Reported-by: Jonas Jelten
21 Closes: https://bugs.gentoo.org/679564
22 Package-Manager: Portage-2.3.62, Repoman-2.3.12
23 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
24
25 sys-devel/gdb/Manifest | 1 +
26 sys-devel/gdb/gdb-8.3.50.20190312.ebuild | 256 +++++++++++++++++++++++++++++++
27 2 files changed, 257 insertions(+)
28
29 diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
30 index a61493a1b2e..4008ec9e57f 100644
31 --- a/sys-devel/gdb/Manifest
32 +++ b/sys-devel/gdb/Manifest
33 @@ -6,3 +6,4 @@ DIST gdb-8.1.1.tar.xz 20064728 BLAKE2B bd17a27a3974a34b94aa5898a97cf26dba9e91b81
34 DIST gdb-8.1.tar.xz 20095080 BLAKE2B 9332058b8b723261ba215124f42a2d6ba916219efdfb3c23ae1f48fecf131c801bbd31b345f2c8339b23d74da690be0260ac31f8f2e79549b62f0880199bfdec SHA512 ffd82f415d7652d62dad1716c307836f594217a363429609beb7d70239e8bf06b73b393345b0e000796228e56681ed7656ac3c8be05e91d6d652ab0d5b1dc357
35 DIST gdb-8.2.1.tar.xz 20170388 BLAKE2B 4008232de312ee71d379ac32a0ee6d63a828c0b58e84799ab9148760ce184400920f7b22c204b9878b09c452412b1b4db507a9185456dc973538de8b88483259 SHA512 2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5a9355227d89ff328f7feb0fc411a69394560cafeb9fa75d35d896d11
36 DIST gdb-8.2.tar.xz 20173112 BLAKE2B 921fdc02f7192f0bd76eb176f857c9c041b7316dc10c5e800eb81deef82a3186d511ec431145f952e5fbd20a4b2c89c14652c42dc52e0d8152acd811f3ae44a7 SHA512 11cc481bebc51eb6db73249ecb62b8c07455cf3db169f4860b3a83114849fbd2b5860a2db64488ba6c5909cf07b255c04770f1e36059eae6bee16d2a3581be90
37 +DIST gdb-weekly-8.3.50.20190312.tar.xz 22101500 BLAKE2B 49666c20faf3deca48a7663e2ee671de9820cc0c0e2111e6633e1b9861bc26d4a608ea4f9e853959d85ac619a8ca63b5ada52d93c2036788ff17ba564494e7d5 SHA512 224c7b3675da46b9d26da65ee1b7e099cdd5782f212b6d865c9b713b673cc8ce9fdf33618713ee38281cf28624014b7541d00e766d3978d530ac3c8a85baf22c
38
39 diff --git a/sys-devel/gdb/gdb-8.3.50.20190312.ebuild b/sys-devel/gdb/gdb-8.3.50.20190312.ebuild
40 new file mode 100644
41 index 00000000000..e1c1671379c
42 --- /dev/null
43 +++ b/sys-devel/gdb/gdb-8.3.50.20190312.ebuild
44 @@ -0,0 +1,256 @@
45 +# Copyright 1999-2019 Gentoo Authors
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +EAPI=7
49 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} )
50 +
51 +inherit eutils flag-o-matic python-single-r1
52 +
53 +export CTARGET=${CTARGET:-${CHOST}}
54 +if [[ ${CTARGET} == ${CHOST} ]] ; then
55 + if [[ ${CATEGORY} == cross-* ]] ; then
56 + export CTARGET=${CATEGORY#cross-}
57 + fi
58 +fi
59 +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
60 +
61 +RPM=
62 +MY_PV=${PV}
63 +case ${PV} in
64 +9999*)
65 + # live git tree
66 + EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
67 + inherit git-r3
68 + SRC_URI=""
69 + ;;
70 +*.*.50.2???????)
71 + # weekly snapshots
72 + SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
73 + ;;
74 +*.*.*.*.*.*)
75 + # fedora versions; note we swap the rpm & fedora core versions.
76 + # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
77 + # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
78 + inherit versionator rpm
79 + gvcr() { get_version_component_range "$@"; }
80 + parse_fedora_ver() {
81 + set -- $(get_version_components)
82 + MY_PV=$(gvcr 1-$(( $# - 2 )))
83 + RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
84 + }
85 + parse_fedora_ver
86 + SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
87 + ;;
88 +*)
89 + # Normal upstream release
90 + SRC_URI="mirror://gnu/gdb/${P}.tar.xz
91 + ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
92 + ;;
93 +esac
94 +
95 +PATCH_VER="1"
96 +PATCH_DEV="slyfox"
97 +DESCRIPTION="GNU debugger"
98 +HOMEPAGE="https://sourceware.org/gdb/"
99 +SRC_URI="${SRC_URI}
100 + ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${PN}-8.1-patches-${PATCH_VER}.tar.xz}
101 + ${PATCH_VER:+mirror://gentoo/${PN}-8.1-patches-${PATCH_VER}.tar.xz}
102 +"
103 +
104 +LICENSE="GPL-2 LGPL-2"
105 +SLOT="0"
106 +if [[ ${PV} != 9999* ]] ; then
107 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
108 +fi
109 +IUSE="+client lzma multitarget nls +python +server test vanilla xml"
110 +REQUIRED_USE="
111 + python? ( ${PYTHON_REQUIRED_USE} )
112 + || ( client server )
113 +"
114 +
115 +RDEPEND="
116 + server? ( !dev-util/gdbserver )
117 + client? (
118 + dev-libs/mpfr:0=
119 + >=sys-libs/ncurses-5.2-r2:0=
120 + sys-libs/readline:0=
121 + lzma? ( app-arch/xz-utils )
122 + python? ( ${PYTHON_DEPS} )
123 + xml? ( dev-libs/expat )
124 + sys-libs/zlib
125 + )"
126 +DEPEND="${RDEPEND}"
127 +BDEPEND="
128 + app-arch/xz-utils
129 + sys-apps/texinfo
130 + client? (
131 + virtual/yacc
132 + test? ( dev-util/dejagnu )
133 + nls? ( sys-devel/gettext )
134 + )"
135 +
136 +S=${WORKDIR}/${PN}-${MY_PV}
137 +
138 +pkg_setup() {
139 + use python && python-single-r1_pkg_setup
140 +}
141 +
142 +src_prepare() {
143 + [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
144 +
145 + default
146 +
147 + strip-linguas -u bfd/po opcodes/po
148 +}
149 +
150 +gdb_branding() {
151 + printf "Gentoo ${PV} "
152 + if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
153 + printf "p${PATCH_VER}"
154 + else
155 + printf "vanilla"
156 + fi
157 + [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
158 +}
159 +
160 +src_configure() {
161 + strip-unsupported-flags
162 +
163 + local myconf=(
164 + --with-pkgversion="$(gdb_branding)"
165 + --with-bugurl='https://bugs.gentoo.org/'
166 + --disable-werror
167 + # Disable modules that are in a combined binutils/gdb tree. #490566
168 + --disable-{binutils,etc,gas,gold,gprof,ld}
169 + )
170 + local sysroot="${EPREFIX}/usr/${CTARGET}"
171 + is_cross && myconf+=(
172 + --with-sysroot="${sysroot}"
173 + --includedir="${sysroot}/usr/include"
174 + --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
175 + )
176 +
177 + if use server && ! use client ; then
178 + # just configure+build in the gdbserver subdir to speed things up
179 + cd gdb/gdbserver
180 + myconf+=( --program-transform-name='' )
181 + else
182 + # gdbserver only works for native targets (CHOST==CTARGET).
183 + # it also doesn't support all targets, so rather than duplicate
184 + # the target list (which changes between versions), use the
185 + # "auto" value when things are turned on.
186 + is_cross \
187 + && myconf+=( --disable-gdbserver ) \
188 + || myconf+=( $(use_enable server gdbserver auto) )
189 + fi
190 +
191 + if ! ( use server && ! use client ) ; then
192 + # if we are configuring in the top level, then use all
193 + # the additional global options
194 + myconf+=(
195 + --enable-64-bit-bfd
196 + --disable-install-libbfd
197 + --disable-install-libiberty
198 + # Disable guile for now as it requires guile-2.x #562902
199 + --without-guile
200 + # This only disables building in the readline subdir.
201 + # For gdb itself, it'll use the system version.
202 + --disable-readline
203 + --with-system-readline
204 + # This only disables building in the zlib subdir.
205 + # For gdb itself, it'll use the system version.
206 + --without-zlib
207 + --with-system-zlib
208 + --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
209 + $(use_with xml expat)
210 + $(use_with lzma)
211 + $(use_enable nls)
212 + $(use multitarget && echo --enable-targets=all)
213 + $(use_with python python "${EPYTHON}")
214 + )
215 + fi
216 + if use sparc-solaris || use x86-solaris ; then
217 + # disable largefile support
218 + # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
219 + myconf+=( --disable-largefile )
220 + fi
221 +
222 + econf "${myconf[@]}"
223 +}
224 +
225 +src_test() {
226 + nonfatal emake check || ewarn "tests failed"
227 +}
228 +
229 +src_install() {
230 + if use server && ! use client; then
231 + cd gdb/gdbserver || die
232 + fi
233 + default
234 + if use client; then
235 + find "${ED}"/usr -name libiberty.a -delete || die
236 + fi
237 + cd "${S}" || die
238 +
239 + # Delete translations that conflict with binutils-libs. #528088
240 + # Note: Should figure out how to store these in an internal gdb dir.
241 + if use nls ; then
242 + find "${ED}" \
243 + -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
244 + -delete || die
245 + fi
246 +
247 + # Don't install docs when building a cross-gdb
248 + if [[ ${CTARGET} != ${CHOST} ]] ; then
249 + rm -rf "${ED}"/usr/share/{doc,info,locale} || die
250 + local f
251 + for f in "${ED}"/usr/share/man/*/* ; do
252 + if [[ ${f##*/} != ${CTARGET}-* ]] ; then
253 + mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
254 + fi
255 + done
256 + return 0
257 + fi
258 + # Install it by hand for now:
259 + # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
260 + # Only install if it exists due to the twisted behavior (see
261 + # notes in src_configure above).
262 + [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
263 +
264 + if use client ; then
265 + docinto gdb
266 + dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
267 + gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
268 + fi
269 + docinto sim
270 + dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
271 + if use server ; then
272 + docinto gdbserver
273 + dodoc gdb/gdbserver/{ChangeLog,README}
274 + fi
275 +
276 + if [[ -n ${PATCH_VER} ]] ; then
277 + dodoc "${WORKDIR}"/extra/gdbinit.sample
278 + fi
279 +
280 + # Remove shared info pages
281 + rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
282 +
283 + # gcore is part of ubin on freebsd
284 + if [[ ${CHOST} == *-freebsd* ]]; then
285 + rm "${ED}"/usr/bin/gcore || die
286 + fi
287 +}
288 +
289 +pkg_postinst() {
290 + # portage sucks and doesnt unmerge files in /etc
291 + rm -vf "${EROOT}"/etc/skel/.gdbinit
292 +
293 + if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
294 + ewarn "gdb is unable to get a mach task port when installed by Prefix"
295 + ewarn "Portage, unprivileged. To make gdb fully functional you'll"
296 + ewarn "have to perform the following steps:"
297 + ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
298 + ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
299 + fi
300 +}