geant-4.10.01_p02.ebuild 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit cmake-utils eutils versionator multilib
  5. PV1=$(get_version_component_range 1 ${PV})
  6. PV2=$(get_version_component_range 2 ${PV})
  7. PV3=$(get_version_component_range 3 ${PV})
  8. SPV3=$(printf %1d ${PV3})
  9. MYP=${PN}$(replace_version_separator 3 .)
  10. DESCRIPTION="Toolkit for simulation of passage of particles through matter"
  11. HOMEPAGE="http://geant4.cern.ch/"
  12. SRC_URI="http://geant4.cern.ch/support/source/${MYP}.tar.gz"
  13. LICENSE="geant4"
  14. SLOT="4"
  15. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  16. IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
  17. raytracerx qt4 static-libs vrml zlib threads"
  18. RDEPEND="
  19. dev-libs/expat
  20. >=sci-physics/clhep-2.2:2=
  21. <sci-physics/clhep-2.3:2=
  22. dawn? ( media-gfx/dawn )
  23. gdml? ( dev-libs/xerces-c )
  24. motif? ( x11-libs/motif:0 )
  25. opengl? ( virtual/opengl )
  26. inventor? ( media-libs/SoXt )
  27. qt4? ( dev-qt/qtgui:4 opengl? ( dev-qt/qtopengl:4 ) )
  28. raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
  29. zlib? ( sys-libs/zlib )"
  30. DEPEND="${RDEPEND} prefix? ( app-shells/tcsh )"
  31. PDEPEND="
  32. data? ( ~sci-physics/geant-data-${PV1}.${PV2}.${PV3} )
  33. doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
  34. S="${WORKDIR}/${MYP}"
  35. src_prepare() {
  36. use examples || epatch "${FILESDIR}"/${PN}-4.10.0-no-examples.patch
  37. }
  38. src_configure() {
  39. local mycmakeargs=(
  40. -DGEANT4_USE_SYSTEM_CLHEP=ON
  41. -DGEANT4_INSTALL_DATA=OFF
  42. $(cmake-utils_use threads GEANT4_BUILD_MULTITHREADED)
  43. $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
  44. $(cmake-utils_use gdml GEANT4_USE_GDML)
  45. $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
  46. $(cmake-utils_use motif GEANT4_USE_XM)
  47. $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
  48. $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
  49. $(cmake-utils_use qt4 GEANT4_USE_QT)
  50. $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
  51. $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
  52. $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
  53. $(cmake-utils_use_build static-libs STATIC_LIBS)
  54. )
  55. if use inventor; then
  56. mycmakeargs+=(
  57. -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
  58. -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
  59. )
  60. fi
  61. cmake-utils_src_configure
  62. }
  63. src_install() {
  64. # adjust clhep linking flags for system clhep
  65. # binmake.gmk is only useful for legacy build systems
  66. sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
  67. cmake-utils_src_install
  68. insinto /usr/share/doc/${PF}
  69. doins ReleaseNotes/ReleaseNotes${PV1}.${PV2}.${SPV3}.html
  70. [[ -f ReleaseNotes/Patch${PV1}.${PV2}.${SPV3}-1.txt ]] && \
  71. dodoc ReleaseNotes/Patch${PV1}.${PV2}.${SPV3}-*.txt
  72. }
  73. pkg_postinst() {
  74. elog "The following scripts are provided for backward compatibility:"
  75. elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${SPV3}.*/geant4make/*sh)"
  76. }