You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.5 KiB
70 lines
1.5 KiB
2 years ago
|
# Copyright 1999-2022 Gentoo Authors
|
||
4 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
2 years ago
|
EAPI=8
|
||
4 years ago
|
|
||
3 years ago
|
inherit toolchain-funcs flag-o-matic
|
||
4 years ago
|
|
||
|
DESCRIPTION="Source metrics (line counts, complexity, etc) for Java and C++"
|
||
2 years ago
|
HOMEPAGE="https://sarnold.github.io/cccc/"
|
||
4 years ago
|
if [[ ${PV} = 9999* ]]; then
|
||
|
EGIT_REPO_URI="https://github.com/sarnold/cccc.git"
|
||
4 years ago
|
EGIT_BRANCH="master"
|
||
4 years ago
|
inherit git-r3
|
||
|
else
|
||
|
SRC_URI="https://github.com/sarnold/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||
|
fi
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
4 years ago
|
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
||
4 years ago
|
IUSE="apidoc debug doc mfc"
|
||
|
|
||
2 years ago
|
BDEPEND="apidoc? ( app-doc/doxygen[dot] )"
|
||
4 years ago
|
|
||
|
src_prepare() {
|
||
|
default
|
||
|
|
||
2 years ago
|
use mfc && eapply "${FILESDIR}"/${PN}-c_dialect.patch
|
||
|
is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin
|
||
4 years ago
|
}
|
||
|
|
||
|
src_compile() {
|
||
|
tc-export CC CXX LD AS AR NM RANLIB STRIP OBJCOPY
|
||
|
if use debug ; then
|
||
2 years ago
|
DEBUG="true" emake -j1 CCC="$(tc-getCXX)" CC="$(tc-getCC)" cccc
|
||
4 years ago
|
else
|
||
2 years ago
|
emake -j1 CCC="$(tc-getCXX)" CC="$(tc-getCC)" cccc
|
||
4 years ago
|
fi
|
||
|
|
||
2 years ago
|
use apidoc && emake -j1 CCC="$(tc-getCXX)" metrics docs
|
||
4 years ago
|
}
|
||
|
|
||
|
src_test() {
|
||
2 years ago
|
emake -j1 CCC="$(tc-getCXX)" test
|
||
4 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
dobin cccc/cccc
|
||
|
|
||
|
dodoc README.md
|
||
|
|
||
|
if use mfc ; then
|
||
4 years ago
|
docinto examples
|
||
|
dodoc "${FILESDIR}"/cccc-MFC-dialect.opt
|
||
|
docompress -x "/usr/share/doc/${PF}/examples"
|
||
4 years ago
|
fi
|
||
|
|
||
|
if use doc ; then
|
||
4 years ago
|
docinto html
|
||
3 years ago
|
dodoc cccc/*.html
|
||
4 years ago
|
if use apidoc ; then
|
||
4 years ago
|
docinto html/api
|
||
3 years ago
|
dodoc -r doxygen/html/.
|
||
|
|
||
|
docinto html/metrics/
|
||
|
dodoc ccccout/*
|
||
4 years ago
|
fi
|
||
|
fi
|
||
|
}
|