3c63bba8831d9f679e955a45ea050982d83d3fd7
[gentoo.git] / dev-libs / check / check-0.11.0.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools multilib-minimal
7
8 DESCRIPTION="A unit test framework for C"
9 HOMEPAGE="https://libcheck.github.io/check/"
10 SRC_URI="https://github.com/lib${PN}/${PN}/archive/${PV}.tar.gz -> ${P}-github.tar.gz"
11
12 LICENSE="LGPL-2.1"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
15 IUSE="static-libs subunit"
16
17 RDEPEND="subunit? ( >=dev-python/subunit-0.0.10-r1[${MULTILIB_USEDEP}] )"
18 DEPEND="${RDEPEND}
19         virtual/pkgconfig"
20
21 DOCS=( AUTHORS ChangeLog NEWS README.md THANKS TODO )
22
23 pkg_setup() {
24         # See multilib_src_test(), disable sleep()-based tests because they
25         # just take a long time doing pretty much nothing.
26         export CPPFLAGS="-DTIMEOUT_TESTS_ENABLED=0 ${CPPFLAGS}"
27 }
28
29 src_prepare() {
30         default
31
32         sed -i -e '/^docdir =/d' {.,doc}/Makefile.am \
33                 || die 'failed to unset docdir in Makefile.am'
34
35         eautoreconf
36 }
37
38 multilib_src_configure() {
39         local myeconfargs=(
40                 --disable-dependency-tracking
41                 $(use_enable subunit)
42         )
43         ECONF_SOURCE="${S}" \
44         econf "${myeconfargs[@]}"
45 }
46
47 multilib_src_install_all() {
48         default
49
50         rm -f "${ED}/usr/share/doc/${PF}"/COPYING* || \
51                 die 'failed to remove COPYING files'
52
53         find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
54 }
55
56 multilib_src_test() {
57         elog "-DTIMEOUT_TESTS_ENABLED=0 has been prepended to CPPFLAGS. To run the"
58         elog "entire testsuite for dev-libs/check, ensure that"
59         elog "-DTIMEOUT_TESTS_ENABLED=1 is in your CPPFLAGS."
60         default_src_test
61 }