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: Sun, 25 Apr 2021 08:56:59
Message-Id: 1619340994.0465cc2c787eec0105777a5700f1520f9ea7f69d.slyfox@gentoo
1 commit: 0465cc2c787eec0105777a5700f1520f9ea7f69d
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 25 08:54:27 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 25 08:56:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0465cc2c
7
8 sys-devel/gdb: bump up to 10.2
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 sys-devel/gdb/Manifest | 1 +
14 sys-devel/gdb/gdb-10.2.ebuild | 259 ++++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 260 insertions(+)
16
17 diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
18 index 8fa3bb78990..563fc11c108 100644
19 --- a/sys-devel/gdb/Manifest
20 +++ b/sys-devel/gdb/Manifest
21 @@ -1 +1,2 @@
22 DIST gdb-10.1.tar.xz 21507112 BLAKE2B 69d79cd667ecb6e936b41a03817ade5dd9b761f97bc123d668b5f968d123c37d048fc8ec1289151e989f01bb01a43cc3d8b5b54f1807f1e3eb5f43e6bf0aa55b SHA512 0dc54380435c6853db60f1e388b94836d294dfa9ad7f518385a27db4edd03cb970f8717d5f1e9c9a0d4a33d7fcf91bc2e5d6c9cf9e4b561dcc74e65b806c1537
23 +DIST gdb-10.2.tar.xz 21518900 BLAKE2B c5d31d80d2b454767d6f844e8471b012ad437c3872391b618fd7b14c5cf251b78e55d28c12e81382fd600f67e2f618ff5dbe3a7b737a5d5161ceb3542afbb90b SHA512 3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa
24
25 diff --git a/sys-devel/gdb/gdb-10.2.ebuild b/sys-devel/gdb/gdb-10.2.ebuild
26 new file mode 100644
27 index 00000000000..520501f0023
28 --- /dev/null
29 +++ b/sys-devel/gdb/gdb-10.2.ebuild
30 @@ -0,0 +1,259 @@
31 +# Copyright 1999-2021 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +PYTHON_COMPAT=( python3_{7,8,9} )
36 +
37 +inherit eutils flag-o-matic python-single-r1 toolchain-funcs
38 +
39 +export CTARGET=${CTARGET:-${CHOST}}
40 +if [[ ${CTARGET} == ${CHOST} ]] ; then
41 + if [[ ${CATEGORY} == cross-* ]] ; then
42 + export CTARGET=${CATEGORY#cross-}
43 + fi
44 +fi
45 +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
46 +
47 +case ${PV} in
48 +9999*)
49 + # live git tree
50 + EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
51 + inherit git-r3
52 + SRC_URI=""
53 + ;;
54 +*.*.50.2???????)
55 + # weekly snapshots
56 + SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
57 + ;;
58 +*)
59 + # Normal upstream release
60 + SRC_URI="mirror://gnu/gdb/${P}.tar.xz
61 + ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
62 + ;;
63 +esac
64 +
65 +PATCH_VER=""
66 +PATCH_DEV=""
67 +DESCRIPTION="GNU debugger"
68 +HOMEPAGE="https://sourceware.org/gdb/"
69 +SRC_URI="${SRC_URI}
70 + ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
71 + ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}
72 +"
73 +
74 +LICENSE="GPL-2 LGPL-2"
75 +SLOT="0"
76 +if [[ ${PV} != 9999* ]] ; then
77 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
78 +fi
79 +IUSE="cet lzma multitarget nls +python +server source-highlight test vanilla xml xxhash"
80 +REQUIRED_USE="
81 + python? ( ${PYTHON_REQUIRED_USE} )
82 +"
83 +
84 +# ia64 kernel crashes when gdb testsuite is running
85 +RESTRICT="
86 + ia64? ( test )
87 +
88 + !test? ( test )
89 +"
90 +
91 +RDEPEND="
92 + dev-libs/mpfr:0=
93 + >=sys-libs/ncurses-5.2-r2:0=
94 + >=sys-libs/readline-7:0=
95 + sys-libs/zlib
96 + lzma? ( app-arch/xz-utils )
97 + python? ( ${PYTHON_DEPS} )
98 + xml? ( dev-libs/expat )
99 + source-highlight? (
100 + dev-util/source-highlight
101 + )
102 + xxhash? (
103 + dev-libs/xxhash
104 + )
105 +"
106 +DEPEND="${RDEPEND}"
107 +BDEPEND="
108 + app-arch/xz-utils
109 + sys-apps/texinfo
110 + virtual/yacc
111 + nls? ( sys-devel/gettext )
112 + source-highlight? ( virtual/pkgconfig )
113 + test? ( dev-util/dejagnu )
114 +"
115 +
116 +PATCHES=(
117 + "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
118 + "${FILESDIR}"/${PN}-10.1-cet.patch
119 +)
120 +
121 +pkg_setup() {
122 + use python && python-single-r1_pkg_setup
123 +}
124 +
125 +src_prepare() {
126 + default
127 +
128 + strip-linguas -u bfd/po opcodes/po
129 + export CC_FOR_BUILD=$(tc-getBUILD_CC)
130 +
131 + # avoid using ancient termcap from host on Prefix systems
132 + sed -i -e 's/termcap tinfow/tinfow/g' \
133 + gdb/configure{.ac,} || die
134 +}
135 +
136 +gdb_branding() {
137 + printf "Gentoo ${PV} "
138 + if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
139 + printf "p${PATCH_VER}"
140 + else
141 + printf "vanilla"
142 + fi
143 + [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
144 +}
145 +
146 +src_configure() {
147 + strip-unsupported-flags
148 +
149 + local myconf=(
150 + # portage's econf() does not detect presence of --d-d-t
151 + # because it greps only top-level ./configure. But not
152 + # gnulib's or gdb's configure.
153 + --disable-dependency-tracking
154 +
155 + --with-pkgversion="$(gdb_branding)"
156 + --with-bugurl='https://bugs.gentoo.org/'
157 + --disable-werror
158 + # Disable modules that are in a combined binutils/gdb tree. #490566
159 + --disable-{binutils,etc,gas,gold,gprof,ld}
160 +
161 + # avoid automagic dependency on (currently prefix) systems
162 + # systems with debuginfod library, bug #754753
163 + --without-debuginfod
164 +
165 + # Allow user to opt into CET for host libraries.
166 + # Ideally we would like automagic-or-disabled here.
167 + # But the check does not quite work on i686: bug #760926.
168 + $(use_enable cet)
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 + # gdbserver only works for native targets (CHOST==CTARGET).
178 + # it also doesn't support all targets, so rather than duplicate
179 + # the target list (which changes between versions), use the
180 + # "auto" value when things are turned on, which is triggered
181 + # whenever no --enable or --disable is given
182 + if is_cross || use !server ; then
183 + myconf+=( --disable-gdbserver )
184 + fi
185 +
186 + myconf+=(
187 + --enable-64-bit-bfd
188 + --disable-install-libbfd
189 + --disable-install-libiberty
190 + # Disable guile for now as it requires guile-2.x #562902
191 + --without-guile
192 + --enable-obsolete
193 + # This only disables building in the readline subdir.
194 + # For gdb itself, it'll use the system version.
195 + --disable-readline
196 + --with-system-readline
197 + # This only disables building in the zlib subdir.
198 + # For gdb itself, it'll use the system version.
199 + --without-zlib
200 + --with-system-zlib
201 + --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
202 + $(use_with xml expat)
203 + $(use_with lzma)
204 + $(use_enable nls)
205 + $(use_enable source-highlight)
206 + $(use multitarget && echo --enable-targets=all)
207 + $(use_with python python "${EPYTHON}")
208 + $(use_with xxhash)
209 + )
210 + if use sparc-solaris || use x86-solaris ; then
211 + # disable largefile support
212 + # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
213 + myconf+=( --disable-largefile )
214 + fi
215 +
216 + # source-highlight is detected with pkg-config: bug #716558
217 + export ac_cv_path_pkg_config_prog_path="$(tc-getPKG_CONFIG)"
218 +
219 + econf "${myconf[@]}"
220 +}
221 +
222 +src_install() {
223 + default
224 + find "${ED}"/usr -name libiberty.a -delete || die
225 +
226 + # Delete translations that conflict with binutils-libs. #528088
227 + # Note: Should figure out how to store these in an internal gdb dir.
228 + if use nls ; then
229 + find "${ED}" \
230 + -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
231 + -delete || die
232 + fi
233 +
234 + # Don't install docs when building a cross-gdb
235 + if [[ ${CTARGET} != ${CHOST} ]] ; then
236 + rm -rf "${ED}"/usr/share/{doc,info,locale} || die
237 + local f
238 + for f in "${ED}"/usr/share/man/*/* ; do
239 + if [[ ${f##*/} != ${CTARGET}-* ]] ; then
240 + mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
241 + fi
242 + done
243 + return 0
244 + fi
245 + # Install it by hand for now:
246 + # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
247 + # Only install if it exists due to the twisted behavior (see
248 + # notes in src_configure above).
249 + [[ -e gdbserver/gdbreplay ]] && dobin gdbserver/gdbreplay
250 +
251 + docinto gdb
252 + dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
253 + gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
254 + docinto sim
255 + dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
256 + if use server ; then
257 + docinto gdbserver
258 + dodoc gdbserver/{ChangeLog,README}
259 + fi
260 +
261 + if [[ -n ${PATCH_VER} ]] ; then
262 + dodoc "${WORKDIR}"/extra/gdbinit.sample
263 + fi
264 +
265 + # Remove shared info pages
266 + rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
267 +
268 + # gcore is part of ubin on freebsd
269 + if [[ ${CHOST} == *-freebsd* ]]; then
270 + rm "${ED}"/usr/bin/gcore || die
271 + fi
272 +
273 + if use python; then
274 + python_optimize "${ED}"/usr/share/gdb/python/gdb
275 + fi
276 +}
277 +
278 +pkg_postinst() {
279 + # portage sucks and doesnt unmerge files in /etc
280 + rm -vf "${EROOT}"/etc/skel/.gdbinit
281 +
282 + if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
283 + ewarn "gdb is unable to get a mach task port when installed by Prefix"
284 + ewarn "Portage, unprivileged. To make gdb fully functional you'll"
285 + ewarn "have to perform the following steps:"
286 + ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
287 + ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
288 + fi
289 +}