duma-2.5.15-r2.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs versionator
  5. MY_P=${PN}_$(replace_all_version_separators '_')
  6. DESCRIPTION="DUMA (Detect Unintended Memory Access) is a memory debugging library"
  7. HOMEPAGE="http://duma.sourceforge.net"
  8. SRC_URI="mirror://sourceforge/duma/${MY_P}.tar.gz
  9. mirror://gentoo/${P}-GNUmakefile.patch.bz2"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~ppc ~x86"
  13. IUSE="examples"
  14. S=${WORKDIR}/${MY_P}
  15. PATCHES=(
  16. "${WORKDIR}"/${P}-GNUmakefile.patch
  17. "${FILESDIR}"/${P}-gcc6.patch
  18. )
  19. src_configure() {
  20. # other flags will break duma
  21. export CFLAGS="-O0 -Wall -Wextra -U_FORTIFY_SOURCE"
  22. tc-export AR CC CXX LD RANLIB
  23. case "${CHOST}" in
  24. *-linux-gnu)
  25. OS=linux;;
  26. *-solaris*)
  27. OS=solaris;;
  28. *-darwin*)
  29. OS=osx;;
  30. *-freebsd*)
  31. OS=freebsd;;
  32. *-netbsd*)
  33. OS=netbsd;;
  34. *-cygwin*)
  35. OS=cygwin;;
  36. **-irix**)
  37. OS=irix;;
  38. esac
  39. export OS="${OS}"
  40. elog "Detected OS is: ${OS}"
  41. if use amd64 && ! [ -n "${DUMA_ALIGNMENT}" ]; then
  42. export DUMA_ALIGNMENT=16
  43. elog "Exported DUMA_ALIGNMENT=${DUMA_ALIGNMENT} for x86_64,"
  44. fi
  45. }
  46. src_compile() {
  47. # The below must be run first if distcc is enabled, otherwise
  48. # the real build breaks on parallel makes.
  49. emake reconfig
  50. emake
  51. }
  52. src_test() {
  53. emake test
  54. elog "Please, see the output above to verify all tests have passed."
  55. elog "Both static and dynamic confidence tests should say PASSED."
  56. }
  57. src_install(){
  58. emake prefix="${D}/usr" libdir="${D}/usr/$(get_libdir)" \
  59. docdir="${D}/usr/share/doc/${PF}" install
  60. sed -i "s|LD_PRELOAD=./libduma|LD_PRELOAD=libduma|" "${D}"/usr/bin/duma \
  61. || die "sed failed"
  62. dodoc CHANGELOG TODO GNUmakefile
  63. if use examples; then
  64. insinto /usr/share/doc/${PF}/examples
  65. doins example[1-6].cpp example_makes/ex6/Makefile
  66. fi
  67. }
  68. pkg_postinst() {
  69. elog "See the GNUmakefile which will be also installed at"
  70. elog "/usr/share/doc/${PF} for more options. You can now export"
  71. elog "varibles to the build system easily, e.g.:"
  72. elog "# export CPPFLAGS=\"-DFLAG\" (or by using append-cppflags)"
  73. elog "# export DUMA_ALIGNMENT=${DUMA_ALIGNMENT} (Default is 16 for x86_64)"
  74. elog "See more information about DUMA_ALIGNMENT from Readme.txt"
  75. }