diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2008-06-06 19:58:51 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2008-06-06 19:58:51 +0000 |
commit | f442ecdb7aa33322ca1dbff9079c74dc2b4540cc (patch) | |
tree | 73009b62f0573ea1c576a5821291410820b4c5c6 | |
parent | Added geant4 license (diff) | |
download | gentoo-2-f442ecdb7aa33322ca1dbff9079c74dc2b4540cc.tar.gz gentoo-2-f442ecdb7aa33322ca1dbff9079c74dc2b4540cc.tar.bz2 gentoo-2-f442ecdb7aa33322ca1dbff9079c74dc2b4540cc.zip |
Added major version bump for geant-4, slotted. Thanks much to Benjamin Bennier for his work (bug #). Now geant-3 is also slotted, and got a revision bump
(Portage version: 2.1.5.4)
-rw-r--r-- | sci-physics/geant/ChangeLog | 11 | ||||
-rw-r--r-- | sci-physics/geant/geant-3.21.14-r2.ebuild (renamed from sci-physics/geant/geant-3.21.14.ebuild) | 37 | ||||
-rw-r--r-- | sci-physics/geant/geant-4.9.1_p02.ebuild | 225 | ||||
-rw-r--r-- | sci-physics/geant/metadata.xml | 11 |
4 files changed, 258 insertions, 26 deletions
diff --git a/sci-physics/geant/ChangeLog b/sci-physics/geant/ChangeLog index 40db7ac0fe68..0911f5d776d4 100644 --- a/sci-physics/geant/ChangeLog +++ b/sci-physics/geant/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for sci-physics/geant # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.2 2008/03/11 12:14:47 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.3 2008/06/06 19:58:51 bicatali Exp $ + +*geant-4.9.1_p02 (06 Jun 2008) +*geant-3.21.14-r2 (06 Jun 2008) + + 06 Jun 2008; Sébastien Fabbro <bicatali@gentoo.org> metadata.xml, + -geant-3.21.14.ebuild, +geant-3.21.14-r2.ebuild, +geant-4.9.1_p02.ebuild: + Added major version bump for geant-4, slotted. Thanks much to Benjamin + Bennier for his work (bug #212221). Now geant-3 is also slotted, and got a + revision bump *geant-3.21.14-r1 (11 Mar 2008) diff --git a/sci-physics/geant/geant-3.21.14.ebuild b/sci-physics/geant/geant-3.21.14-r2.ebuild index 111627e17245..e6e63eaefd58 100644 --- a/sci-physics/geant/geant-3.21.14.ebuild +++ b/sci-physics/geant/geant-3.21.14-r2.ebuild @@ -1,10 +1,10 @@ -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/geant-3.21.14.ebuild,v 1.1 2007/08/24 21:43:26 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/geant-3.21.14-r2.ebuild,v 1.1 2008/06/06 19:58:51 bicatali Exp $ DEB_PN=geant321 DEB_PV=${PV}.dfsg -DEB_PR=5 +DEB_PR=8 DEB_P=${DEB_PN}_${DEB_PV} inherit eutils multilib fortran @@ -17,7 +17,7 @@ SRC_URI="mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}.orig.tar.gz mirror://debian/pool/main/${DEB_PN:0:1}/${DEB_PN}/${DEB_P}-${DEB_PR}.diff.gz" KEYWORDS="~amd64 ~x86" -SLOT="0" +SLOT="3" IUSE="" RDEPEND="virtual/motif @@ -27,7 +27,7 @@ RDEPEND="virtual/motif sci-physics/paw" DEPEND="${RDEPEND} - virtual/tetex + virtual/latex-base x11-misc/imake x11-misc/makedepend" @@ -39,38 +39,35 @@ FORTRAN="gfortran g77 ifc" src_unpack() { unpack ${A} - epatch ${DEB_P}-${DEB_PR}.diff + epatch "${DEB_P}-${DEB_PR}".diff rm -f ${DEB_P}-${DEB_PR}.diff cd "${S}" cp debian/add-ons/Makefile . + export DEB_BUILD_OPTIONS="${FORTRANC} nostrip nocheck" sed -i \ -e 's:/usr/local:/usr:g' \ Makefile || "sed'ing the Makefile failed" einfo "Applying Debian patches" - emake -j1 \ - DEB_BUILD_OPTIONS="${FORTRANC} ${restrict}" \ - patch || die "make patch failed" + emake -j1 patch || die "debian patch failed" # since we depend on cfortran, do not use the one from cernlib - # (adapted from debian/cernlib-debian.mk) - mv -f src/include/cfortran/cfortran.h \ - src/include/cfortran/cfortran.h.disabled + rm -f src/include/cfortran/cfortran.h +} + +src_compile() { # create local LaTeX cache directory mkdir -p .texmf-var + emake -j1 cernlib-indep cernlib-arch || die "emake failed" } -src_compile() { - emake -j1 \ - DEB_BUILD_OPTIONS="${FORTRANC} nostrip" \ - || die "emake failed" +src_test_() { + LD_LIBRARY_PATH="${S}"/shlib \ + emake -j1 cernlib-test || die "emake test failed" } src_install() { - emake \ - DEB_BUILD_OPTIONS="${FORTRANC} nostrip" \ - DESTDIR="${D}" \ - install || die "emake install failed" + emake DESTDIR="${D}" install || die "emake install failed" cd "${S}"/debian dodoc changelog README.* deadpool.txt NEWS copyright || die "dodoc failed" newdoc add-ons/README README.add-ons || die "newdoc failed" diff --git a/sci-physics/geant/geant-4.9.1_p02.ebuild b/sci-physics/geant/geant-4.9.1_p02.ebuild new file mode 100644 index 000000000000..a770fe52449f --- /dev/null +++ b/sci-physics/geant/geant-4.9.1_p02.ebuild @@ -0,0 +1,225 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/geant-4.9.1_p02.ebuild,v 1.1 2008/06/06 19:58:51 bicatali Exp $ + +EAPI="1" + +inherit eutils fortran multilib versionator toolchain-funcs + +PV1=$(get_version_component_range 1 ${PV}) +PV2=$(get_version_component_range 2 ${PV}) +PV3=$(get_version_component_range 3 ${PV}) +MY_P=${PN}$(replace_version_separator 3 .) + +DESCRIPTION="CERN's detector description and simulation Tool" +HOMEPAGE="http://www.geant4.org/" + +SRC_COM="http://geant4.web.cern.ch/geant4/support/source" +SRC_URI="${SRC_COM}/${MY_P}.tar.gz" +GEANT4_DATA="G4NDL.3.12 + G4EMLOW.5.1 + G4RadioactiveDecay.3.2 + PhotonEvaporation.2.0 + G4ABLA.3.0" +for d in ${GEANT4_DATA}; do + SRC_URI="${SRC_URI} data? ( ${SRC_COM}/${d}.tar.gz )" +done + +LICENSE="geant4" +SLOT="4" +KEYWORDS="~amd64 ~x86" +IUSE="athena +data dawn debug examples gdml geant3 global minimal +motif + +opengl openinventor +raytracerx static +vrml zlib" + +DEPEND="sci-physics/clhep + motif? ( virtual/motif ) + athena? ( x11-libs/libXaw ) + openinventor? ( media-libs/openinventor ) + raytracerx? ( x11-libs/libX11 x11-libs/libXmu ) + opengl? ( virtual/opengl + athena? ( x11-libs/Xaw3d ) ) + gdml? ( dev-libs/xerces-c ) + geant3? ( sci-physics/geant:3 ) + dawn? ( media-gfx/dawn )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + FORTRAN="gfortran g77 ifc" + use geant3 && fortran_pkg_setup + eval unset ${!G4*} +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # propagate user's flags. + sed -i \ + -e "/CXXFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${CXXFLAGS}:" \ + -e "/FCFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${FFLAGS:--O2}:" \ + -e "/CCFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${CFLAGS}:" \ + config/sys/Linux*gmk || die "flag substitution failed" + + # fix forced lib directory + sed -i \ + -e 's:$(G4LIB)/$(G4SYSTEM):$(G4LIB):g' \ + config/binmake.gmk || die "sed binmake.gmk failed" + sed -i \ + -e '/$(G4LIB)\/$(G4SYSTEM)/d' \ + config/architecture.gmk || die "sed architecture.gmk failed" + sed -i \ + -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \ + config/common.gmk || die "sed common.gmk failed" + sed -i \ + -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \ + -e 's:$(G4BIN)/$(G4SYSTEM):$(G4TMP):g' \ + -e 's:$(G4TMP)/$(G4SYSTEM):$(G4TMP):g' \ + source/GNUmakefile || die "sed GNUmakefile failed" +} + +src_compile() { + export GEANT4_DIR="/usr/share/${PN}${PV1}" + # where to put compiled libraries; + # we set env var G4LIB in src_install() + # to avoid confusing make + export GEANT4_LIBDIR=/usr/$(get_libdir)/${PN}${PV1} + + # these should always to be set + [[ $(tc-getCXX) = ic*c ]] && export G4SYSTEM=Linux-icc \ + || export G4SYSTEM=Linux-g++ + export G4INSTALL="${S}" + export G4INCLUDE="${D}/usr/include/${PN}" + export CLHEP_BASE_DIR=/usr + + # parse USE; just set flags of drivers to build, G4*_USE_* vars are set + # later automatically for G4*_BUILD_*_DRIVER + use minimal && export G4UI_NONE=y \ + && export G4VIS_NONE=y + + use motif && export G4UI_BUILD_XM_SESSION=y + use athena && export G4UI_BUILD_XAW_SESSION=y + + use dawn && export G4VIS_BUILD_DAWN_DRIVER=y + use raytracerx && export G4VIS_BUILD_RAYTRACERX_DRIVER=y + use openinventor && export G4VIS_BUILD_OI_DRIVER=y + use opengl && export G4VIS_BUILD_OPENGLX_DRIVER=y + use opengl && use motif && export G4VIS_BUILD_OPENGLXM_DRIVER=y + + use geant3 && export G4LIB_BUILD_G3TOG4=y + use zlib && export G4LIB_BUILD_ZLIB=y + use vrml && export G4VIS_BUILD_VRML_DRIVER=y \ + && export G4VIS_BUILD_VRMLFILE_DRIVER=y + + use data && export G4DATA="${GEANT4_DIR}/data" + use debug && export G4DEBUG=y || export G4OPTIMIZE=y + + # switch to see compiling flags + export CPPVERBOSE=y + + # if shared libs are built, the script will also build static libs + # with pic flags + # avoid that by building it twice and removing temporary objects + cd "${S}/source/" + export G4LIB_BUILD_SHARED=y + emake || die "Building shared geant failed" + + if use static; then + rm -rf tmp + export G4LIB_BUILD_STATIC=y ; unset G4LIB_BUILD_SHARED + emake || die "Building static geant failed" + fi + + if use global; then + export G4LIB_USE_GRANULAR=y + emake global || die "Building global libraries failed" + fi +} + +g4_create_env_script() { + # we need to change some variables to the final values since we hide these + # from make during the compile + export G4INSTALL=${GEANT4_DIR} + export G4LIB=${GEANT4_LIBDIR} + export G4INCLUDE=${G4INCLUDE/${D}/} + export G4WORKDIR=\${HOME}/${PN}${PV1} + + local g4env=99${PN}${PV1} + cat <<-EOF > ${g4env} + LDPATH=${G4LIB} + CLHEP_BASE_DIR=${CLHEP_BASE_DIR} + EOF + + # detailed data file locations + if $(use data); then + export G4LEVELGAMMADATA="${G4DATA}/PhotonEvaporation2.0" + export G4RADIOACTIVEDATA="${G4DATA}/RadioactiveDecay3.2" + export G4LEDATA="${G4DATA}/G4EMLOW5.1" + export G4NEUTRONHPCROSSSECTIONS="${G4DATA}/G4NDL3.12" + fi + + # read env variables defined upto now + printenv | grep ^G4 | uniq >> ${g4env} + # define env vars for capabilities we can build into user projects + printenv | uniq | \ + sed -n -e '/^G4/s:BUILD\(.*\)_DRIVER:USE\1:gp' >> ${g4env} + doenvd ${g4env} || die "Installing environment scripts failed " +} + +src_install() { + # install headers via make since we want them in a single directory + cd "${S}/source/" + einfo "Installing Geant4 headers" + emake includes || die 'Installing headers failed' + cd "${S}" + + # but install libraries and Geant library tool manually + einfo "Installing Geant4 libraries" + insinto ${GEANT4_LIBDIR} + doins tmp/*.so || die + doins tmp/libname.map || die + if use static; then + doins tmp/*.a || die + fi + exeinto ${GEANT4_LIBDIR} + doexe tmp/liblist || die + + g4_create_env_script + + # configs + insinto ${GEANT4_DIR} + doins -r config || die + + # install data + if use data; then + einfo "Installing Geant4 data" + insinto ${G4DATA} + pushd "${WORKDIR}" > /dev/null + for d in ${GEANT4_DATA}; do + local p=${d/.} + doins -r *${p/G4} || die "installing data ${d} failed" + done + popd > /dev/null + fi + + # doc and examples + insinto /usr/share/doc/${PF} + local mypv="${PV1}.${PV2}.${PV3}" + doins ReleaseNotes/ReleaseNotes${mypv}.html + [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \ + dodoc ReleaseNotes/Patch${mypv}-*.txt + + use examples && doins -r examples + + # TODO: g4py will probably need a split ebuild since it seems to + # rely on on geant4 existence. + # TODO: momo with momo or java flag, and check java stuff +} + +pkg_postinst() { + elog "Geant4 projects are by default build in \$HOME/geant4." + elog "If you want to change, set \$G4WORKDIR to another directory." + elog + elog "Help us to improve the ebuild and dependencies in" + elog "http://bugs.gentoo.org/show_bug.cgi?id=212221" +} diff --git a/sci-physics/geant/metadata.xml b/sci-physics/geant/metadata.xml index 513adf0f9ef8..c32b134f3902 100644 --- a/sci-physics/geant/metadata.xml +++ b/sci-physics/geant/metadata.xml @@ -4,10 +4,11 @@ <herd>sci-physics</herd> <longdescription lang="en"> Geant simulates the passage of subatomic particles through matter, for - instance, particle detectors. For maximum flexibility, Geant - simulations are performed by linking Fortran code supplied by the user - with the Geant libraries, then running the resulting executable. - - This package includes gxint, the script used to perform this linking step. + instance, particle detectors. Geant 3 simulations are performed by + linking Fortran code supplied by the user with the Geant libraries, + then running the resulting executable. This package includes gxint, + the script used to perform this linking step. + Geant 4 is a complete rewrite in C++ with addition of other modern + features and detectors. </longdescription> </pkgmetadata> |