# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 # See https://sourceware.org/gdb/wiki/DistroAdvice for general packaging # tips & notes. GUILE_COMPAT=( 2-2 3-0 ) PYTHON_COMPAT=( python3_{10..13} ) inherit flag-o-matic guile-single linux-info python-single-r1 strip-linguas toolchain-funcs export CTARGET=${CTARGET:-${CHOST}} if [[ ${CTARGET} == ${CHOST} ]] ; then if [[ ${CATEGORY} == cross-* ]] ; then export CTARGET=${CATEGORY#cross-} fi fi is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } case ${PV} in 9999*) # live git tree EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git" inherit git-r3 SRC_URI="" ;; *.*.50_p2???????|*.*.90_p2???????) # Weekly snapshots MY_PV="${PV/_p/.}" SRC_URI=" https://sourceware.org/pub/gdb/snapshots/branch/gdb-weekly-${MY_PV}.tar.xz https://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${MY_PV}.tar.xz https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/gdb-weekly-${MY_PV}.tar.xz " S="${WORKDIR}/${PN}-${MY_PV}" # e.g. 13.1.90_p20230325 is a snapshot on the stable branch, so it's fine if [[ ${PV} == *.[123456789].9?_p2??????? ]] ; then REGULAR_RELEASE=1 fi ;; *.*.9?) # Prereleases MY_PV="${PV/_p/.}" SRC_URI=" https://sourceware.org/pub/gdb/snapshots/branch/gdb-${MY_PV}.tar.xz https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/gdb-${MY_PV}.tar.xz " S="${WORKDIR}/${PN}-${MY_PV}" ;; *) # Normal upstream release SRC_URI=" mirror://gnu/gdb/${P}.tar.xz https://sourceware.org/pub/gdb/releases/${P}.tar.xz " REGULAR_RELEASE=1 esac PATCH_DEV="" PATCH_VER="" DESCRIPTION="GNU debugger" HOMEPAGE="https://sourceware.org/gdb/" SRC_URI=" ${SRC_URI} ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${P}-patches-${PATCH_VER}.tar.xz} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz} " LICENSE="GPL-3+ LGPL-2.1+" SLOT="0" IUSE="cet debuginfod guile lzma multitarget nls +python rocm +server sim source-highlight test vanilla xml xxhash zstd" if [[ -n ${REGULAR_RELEASE} ]] ; then KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" fi REQUIRED_USE=" guile? ( ${GUILE_REQUIRED_USE} ) python? ( ${PYTHON_REQUIRED_USE} ) rocm? ( multitarget ) " RESTRICT="!test? ( test )" RDEPEND=" dev-libs/mpfr:= dev-libs/gmp:= >=sys-libs/ncurses-5.2-r2:= >=sys-libs/readline-7:= sys-libs/zlib elibc_glibc? ( net-libs/libnsl:= ) debuginfod? ( dev-libs/elfutils[debuginfod(-)] ) lzma? ( app-arch/xz-utils ) python? ( ${PYTHON_DEPS} ) guile? ( ${GUILE_DEPS} ) xml? ( dev-libs/expat ) rocm? (