geant-4.10.00.ebuild 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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"
  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}"
  30. PDEPEND="
  31. data? ( ~sci-physics/geant-data-${PV} )
  32. doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
  33. S="${WORKDIR}/${MYP}"
  34. PATCHES=( "${FILESDIR}"/${PN}-4.10.0-no-examples.patch
  35. "${FILESDIR}"/${PN}-4.10.0-TrackingNavigator.patch # 496678
  36. )
  37. src_configure() {
  38. local mycmakeargs=(
  39. -DGEANT4_USE_SYSTEM_CLHEP=ON
  40. -DCMAKE_INSTALL_LIBDIR="${EROOT}usr/$(get_libdir)"
  41. -DGEANT4_INSTALL_DATA=OFF
  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. local mypv="${PV1}.${PV2}.${SPV3}"
  69. doins ReleaseNotes/ReleaseNotes${mypv}.html
  70. [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
  71. dodoc ReleaseNotes/Patch${mypv}-*.txt
  72. use examples && doins -r examples
  73. }
  74. pkg_postinst() {
  75. elog "The following scripts are provided for backward compatibility:"
  76. elog "$(ls -1 ${EROOT%/}/usr/share/Geant4-${PV2}.${SPV3}.*/geant4make/*sh)"
  77. }