openbabel-2.3.2-r1.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. WX_GTK_VER="3.0"
  5. inherit cmake-utils eutils wxwidgets
  6. DESCRIPTION="Interconverts file formats used in molecular modeling"
  7. HOMEPAGE="http://openbabel.sourceforge.net/"
  8. SRC_URI="mirror://sourceforge/openbabel/${P}.tar.gz"
  9. SLOT="0"
  10. LICENSE="GPL-2"
  11. KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux ~ppc-macos"
  12. IUSE="doc openmp test wxwidgets"
  13. RDEPEND="
  14. dev-cpp/eigen:3
  15. dev-libs/libxml2:2
  16. sci-libs/inchi
  17. sys-libs/zlib
  18. wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X] )"
  19. DEPEND="${RDEPEND}
  20. >=dev-util/cmake-2.4.8
  21. doc? ( app-doc/doxygen )"
  22. DOCS="AUTHORS ChangeLog NEWS README THANKS doc/*.inc doc/README* doc/*.mol2"
  23. PATCHES=( "${FILESDIR}"/${P}-test_lib_path.patch )
  24. pkg_setup() {
  25. if use openmp; then
  26. if [[ $(tc-getCC) == *gcc ]] && ! tc-has-openmp; then
  27. ewarn "OpenMP is not available in your current selected gcc"
  28. die "need openmp capable gcc"
  29. fi
  30. FORTRAN_NEED_OPENMP=1
  31. fi
  32. }
  33. src_prepare() {
  34. sed \
  35. -e '/__GNUC__/s:== 4:>= 4:g' \
  36. -i include/openbabel/shared_ptr.h || die
  37. cmake-utils_src_prepare
  38. }
  39. src_configure() {
  40. use wxwidgets && need-wxwidgets unicode
  41. local mycmakeargs=()
  42. mycmakeargs+=(
  43. -DOPENBABEL_USE_SYSTEM_INCHI=ON
  44. $(cmake-utils_use_enable openmp OPENMP)
  45. $(cmake-utils_use wxwidgets BUILD_GUI)
  46. )
  47. cmake-utils_src_configure
  48. }
  49. src_install() {
  50. dohtml doc/{*.html,*.png}
  51. if use doc ; then
  52. insinto /usr/share/doc/${PF}/API/html
  53. doins doc/API/html/*
  54. fi
  55. cmake-utils_src_install
  56. }
  57. src_test() {
  58. local mycmakeargs=""
  59. mycmakeargs="${mycmakeargs}
  60. -DOPENBABEL_USE_SYSTEM_INCHI=ON
  61. -DPYTHON_EXECUTABLE=false
  62. $(cmake-utils_use_enable openmp OPENMP)
  63. $(cmake-utils_use wxwidgets BUILD_GUI)
  64. $(cmake-utils_use_enable test TESTS)"
  65. cmake-utils_src_configure
  66. cmake-utils_src_compile
  67. cmake-utils_src_test -E py
  68. }
  69. pkg_postinst() {
  70. optfeature "perl support" sci-chemistry/openbabel-perl
  71. optfeature "python support" sci-chemistry/openbabel-python
  72. }