geant-4.10.00_p01.ebuild 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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}"
  30. PDEPEND="
  31. data? ( >=sci-physics/geant-data-4.10 )
  32. doc? ( ~app-doc/geant-docs-${PV1}.${PV2}.${SPV3} )"
  33. S="${WORKDIR}/${MYP}"
  34. src_configure() {
  35. local mycmakeargs=(
  36. -DGEANT4_USE_SYSTEM_CLHEP=ON
  37. -DCMAKE_INSTALL_LIBDIR="${EROOT}usr/$(get_libdir)"
  38. -DGEANT4_INSTALL_DATA=OFF
  39. $(cmake-utils_use threads GEANT4_BUILD_MULTITHREADED)
  40. $(cmake-utils_use dawn GEANT4_USE_NETWORKDAWN)
  41. $(cmake-utils_use gdml GEANT4_USE_GDML)
  42. $(cmake-utils_use geant3 GEANT4_USE_G3TOG4)
  43. $(cmake-utils_use motif GEANT4_USE_XM)
  44. $(cmake-utils_use opengl GEANT4_USE_OPENGL_X11)
  45. $(cmake-utils_use inventor GEANT4_USE_INVENTOR)
  46. $(cmake-utils_use qt4 GEANT4_USE_QT)
  47. $(cmake-utils_use raytracerx GEANT4_USE_RAYTRACER_X11)
  48. $(cmake-utils_use vrml GEANT4_USE_NETWORKVRML)
  49. $(cmake-utils_use zlib GEANT4_USE_SYSTEM_ZLIB)
  50. $(cmake-utils_use_build static-libs STATIC_LIBS)
  51. )
  52. if use inventor; then
  53. mycmakeargs+=(
  54. -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
  55. -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
  56. )
  57. fi
  58. cmake-utils_src_configure
  59. }
  60. src_install() {
  61. # adjust clhep linking flags for system clhep
  62. # binmake.gmk is only useful for legacy build systems
  63. sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
  64. cmake-utils_src_install
  65. insinto /usr/share/doc/${PF}
  66. local mypv="${PV1}.${PV2}.${SPV3}"
  67. doins ReleaseNotes/ReleaseNotes${mypv}.html
  68. [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
  69. dodoc ReleaseNotes/Patch${mypv}-*.txt
  70. use examples && doins -r examples
  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. }