gdb-apple-1752.ebuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. APPLE_PV=${PV}
  6. DESCRIPTION="Apple branch of the GNU Debugger, Developer Tools 4.3"
  7. HOMEPAGE="https://sourceware.org/gdb/"
  8. SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${APPLE_PV}.tar.gz"
  9. LICENSE="APSL-2 GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
  12. IUSE="nls"
  13. RDEPEND=">=sys-libs/ncurses-5.2-r2
  14. =dev-db/sqlite-3*"
  15. DEPEND="${RDEPEND}
  16. nls? ( sys-devel/gettext )"
  17. S=${WORKDIR}/gdb-${APPLE_PV}/src
  18. src_prepare() {
  19. epatch "${FILESDIR}"/${PN}-no-global-gdbinit.patch
  20. epatch "${FILESDIR}"/${PN}-768-texinfo.patch
  21. epatch "${FILESDIR}"/${PN}-1518-darwin8-9.patch
  22. epatch "${FILESDIR}"/${PN}-1705-darwin8-10.patch
  23. [[ ${CHOST} == *-darwin8 ]] && epatch "${FILESDIR}"/${PN}-1518-darwin8.patch
  24. eapply_user
  25. }
  26. src_configure() {
  27. replace-flags -O? -O2
  28. econf \
  29. --disable-werror \
  30. --disable-debug-symbols-framework \
  31. $(use_enable nls) \
  32. || die
  33. }
  34. src_compile() {
  35. # unable to work around parallel make issue
  36. emake -j2 || die
  37. }
  38. src_install() {
  39. emake -j2 DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
  40. rm -R "${D}"/nukeme || die
  41. rm -Rf "${ED}"/usr/${CHOST} || die
  42. mv "${ED}"/usr/bin/gdb "${ED}"/
  43. rm -f "${ED}"/usr/bin/*
  44. mv "${ED}"/gdb "${ED}"/usr/bin/
  45. }
  46. pkg_postinst() {
  47. if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -ge 9 ]] ; then
  48. ewarn "Due to increased security measures in 10.5 and up, gdb is"
  49. ewarn "not able to get a mach task port when installed by Prefix"
  50. ewarn "Portage, unprivileged. To make gdb fully functional you'll"
  51. ewarn "have to perform the following steps:"
  52. ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
  53. ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
  54. fi
  55. if use x86-macos || use x64-macos ; then
  56. einfo "FSF gdb works on Intel-based OSX platforms, sometimes even"
  57. einfo "better than gdb-apple. You can consider installing FSF gdb"
  58. einfo "instead of gdb-apple, since the FSF version is surely more"
  59. einfo "advanced than this old 6.8 version modified by Apple."
  60. fi
  61. }