summaryrefslogtreecommitdiff
path: root/sys-devel/gdb
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-devel/gdb
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-devel/gdb')
-rw-r--r--sys-devel/gdb/Manifest14
-rw-r--r--sys-devel/gdb/gdb-7.10.1.ebuild235
-rw-r--r--sys-devel/gdb/gdb-7.12.1.ebuild235
-rw-r--r--sys-devel/gdb/gdb-7.9.1.ebuild221
-rw-r--r--sys-devel/gdb/gdb-8.0.1.ebuild246
-rw-r--r--sys-devel/gdb/gdb-8.0.ebuild242
-rw-r--r--sys-devel/gdb/gdb-9999.ebuild234
-rw-r--r--sys-devel/gdb/metadata.xml19
8 files changed, 1446 insertions, 0 deletions
diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
new file mode 100644
index 000000000000..ebacf206dcb5
--- /dev/null
+++ b/sys-devel/gdb/Manifest
@@ -0,0 +1,14 @@
+DIST gdb-7.10.1.tar.xz 18531436 SHA256 25c72f3d41c7c8554d61cacbeacd5f40993276d2ccdec43279ac546e3993d6d5 SHA512 17a5138277a31685a5c2a841cb47ed9bc4626ea617b8ca77750513b300299f4fbbffe504958b5372de610dcb952c679cf8fa9c1bdadd380294fbf59b6e366010 WHIRLPOOL 02936f59d3f3f8a57966c72402f1da128dd8e10e686097ffdb3a2741cc0c1831ef27f97daa047fa006ff2ae9f79ae0480f6f0dc2d3f5904190a1dade0590c837
+DIST gdb-7.12.1.tar.xz 19225392 SHA256 4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 SHA512 0ac8d0a495103611ef41167a08313a010dce6ca4c6d827cbe8558a0c1a1a8a6bfa53f1b7704251289cababbfaaf9e075550cdf741a54d6cd9ca3433d910efcd8 WHIRLPOOL 1da1d9680639531000f2518fb6e01551f7d35091065b933a25381339f7d78d64486b7ce54dd9815f7e82884133ccd6868950a15c27fb5a7b9b13243e99eba697
+DIST gdb-7.9.1.tar.xz 17867692 SHA256 cd9c543a411a05b2b647dd38936034b68c2b5d6f10e0d51dc168c166c973ba40 SHA512 eebdf88b24e52e792b8a4b89ea85790de72b462a7810b44975fdf4232c068f353b15506071f450102a9d4bcecdde8e93dc3748a10699b7f73f3e04fb2d9d8414 WHIRLPOOL fe7afb392f453fa5aab290da3b74118c4e3bbae6f4e276f2efd7f978e3987e031d92ecd90d35e0531901f1cf68b04a313df050b25bb3b632d1b6e62360acd591
+DIST gdb-8.0.1.tar.xz 19583920 SHA256 3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 SHA512 5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1 WHIRLPOOL 4632580658f85faab596b98f4f9b3b21a48fc067f56c9ac987e4895f3bd1b430d8f78ef95965e0b78c53e69b502acdeeff5e966c3e8021e6426ce86b78807c17
+DIST gdb-8.0.tar.xz 19588616 SHA256 f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee SHA512 e4044bdd162cbf95044ec1eaa44d2fa62a33e051bdbbacbc97afd4dfb07bae1bea514381fc1966aede89d6796ef2377a15748a93d95e2ad494c8497db489e886 WHIRLPOOL 8e5f49fd8d6a57778ba80cab8768fc11426720c15d54010f9fbcac2c6d8495e7d17ea133f9006d650ed34fdb95b82ac1942d935eaa6b7218fc51d6de6e2213bb
+EBUILD gdb-7.10.1.ebuild 6606 SHA256 db990c57f34ea8550352922f7103fc9c591d3057241111e9ef5093847cc0a3b5 SHA512 ac9409424ffdba44d825d16c0c9768ae0bc51c9deab4975845132f6b630ebf5cbb455344806b8a25425f9bb6a864ec06c3fc33f30abd0eb78e63e0af0f5d5665 WHIRLPOOL 0d07251e4c05c97585974fd91a97bb85a4fbe358b22550322c688556969ba4e2bc079a2e2d524f28c0562f837be7b5f8e8dbdc1637348ed3b66edd771068a34c
+EBUILD gdb-7.12.1.ebuild 6622 SHA256 08321ab7e95ad7b449f82bcf48fc99472176b36f3abae87bc683957378021e25 SHA512 55057ce019f5a9a97ea81e5f2b6c48dd669c1c90b7f7d53591fce50267b05112c6832a4e615671cee5cdb408a4fdb24da4cd6bddf10250696a72f0b4f9ac2aa0 WHIRLPOOL 64c6b8de69c14851e9de14b3e9ea1b8d0c82796ef8b66d36875fd3ee9153be130f824fdfc7d149cbf246428b9f732a0cec271dcd3ec48eacee3d7b015f7c87b5
+EBUILD gdb-7.9.1.ebuild 5944 SHA256 d151fc0b427649f34852b39cbd7d30a7b572a6836200927162cc9f293e2ea654 SHA512 7fe1fb5eba8ccb86f7b0fad0d433b7a5687421c9f8a57a4f6f393d09c840dd66e8f109873ff9772c2ea7209c5f4b95d2af6d8abe8e3e4c397bc0a96eba08871a WHIRLPOOL 1229626c939cf5d7cc8234dbd0a3ecd8111f0e329d69521a0ce54a9129ab25a0b89cc9d7ae4266d87613e6921c14633b2ba0cf852166431330529c3e29c7a9fc
+EBUILD gdb-8.0.1.ebuild 6869 SHA256 2a418b9f27aa3d6824987921834e3920f9c904ee20775896b58736fdde3266e3 SHA512 a9d6d0c65886a9a14ce87c523e7ec1ac42057cf7ca8420d60ca8d1d90315b83642a898dbb7e37ea6b3fb4f5e3585ac88c0ff52faaf7deb00199d3fa2babf4755 WHIRLPOOL b405ec5227ee2da7626c3e31610c3b045c480c51573f7f16c506257da7b473306ee5b298881dfbd1cd6b4f7bb17e23abd2d4f9d0bd8f89a37a9602a3603b205b
+EBUILD gdb-8.0.ebuild 6811 SHA256 61331a963672b56addb05bdff5cea89ae9e5272e93c32fdfc87e704354212f55 SHA512 3d6f7ce0483625f2772223de9fcbfac47d083cbb7278064f226ffa8476f68d8e236f131b6748b12ebf23a438ceb28e6c29b849607cc2fcb9af424bb772c43ab0 WHIRLPOOL a0c1ee74e60aafe81ec30a06b7eb81577dabae729ebf4cd7d4a87a16896c497d6a435800a780f09b80d8cc8c5e68811128d651fcf71b9b1b83bcda94c69932f0
+EBUILD gdb-9999.ebuild 6600 SHA256 aed0c901932cc1a77d38a0374d2223bdc064034a95cfb26ed23b6dd316124a87 SHA512 49415dad8c311943379a875926cb9254aa4c17f704c11a2cf292ae01028f5d6a1e99141c9f0301eedb85f8147af07ff6d4bbc44c31d31be94b03db5ef38ca734 WHIRLPOOL 32933f02fa88cf429d4e9106c772f2b27e23fe2f7451a28a7c4e8695fbb99d05852b7d69ac77552fc19d417561cae288aaa40ee44f38dd6368a7fa66f1190f5f
+MISC ChangeLog 10921 SHA256 c2c8b28f104f15468a559b1ed3d186c806aa553cb1404b2f77031e3d303a6241 SHA512 49c8e54c46b6678826839f092256113f8e8153a595b5408068acd7ac36fad4caec1a67b5982791446cc0d96ec9cc5477e2a0c2c61374f76d78dc7e77a89c6589 WHIRLPOOL e087599d93da1db77788ba75dc844ff9b33a8acaf4c406f5094e15edd616e45c3521b7292d81949afe631284e1e2163acf92ed25d9756524181df24af22916e6
+MISC ChangeLog-2015 40707 SHA256 7045b7ab416919cbe9c2ec6730f596adec722f6d2fefe00938945215738b0c66 SHA512 6d9c38a07f5688cf70288f918f600afe29a66b2b1041bd54b57c2226e7d3939c4cd46365ee27b1c30ad5f28ebacf56d54b68bda3f79ac3c11cdf3d2eee23d01c WHIRLPOOL b4f2efcdf31032f168e1c13fd6921a8eaeaaffd4f61c43d7ee9fbadfb52872949cfde9175708c57691e5e2116c68bda061bad0f6997f83be4340aa040d7912a2
+MISC metadata.xml 914 SHA256 b7651e2c8051c8b35a3c1080d50f1ba811ea40c42e8fb8e2eefd80a2b12832ae SHA512 515a5bcd6c70fc87309cd4e3822d83e1b8fdf52e58cbf331df0c38b9096ad2410dfdad14aed100ea0a53457f57ecdf2b61b910b6a52765219815e1872872ee0c WHIRLPOOL 237a1084550bbce7ddee98681b87fdcd6207c1f6cc40ff1aad1f623a5cd47f1ba3f3c6ae8558399264d52ada246b22cef53f59e2392c376e89524d50623d9524
diff --git a/sys-devel/gdb/gdb-7.10.1.ebuild b/sys-devel/gdb/gdb-7.10.1.ebuild
new file mode 100644
index 000000000000..c662f0cffde3
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.10.1.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ KEYWORDS="-alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client expat lzma multitarget nls +python +server test vanilla"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ expat? ( dev-libs/expat )
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-7.12.1.ebuild b/sys-devel/gdb/gdb-7.12.1.ebuild
new file mode 100644
index 000000000000..928e2912f4e6
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.12.1.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ 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"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-7.9.1.ebuild b/sys-devel/gdb/gdb-7.9.1.ebuild
new file mode 100644
index 000000000000..f2d998373a9f
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.9.1.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ KEYWORDS="alpha"
+fi
+IUSE="+client expat lzma multitarget nls +python +server test vanilla zlib"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ expat? ( dev-libs/expat )
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( sys-libs/zlib )
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ $(use_with zlib)
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-8.0.1.ebuild b/sys-devel/gdb/gdb-8.0.1.ebuild
new file mode 100644
index 000000000000..82cbc96263c0
--- /dev/null
+++ b/sys-devel/gdb/gdb-8.0.1.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ 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"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+
+ default
+
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+ if use sparc-solaris || use x86-solaris ; then
+ # disable largefile support
+ # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
+ myconf+=( --disable-largefile )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ if use server && ! use client; then
+ cd gdb/gdbserver || die
+ fi
+ default
+ if use client; then
+ find "${ED}"/usr -name libiberty.a -delete || die
+ fi
+ cd "${S}" || die
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete || die
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale} || die
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-8.0.ebuild b/sys-devel/gdb/gdb-8.0.ebuild
new file mode 100644
index 000000000000..825036422890
--- /dev/null
+++ b/sys-devel/gdb/gdb-8.0.ebuild
@@ -0,0 +1,242 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ 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"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+
+ default
+
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+ if use sparc-solaris || use x86-solaris ; then
+ # disable largefile support
+ # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
+ myconf+=( --disable-largefile )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-9999.ebuild b/sys-devel/gdb/gdb-9999.ebuild
new file mode 100644
index 000000000000..8ae03593af2f
--- /dev/null
+++ b/sys-devel/gdb/gdb-9999.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/metadata.xml b/sys-devel/gdb/metadata.xml
new file mode 100644
index 000000000000..d11b1ea4a91e
--- /dev/null
+++ b/sys-devel/gdb/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+ <flag name="client">Install the main "gdb" program (most people want this)</flag>
+ <flag name="lzma">Support lzma compression in ELF debug info</flag>
+ <flag name="multitarget">Support all known targets in one gdb binary</flag>
+ <flag name="python">Enable support for the new internal scripting language, as well as extended pretty printers</flag>
+ <flag name="server">Install the "gdbserver" program (useful for embedded/remote targets)</flag>
+ <flag name="xml">Support parsing XML data files needed (at least) for cpu features, memory maps, and syscall tracing</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:gdb</remote-id>
+</upstream>
+</pkgmetadata>