diff options
Diffstat (limited to 'dev-util/cccc/cccc-3.1.6.ebuild')
-rw-r--r-- | dev-util/cccc/cccc-3.1.6.ebuild | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/dev-util/cccc/cccc-3.1.6.ebuild b/dev-util/cccc/cccc-3.1.6.ebuild new file mode 100644 index 000000000000..b7c46d713a80 --- /dev/null +++ b/dev-util/cccc/cccc-3.1.6.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils toolchain-funcs flag-o-matic + +DESCRIPTION="Source metrics (line counts, complexity, etc) for Java and C++" +HOMEPAGE="http://sarnold.github.io/cccc/" +if [[ ${PV} = 9999* ]]; then + EGIT_REPO_URI="https://github.com/sarnold/cccc.git" + EGIT_BRANCH="master" + inherit git-r3 +else + SRC_URI="https://github.com/sarnold/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" +fi + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="apidoc debug doc mfc" + +RDEPEND="" +DEPEND="${RDEPEND} + apidoc? ( app-doc/doxygen[dot] ) + " + +src_prepare() { + is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin + use mfc && eapply "${FILESDIR}"/${PN}-c_dialect.patch + default + +} + +src_compile() { + tc-export CC CXX LD AS AR NM RANLIB STRIP OBJCOPY + if use debug ; then + DEBUG="true" emake -j1 CCC=$(tc-getCXX) CC=$(tc-getCC) cccc + else + emake -j1 CCC=$(tc-getCXX) CC=$(tc-getCC) cccc + fi + + use apidoc && emake -j1 CCC=$(tc-getCXX) metrics docs +} + +src_test() { + emake -j1 CCC=$(tc-getCXX) test +} + +src_install() { + dobin cccc/cccc + + dodoc README.md + + if use mfc ; then + docinto examples + dodoc "${FILESDIR}"/cccc-MFC-dialect.opt + docompress -x "/usr/share/doc/${PF}/examples" + fi + + if use doc ; then + docinto html + dodoc cccc/*.html || die "html docs failed" + if use apidoc ; then + docinto html/api + dodoc -r doxygen/html/. || die "apidocs failed" + docinto html/metrics + dodoc ccccout/* || die "metrics failed" + fi + fi +} |