strace-4.15.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit flag-o-matic eutils toolchain-funcs
  5. if [[ ${PV} == "9999" ]] ; then
  6. EGIT_REPO_URI="git://git.code.sf.net/p/strace/code"
  7. EGIT_PROJECT="${PN}"
  8. inherit git-2 autotools
  9. else
  10. SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
  11. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
  12. fi
  13. DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
  14. HOMEPAGE="https://sourceforge.net/projects/strace/"
  15. LICENSE="BSD"
  16. SLOT="0"
  17. IUSE="aio perl static unwind"
  18. LIB_DEPEND="unwind? ( sys-libs/libunwind[static-libs(+)] )"
  19. # strace only uses the header from libaio to decode structs
  20. DEPEND="static? ( ${LIB_DEPEND} )
  21. aio? ( >=dev-libs/libaio-0.3.106 )
  22. sys-kernel/linux-headers"
  23. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
  24. perl? ( dev-lang/perl )"
  25. src_prepare() {
  26. if epatch_user || [[ ! -e configure ]] ; then
  27. # git generation
  28. ./xlat/gen.sh || die
  29. ./generate_mpers_am.sh || die
  30. eautoreconf
  31. [[ ! -e CREDITS ]] && cp CREDITS{.in,}
  32. fi
  33. filter-lfs-flags # configure handles this sanely
  34. use static && append-ldflags -static
  35. export ac_cv_header_libaio_h=$(usex aio)
  36. # Stub out the -k test since it's known to be flaky. #545812
  37. sed -i '1iexit 77' tests*/strace-k.test || die
  38. }
  39. src_configure() {
  40. # Set up the default build settings, and then use the names strace expects.
  41. tc-export_build_env BUILD_{CC,CPP}
  42. local v bv
  43. for v in CC CPP {C,CPP,LD}FLAGS ; do
  44. bv="BUILD_${v}"
  45. export "${v}_FOR_BUILD=${!bv}"
  46. done
  47. econf $(use_with unwind libunwind)
  48. }
  49. src_install() {
  50. default
  51. use perl || rm "${ED}"/usr/bin/strace-graph
  52. dodoc CREDITS
  53. }