dev-libs/roct-thunk-interface: 3.5.0 version bump
[gentoo.git] / dev-libs / check / check-0.14.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 CMAKE_ECLASS=cmake
7 inherit cmake-multilib
8
9 DESCRIPTION="A unit test framework for C"
10 HOMEPAGE="https://libcheck.github.io/check/"
11 SRC_URI="https://github.com/lib${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="LGPL-2.1+"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
16 IUSE="doc subunit test"
17
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="subunit? ( dev-python/subunit[${MULTILIB_USEDEP}] )"
21 DEPEND="${RDEPEND}
22         sys-apps/texinfo"
23 BDEPEND="doc? ( app-doc/doxygen )"
24
25 PATCHES=( "${FILESDIR}/check-0.14.0-r2-disable-automagic-dep.patch" )
26
27 src_prepare() {
28         cmake_src_prepare
29
30         # Fix wrong libdir, probably caused by multilib
31         sed -i "s|\${libdir}|/usr/$(get_libdir)|g" check.pc.in || die "sed .pc failed."
32 }
33
34 multilib_src_configure() {
35         local mycmakeargs=(
36                 -DBUILD_TESTING=$(usex test ON OFF)
37                 -DCHECK_ENABLE_SUBUNIT=$(usex subunit ON OFF)
38         )
39
40         cmake_src_configure
41 }
42
43 multilib_src_compile() {
44         cmake_src_compile
45
46         if use doc && multilib_is_native_abi; then
47                 cd "${S}"/doc/ || die "Failed to switch directories."
48                 doxygen "." || die "Failed to run doxygen to generate docs."
49         fi
50 }
51
52 multilib_src_install_all() {
53         use doc && local HTML_DOCS=( "${S}"/doc/html/. )
54         einstalldocs
55
56         find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
57 }