gdb-apple-966.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit eutils flag-o-matic
  5. DESCRIPTION="Apple branch of the GNU Debugger, Developer Tools 3.1.3"
  6. HOMEPAGE="https://sourceware.org/gdb/"
  7. SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${PV}.tar.gz"
  8. LICENSE="APSL-2 GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
  11. IUSE="nls"
  12. RDEPEND=">=sys-libs/ncurses-5.2-r2
  13. =dev-db/sqlite-3*"
  14. DEPEND="${RDEPEND}
  15. nls? ( sys-devel/gettext )"
  16. S=${WORKDIR}/gdb-${PV}/src
  17. src_prepare() {
  18. epatch "${FILESDIR}"/${PN}-768-texinfo.patch
  19. epatch "${FILESDIR}"/${PN}-768-darwin-arch.patch
  20. epatch "${FILESDIR}"/${PN}-962-darwin8.patch
  21. epatch "${FILESDIR}"/${PN}-962-darwin64.patch
  22. epatch "${FILESDIR}"/${PN}-962-demangle.patch
  23. # for FSF gcc / gcc-apple:42
  24. sed -e 's/-Wno-long-double//' -i gdb/config/*/macosx.mh
  25. eapply_user
  26. }
  27. src_configure() {
  28. replace-flags -O? -O2
  29. econf \
  30. --disable-werror \
  31. $(use_enable nls) \
  32. || die
  33. }
  34. src_install() {
  35. emake DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
  36. rm -R "${D}"/nukeme || die
  37. rm -Rf "${ED}"/usr/${CHOST} || die
  38. mv "${ED}"/usr/bin/gdb "${ED}"/
  39. rm -f "${ED}"/usr/bin/*
  40. mv "${ED}"/gdb "${ED}"/usr/bin/
  41. }
  42. pkg_postinst() {
  43. if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -ge 9 ]] ; then
  44. elog "Due to increased security measures in 10.5 and up, gdb is"
  45. elog "not able to get a mach task port when installed by Prefix"
  46. elog "Portage, unprivileged. To make gdb fully functional you'll"
  47. elog "have to perform the following steps:"
  48. elog " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
  49. elog " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
  50. fi
  51. }