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