libccd-2.0.ebuild 1.1 KB

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