cccc-3.1.5.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs flag-o-matic
  5. DESCRIPTION="Source metrics (line counts, complexity, etc) for Java and C++"
  6. HOMEPAGE="http://sarnold.github.io/cccc/"
  7. if [[ ${PV} = 9999* ]]; then
  8. EGIT_REPO_URI="https://github.com/sarnold/cccc.git"
  9. EGIT_BRANCH="master"
  10. inherit git-r3
  11. else
  12. SRC_URI="https://github.com/sarnold/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  13. fi
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
  17. IUSE="apidoc debug doc mfc"
  18. RDEPEND=""
  19. DEPEND="${RDEPEND}
  20. apidoc? ( app-doc/doxygen[dot] )
  21. "
  22. MAKEOPTS="-j1"
  23. src_prepare() {
  24. use mfc && epatch "${FILESDIR}"/${PN}-c_dialect.patch
  25. }
  26. src_compile() {
  27. if use debug ; then
  28. export STRIP_MASK="*/bin/*"
  29. DEBUG="true" emake CCC=$(tc-getCXX) CC=$(tc-getCC) cccc
  30. else
  31. emake CCC=$(tc-getCXX) CC=$(tc-getCC) cccc
  32. fi
  33. use apidoc && emake CCC=$(tc-getCXX) metrics docs
  34. }
  35. src_test() {
  36. emake CCC=$(tc-getCXX) test
  37. }
  38. src_install() {
  39. dobin cccc/cccc
  40. dodoc README.md
  41. if use mfc ; then
  42. dodoc "${FILESDIR}"/cccc-MFC-dialect.opt
  43. docompress -x "/usr/share/doc/${PF}/cccc-MFC-dialect.opt"
  44. fi
  45. if use doc ; then
  46. dodoc CHANGELOG.md HISTORY.md
  47. dohtml cccc/*.html || die "html docs failed"
  48. if use apidoc ; then
  49. docinto api
  50. dohtml -A svg -r doxygen/html || die "dox failed"
  51. docompress -x "/usr/share/doc/${PF}/api"
  52. docinto metrics
  53. dohtml ccccout/* || die "metrics failed"
  54. fi
  55. fi
  56. }