xdmf2-1.0_p141226-r2.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit cmake-utils python-single-r1
  6. DESCRIPTION="eXtensible Data Model and Format"
  7. HOMEPAGE="http://xdmf.org/index.php/Main_Page"
  8. SRC_URI="https://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
  9. SLOT="0"
  10. LICENSE="VTK"
  11. KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux"
  12. IUSE="doc python test"
  13. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  14. RDEPEND="
  15. dev-libs/boost:=
  16. sci-libs/hdf5:=
  17. dev-libs/libxml2:2
  18. python? ( ${PYTHON_DEPS} )
  19. "
  20. DEPEND="${RDEPEND}
  21. doc? ( app-doc/doxygen )
  22. python? ( dev-lang/swig:0 )
  23. "
  24. PATCHES=(
  25. "${FILESDIR}"/${P}-module.patch
  26. "${FILESDIR}"/${P}-cannot-find-hdf5-bug-591302.patch
  27. )
  28. pkg_setup() {
  29. use python && python-single-r1_pkg_setup && python_export
  30. }
  31. src_prepare() {
  32. if use python; then
  33. local _site=$(python_get_sitedir)
  34. sed \
  35. -e "/DESTINATION/s:python:${_site##${EPREFIX}/usr/$(get_libdir)/}:g" \
  36. -i CMakeLists.txt || die
  37. fi
  38. sed \
  39. -e "/DESTINATION/s:lib:$(get_libdir):g" \
  40. -e "/INSTALL/s:lib:$(get_libdir):g" \
  41. -i CMakeLists.txt core/CMakeLists.txt || die
  42. cmake-utils_src_prepare
  43. }
  44. src_configure() {
  45. local mycmakeargs=(
  46. -DBUILD_SHARED_LIBS=1
  47. -DXDMF_BUILD_DOCUMENTATION=$(usex doc)
  48. -DBUILD_TESTING=$(usex test)
  49. -DXDMF_WRAP_PYTHON=$(usex python)
  50. # -DXDMF_WRAP_JAVA=$(usex java)
  51. )
  52. cmake-utils_src_configure
  53. }
  54. src_install() {
  55. cmake-utils_src_install
  56. dosym XdmfConfig.cmake /usr/share/cmake/Modules/${PN}Config.cmake
  57. # need to byte-compile 'XdmfCore.py' and 'Xdmf.py'
  58. # as the CMake build system does not compile them itself
  59. use python && python_optimize "${D%/}$(python_get_sitedir)"
  60. }