dmalloc-5.5.2-r4.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit autotools eutils multilib
  5. DESCRIPTION="A Debug Malloc Library"
  6. HOMEPAGE="http://dmalloc.com"
  7. SRC_URI="http://dmalloc.com/releases/${P}.tgz"
  8. LICENSE="CC-BY-SA-3.0"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
  11. IUSE="static-libs threads"
  12. DEPEND="sys-apps/texinfo"
  13. RDEPEND=""
  14. DOCS=( NEWS README docs/NOTES docs/TODO )
  15. src_prepare() {
  16. # - Build objects twice, once -fPIC for shared.
  17. # - Use DESTDIR.
  18. # - Fix SONAME and NEEDED.
  19. epatch "${FILESDIR}"/${P}-Makefile.in.patch
  20. # - Broken test, always returns false.
  21. epatch "${FILESDIR}"/${P}-cxx.patch
  22. # - Add threads support.
  23. use threads && epatch "${FILESDIR}"/${P}-threads.patch
  24. # Respect CFLAGS/LDFLAGS. #337429
  25. sed -i Makefile.in \
  26. -e '/libdmalloc/ s:$(CC):& $(CFLAGS) $(LDFLAGS):g' \
  27. || die "sed Makefile.in"
  28. # - Run autoconf for -cxx.patch.
  29. eautoconf
  30. }
  31. src_configure() {
  32. econf --enable-cxx --enable-shlib $(use_enable threads)
  33. }
  34. src_compile() {
  35. default
  36. cd docs
  37. makeinfo dmalloc.texi || die
  38. }
  39. src_test() {
  40. emake heavy
  41. }
  42. src_install() {
  43. default
  44. newdoc ChangeLog.1 ChangeLog
  45. insinto /usr/share/doc/${PF}
  46. doins docs/dmalloc.pdf
  47. dohtml RELEASE.html docs/dmalloc.html
  48. doinfo docs/dmalloc.info
  49. # add missing symlinks, lazy
  50. dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so
  51. dosym lib${PN}.so.${PV} /usr/$(get_libdir)/lib${PN}.so.${PV%%.*}
  52. for lib in cxx th thcxx; do
  53. dosym lib${PN}${lib}.so.${PV} /usr/$(get_libdir)/lib${PN}${lib}.so
  54. dosym lib${PN}${lib}.so.${PV} \
  55. /usr/$(get_libdir)/lib${PN}${lib}.so.${PV%%.*}
  56. done
  57. if ! use static-libs; then
  58. rm "${D}"/usr/$(get_libdir)/lib${PN}*.a || die
  59. fi
  60. }