|
|
LICENSE="geant4" | LICENSE="geant4" |
SLOT="4" | SLOT="4" |
KEYWORDS="~amd64 ~x86" | KEYWORDS="~amd64 ~x86" |
IUSE="athena +data dawn debug examples gdml geant3 minimal +motif |
IUSE="athena +data dawn debug examples gdml geant3 minimal motif |
+opengl openinventor +raytracerx +vrml zlib" | +opengl openinventor +raytracerx +vrml zlib" |
| |
DEPEND="sci-physics/clhep | DEPEND="sci-physics/clhep |
|
|
} | } |
| |
src_compile() { | src_compile() { |
GEANT4_DATA_DIR=/usr/share/${PN} |
GEANT4_DIR=/usr/share/${PN} |
# The Configure shell script saves its options | # The Configure shell script saves its options |
# in .config/bin/*/config.sh | # in .config/bin/*/config.sh |
| |
local myconf="$(g4vis_use opengl openglx)" | local myconf="$(g4vis_use opengl openglx)" |
use opengl && myconf="${glconf} $(g4vis_use motif openglxm)" | use opengl && myconf="${glconf} $(g4vis_use motif openglxm)" |
use data && myconf="${myconf} -D g4data=${GEANT_DATA_DIR}" |
DATA="${GEANT4_DIR}/data" |
|
use data && myconf="${myconf} |
|
-D g4levelgammadata=${DATA}/PhotonEvaporation2.0 |
|
-D g4radioactivedata=${DATA}/RadioactiveDecay3.2 |
|
-D g4ledata=${DATA}/G4EMLOW5.1 |
|
-D g4neutronhpcrosssections=${DATA}/G4NDL3.12 |
|
-D g4abladata=${DATA}/G4ABLA3.0" |
| |
# switch to see compiling flags | # switch to see compiling flags |
export CPPVERBOSE=y | export CPPVERBOSE=y |
|
|
-D g4lib_build_static=n \ | -D g4lib_build_static=n \ |
|| die "Building shared geant failed" | || die "Building shared geant failed" |
| |
rm -rf tmp |
# rm -rf tmp |
|
# |
./Configure \ |
# ./Configure \ |
-deO -build \ |
# -deO -build \ |
-D g4lib_build_shared=n \ |
# -D g4lib_build_shared=n \ |
-D g4lib_build_static=y \ |
# -D g4lib_build_static=y \ |
|| die "Building shared geant failed" |
# || die "Building shared geant failed" |
} | } |
| |
src_install() { | src_install() { |
|
|
./Configure \ | ./Configure \ |
|| die "Final install failed" | || die "Final install failed" |
| |
insinto ${GEANT4_DATA_DIR} |
insinto ${GEANT4_DIR} |
sed -i \ | sed -i \ |
-e "s:${S}:${GEANT4_DATA_DIR}:g" \ |
-e "s:${S}:${GEANT4_DIR}:g" \ |
-e "s:${D}:/:g" \ | -e "s:${D}:/:g" \ |
env.*sh | env.*sh |
doins env.*sh || die "failed installing shell scripts" | doins env.*sh || die "failed installing shell scripts" |
doins -r config | doins -r config |
|
insinto "${GEANT4_DIR}/data" |
if use data; then | if use data; then |
cd "${WORKDIR}" | cd "${WORKDIR}" |
for d in ${GEANT4_DATA}; do |
# give an explicit list of data dirs since the archive names don't |
doins -r ${d/.} || die "installing data ${d} failed" |
# always match the content |
|
for d in "G4NDL3.12 G4EMLOW5.1 RadioactiveDecay3.2 PhotonEvaporation2.0 G4ABLA3.0"; do |
|
doins -r ${d} || die "installing data ${d} failed" |
done | done |
|
cd "${S}" |
fi | fi |
| |
# doc and examples | # doc and examples |
|
|
| |
pkg_postinst() { | pkg_postinst() { |
elog "You can set the Geant4 environment variables" | elog "You can set the Geant4 environment variables" |
elog "from ${ROOT}${GEANT4_DATA_DIR} shell scripts." |
elog "from ${ROOT}${GEANT4_DIR} shell scripts." |
elog "Ex: for bash" | elog "Ex: for bash" |
elog " source ${ROOT}${GEANT4_DATA_DIR}/env.sh" |
elog " source ${ROOT}${GEANT4_DIR}/env.sh" |
elog | elog |
elog "Help us to improve the ebuild and dependencies in" | elog "Help us to improve the ebuild and dependencies in" |
elog "http://bugs.gentoo.org/show_bug.cgi?id=212221" | elog "http://bugs.gentoo.org/show_bug.cgi?id=212221" |