openmesh-9.0.0.ebuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake
  5. MY_PN="OpenMesh"
  6. MY_PV=$(ver_cut 1-2)
  7. S="${WORKDIR}/${MY_PN}-${PV}"
  8. DESCRIPTION="A generic data structure to represent and manipulate polygonal meshes"
  9. HOMEPAGE="https://www.openmesh.org/"
  10. SRC_URI="https://openmesh.org/media/Releases/${MY_PV/-RC/RC}/${MY_PN}-${MY_PV}.tar.gz"
  11. LICENSE="BSD"
  12. SLOT="0"
  13. KEYWORDS="~amd64 ~ia64 ~x86"
  14. IUSE="doc qt5 static-libs test"
  15. RESTRICT="!test? ( test ) mirror"
  16. RDEPEND="
  17. qt5? (
  18. dev-qt/qtcore:5
  19. dev-qt/qtgui:5
  20. dev-qt/qtopengl:5
  21. dev-qt/qtwidgets:5
  22. media-libs/freeglut
  23. )
  24. doc? (
  25. app-doc/doxygen
  26. media-gfx/graphviz
  27. )
  28. "
  29. DEPEND="${RDEPEND}
  30. test? ( dev-cpp/gtest )
  31. "
  32. #CMAKE_BUILD_TYPE=Release
  33. src_prepare() {
  34. cmake_src_prepare
  35. # Fix libdir and remove rpath.
  36. sed -i -e "s|libdata\/|$(get_libdir)\/|" CMakeLists.txt
  37. sed -i \
  38. -e "s|\(set (VCI_PROJECT_LIBDIR \"\).*|\1$(get_libdir)/\")|" \
  39. -e "s|\(BUILD_WITH_INSTALL_RPATH \)1|\1 0|" \
  40. -e "s|\(SKIP_BUILD_RPATH\) 0|\1 1|" \
  41. -e '/^ *INSTALL_RPATH/d' \
  42. cmake-library/VCI/VCICommon.cmake || die
  43. if ! use static-libs; then
  44. sed -i "s|\(SHARED\)ANDSTATIC|\1|" \
  45. src/${MY_PN}/{Core,Tools}/CMakeLists.txt || die
  46. sed -i '/OpenMeshCoreStatic/d' \
  47. src/${MY_PN}/Tools/CMakeLists.txt || die
  48. fi
  49. }
  50. src_configure() {
  51. local mycmakeargs=(
  52. -DBUILD_APPS=$(usex qt5)
  53. -DOPENMESH_BUILD_UNIT_TESTS=$(usex test)
  54. -DOPENMESH_DOCS=$(usex doc)
  55. )
  56. cmake_src_configure
  57. }
  58. src_test() {
  59. cd "${BUILD_DIR}" || die
  60. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${BUILD_DIR}/Build/$(get_libdir) ctest --verbose
  61. }