geant-4.10.01.ebuild 2.7 KB

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