app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / sci-libs / libccd / libccd-2.0.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 SCM=""
7 if [ "${PV#9999}" != "${PV}" ] ; then
8         SCM="git-r3"
9         EGIT_REPO_URI="https://github.com/danfis/libccd"
10 fi
11
12 inherit ${SCM} cmake-utils toolchain-funcs
13
14 if [ "${PV#9999}" != "${PV}" ] ; then
15         KEYWORDS=""
16         SRC_URI=""
17 else
18         KEYWORDS="~amd64 ~arm"
19         SRC_URI="http://libccd.danfis.cz/files/${P}.tar.gz"
20 fi
21
22 DESCRIPTION="Library for collision detection between two convex shapes"
23 HOMEPAGE="http://libccd.danfis.cz/"
24 LICENSE="BSD"
25 SLOT="0"
26 IUSE="double doc"
27
28 RDEPEND=""
29 DEPEND="${RDEPEND}
30         doc? ( dev-python/sphinx )"
31 DOCS=( README )
32
33 src_configure() {
34         local mycmakeargs=(
35                 "-DCCD_DOUBLE=$(usex double TRUE FALSE)"
36         )
37         cmake-utils_src_configure
38 }
39
40 src_compile() {
41         cmake-utils_src_compile
42         if use doc ; then
43                 cd "${S}/doc"
44                 emake SPHINXBUILD=sphinx-build html
45         fi
46 }
47
48 src_test() {
49         cd src/testsuites
50         tc-export CC
51         LDFLAGS="-L${BUILD_DIR} ${LDFLAGS}" \
52         LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
53                 emake check
54 }
55
56 src_install() {
57         cmake-utils_src_install
58         use doc && dohtml -r "${S}/doc/_build/html/"*
59 }