geant-4.10.03.ebuild 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-utils versionator
  5. MY_P=${PN}${PV}
  6. SPV="$(get_version_component_range 1 ${PV}).$(get_version_component_range 2 ${PV}).$(printf %1d $(get_version_component_range 3 ${PV}))"
  7. DESCRIPTION="Toolkit for simulation of passage of particles through matter"
  8. HOMEPAGE="http://geant4.cern.ch/"
  9. SRC_URI="http://geant4.cern.ch/support/source/${MY_P}.tar.gz"
  10. LICENSE="geant4"
  11. SLOT="4"
  12. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
  14. raytracerx qt4 static-libs vrml zlib threads"
  15. RDEPEND="
  16. dev-libs/expat
  17. >=sci-physics/clhep-2.3.3.0:2=
  18. dawn? ( media-gfx/dawn )
  19. gdml? ( dev-libs/xerces-c )
  20. motif? ( x11-libs/motif:0 )
  21. opengl? ( virtual/opengl )
  22. inventor? ( media-libs/SoXt )
  23. qt4? (
  24. dev-qt/qtgui:4
  25. opengl? ( dev-qt/qtopengl:4 )
  26. )
  27. raytracerx? (
  28. x11-libs/libX11
  29. x11-libs/libXmu
  30. )
  31. zlib? ( sys-libs/zlib )"
  32. DEPEND="${RDEPEND} prefix? ( app-shells/tcsh )"
  33. PDEPEND="
  34. data? ( ~sci-physics/geant-data-${PV} )
  35. doc? ( ~app-doc/geant-docs-${PV} )"
  36. HTML_DOCS=( ReleaseNotes/ReleaseNotes${SPV}.html )
  37. S="${WORKDIR}/${MY_P}"
  38. src_prepare() {
  39. cmake-utils_src_prepare
  40. if ! use examples; then
  41. sed -i '/install(DIRECTORY examples/,/)/d' CMakeLists.txt || die
  42. fi
  43. }
  44. src_configure() {
  45. local mycmakeargs=(
  46. -DGEANT4_USE_SYSTEM_CLHEP=ON
  47. -DGEANT4_INSTALL_DATA=OFF
  48. -DUSE_GEANT4_BUILD_MULTITHREADED=$(usex threads)
  49. -DUSE_GEANT4_USE_NETWORKDAWN=$(usex dawn)
  50. -DUSE_GEANT4_USE_GDML=$(usex gdml)
  51. -DUSE_GEANT4_USE_G3TOG4=$(usex geant3)
  52. -DUSE_GEANT4_USE_XM=$(usex motif)
  53. -DUSE_GEANT4_USE_OPENGL_X11=$(usex opengl)
  54. -DUSE_GEANT4_USE_INVENTOR=$(usex inventor)
  55. -DUSE_GEANT4_USE_QT=$(usex qt4)
  56. -DUSE_GEANT4_USE_RAYTRACER_X11=$(usex raytracerx)
  57. -DUSE_GEANT4_USE_NETWORKVRML=$(usex vrml)
  58. -DUSE_GEANT4_USE_SYSTEM_ZLIB=$(usex zlib)
  59. -DBUILD_STATIC_LIBS=$(usex static-libs)
  60. )
  61. if use inventor; then
  62. mycmakeargs+=(
  63. -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
  64. -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
  65. )
  66. fi
  67. cmake-utils_src_configure
  68. }
  69. src_install() {
  70. # adjust clhep linking flags for system clhep
  71. # binmake.gmk is only useful for legacy build systems
  72. sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
  73. cmake-utils_src_install
  74. [[ -f ReleaseNotes/Patch${SPV}-1.txt ]] && DOCS+=( ReleaseNotes/Patch${SPV}-*.txt )
  75. einstalldocs
  76. }
  77. pkg_postinst() {
  78. elog "The following scripts are provided for backward compatibility:"
  79. elog "$(ls -1 ${EROOT%/}/usr/share/${PN^}${SPV}.*/geant4make/*sh)"
  80. }