diff --git a/geant/files/geant-4.9.1_p01-configure.patch b/geant/files/geant-4.9.1_p01-configure.patch deleted file mode 100644 index 55c925d..0000000 --- a/geant/files/geant-4.9.1_p01-configure.patch +++ /dev/null @@ -1,116 +0,0 @@ ---- Configure.orig 2007-11-28 13:49:23.000000000 +0000 -+++ Configure 2008-04-07 18:45:41.317949330 +0000 -@@ -579,16 +579,17 @@ - ;; - esac - --: Sanity checks --case "$fastread$alldone" in --yescont|yesexit) ;; --*) -- if test ! -t 0; then -- echo "Say 'sh Configure', not 'sh &1 - case "$silent" in -@@ -982,7 +983,7 @@ - : general instructions - needman=true - firsttime=true --user=`(logname) 2>/dev/null` -+user=`(logname || true) 2>/dev/null` - case "$user" in - '') user=`whoami 2>&1`;; - esac -@@ -1315,7 +1316,6 @@ - '') - myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1` - --mygcc=`( ($g++ -v) 2>/dev/null) 2>&1` - myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ - ./tr '[A-Z]' '[a-z]' | tr '\012' ' '` - newmyuname="$myuname" -@@ -1911,7 +1911,7 @@ - - . $src/.config/bin/$g4system/move.sh - -- exit 1 -+ exit 0 - - fi #end of cppflags - -@@ -2119,7 +2119,7 @@ - cp -i $src/.config/bin/$g4system/env.csh . - cp -i $src/.config/bin/$g4system/env.sh . - -- exit 1 -+ exit 0 - fi #end of -lib or user - else #there is no env.sh - -@@ -2217,7 +2217,7 @@ - - : who configured the system - cf_time=`$date 2>&1` --cf_by=`(logname) 2>/dev/null` -+cf_by=`(logname || true) 2>/dev/null` - case "$cf_by" in - "") - cf_by=`(whoami) 2>/dev/null` -@@ -4200,9 +4200,9 @@ - if test "X$g4osname" = "XLinux" ; then - g4vis_xmflags=" -I$g4vis_xmhome/include " - if test "X$g4vis_xmhome" = "X/usr/X11R6" ; then -- g4vis_xmlibs=" -lXm -lXpm " -+ g4vis_xmlibs=" -lXm " - else -- g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm " -+ g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm " - fi - fi - -@@ -4908,9 +4908,9 @@ - if test "X$g4osname" = "XLinux" ; then - g4vis_xmflags=" -I$g4vis_xmhome/include " - if test "X$g4vis_xmhome" = "X/usr/X11R6" ; then -- g4vis_xmlibs=" -lXm -lXpm " -+ g4vis_xmlibs=" -lXm " - else -- g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm -lXpm " -+ g4vis_xmlibs=" -L$g4vis_xmhome/lib -lXm " - fi - fi - -@@ -6123,7 +6123,7 @@ - - echo "" - -- g4_gmake_version=`(gmake -v) 2>/dev/null` -+ g4_gmake_version=`(gmake -v || true) 2>/dev/null` - case $g4_gmake_version in - GNU*) - g4_gmake=y -@@ -6133,7 +6133,7 @@ - ;; - esac - -- g4_make_version=`(make -v) 2>/dev/null` -+ g4_make_version=`(make -v || true) 2>/dev/null` - case $g4_make_version in - GNU*) - g4_make=y diff --git a/geant/files/geant-4.9.1_p01-no-source.patch b/geant/files/geant-4.9.1_p01-no-source.patch deleted file mode 100644 index add9da4..0000000 --- a/geant/files/geant-4.9.1_p01-no-source.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- config/scripts/move.sh.SH.orig 2008-04-08 16:08:16.817366051 +0000 -+++ config/scripts/move.sh.SH 2008-04-10 15:21:09.507532565 +0000 -@@ -445,39 +445,14 @@ - cd $g4install - #echo `pwd` - -- --# Remove 'verbosity' in 'tar' command --# If not INCLUDE then install full tree in 'src' directory! --# --if [ X$g4includes_flag = Xn ] ; then --if [ X$g4install != X$g4final_install ] ; then --echo "" --echo "Installing sources and headers..." --echo "" --mkdir -p $g4final_install/src/geant4/ --tar cf - Configure config/ source/ environments/ examples/ include/ |(cd $g4final_install/src/geant4/; tar xf -) --fi --fi -- --######################################## --# There is no env! --if [ X$g4includes_flag = Xy ] ; then -- --if [ X$g4install != X$g4final_install ] ; then --echo "" --echo "Installing sources..." --echo "" -- --mkdir -p $g4final_install/src/geant4/ --tar cf - Configure config/ source/ environments/ examples/ |(cd $g4final_install/src/geant4/; tar xf -) --fi -- -+# Remove all the stuff to not install sources -+# - echo "" - echo "Installing headers..." - echo "" - cd $g4install/source - $g4make includes dependencies="" --fi -+ - - # Move libraries - if [ X$g4install != X$g4final_install ] ; then diff --git a/geant/geant-4.9.1_p01.ebuild b/geant/geant-4.9.1_p01.ebuild index fef365e..72f9db8 100644 --- a/geant/geant-4.9.1_p01.ebuild +++ b/geant/geant-4.9.1_p01.ebuild @@ -4,12 +4,12 @@ EAPI="1" -inherit eutils fortran multilib versionator +inherit eutils fortran multilib versionator toolchain-funcs MY_P=${PN}$(replace_version_separator 3 .) DESCRIPTION="CERN's detector description and simulation Tool" -HOMEPAGE="http://geant4.cern.ch/" +HOMEPAGE="http://www.geant4.org/" SRC_COM="http://geant4.web.cern.ch/geant4/support/source/" SRC_URI="${SRC_COM}/${MY_P}.tar.gz" @@ -44,142 +44,141 @@ S="${WORKDIR}/${MY_P}" pkg_setup() { FORTRAN="gfortran g77 ifc" use geant3 && fortran_pkg_setup + eval unset ${!G4_*} } src_unpack() { unpack ${A} cd "${S}" - # this patch sanitize the Configure script - epatch "${FILESDIR}"/${P}-configure.patch - epatch "${FILESDIR}"/${P}-no-source.patch - - # propagate user's make options - sed -i \ - -e "s/g4make=gmake/g4make=\"gmake ${MAKEOPTS}\"/" \ - Configure || die "sed Configure failed" - + # TODO is this still needed? We are using emake below ... # propagate user's flags. sed -i \ -e "s:\(CXXFLAGS*+=\)*-O2:\1 ${CXXFLAGS:--O2}:g" \ -e "s:\(FCFLAGS*+=\)*-O2:\1 ${FFLAGS:--O2}:g" \ -e "s:\(CCFLAGS*+=\)*-O2:\1 ${CFLAGS:--O2}:g" \ config/sys/Linux* || die "flag substitution failed" - - # libdir stuff - sed -i \ - -e "s:lib/geant4:$(get_libdir)/geant:g" \ - Configure config/scripts/move.sh.SH \ - || die "multilib substitution failed" -} - -g4ui_use() { - local answer=$(use $1 && echo y || echo n) - echo "-D g4ui_build_${2:-$1}_session=${answer} - -D g4ui_use_${2:-$1}=${answer}" -} - -g4vis_use() { - local answer=$(use $1 && echo y || echo n) - echo "-D g4vis_build_${2:-$1}_driver=${answer} - -D g4vis_use_${2:-$1}=${answer}" -} - -g4w_use() { - local answer=$(use $1 && echo y || echo n) - echo "-D g4w_use_${2:-$1}=${answer} - -D g4wlib_use_${2:-$1}=${answer}" } src_compile() { - - GEANT4_DIR=/usr/share/${PN}-${SLOT} - GEANT4_DATA_DIR=${GEANT4_DIR}/data - - # The Configure shell script saves its options - # in .config/bin/*/config.sh - local myconf="$(g4vis_use opengl openglx)" - use opengl && myconf="${glconf} $(g4vis_use motif openglxm)" - use data && myconf="${myconf} -D g4data=${GEANT4_DATA_DIR}" - - # switch to see compiling flags + export GEANT4_DIR="/usr/share/${PN}-${SLOT}" + + # these should always to be set + # TODO icc untested + [[ $(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 + + # where to put compiled libraries; + # we set env var G4LIB in src_install() + # to avoid confusing make + export LIB_DIR_TMP="/usr/$(get_libdir)/${PN}" + + # 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 - use debug && export G4DEBUG=y || export G4OPTIMIZE=y - - # to check what they are doing and working - # -D d_portable \ - # -D g4global=n \ - # -D g4granular=y - # -D g4_use_granular=y - # -D g4make=make \ - - ./Configure \ - -deE -build \ - -D g4analysis_use=n \ - -D g4includes_flag=y \ - -D g4include="${D}/usr/include/geant4" \ - -D g4final_install="${D}/usr" \ - $(g4ui_use minimal none) \ - $(g4ui_use athena xaw) \ - $(g4ui_use motif xm) \ - $(g4vis_use minimal none) \ - $(g4vis_use dawn) \ - $(g4vis_use raytracerx) \ - $(g4vis_use openinventor oix) \ - $(g4vis_use vrml) \ - $(g4vis_use vrml vrmlfile) \ - $(g4w_use geant3 g3tog4) \ - $(g4w_use zlib) \ - ${myconf} \ - ${EXTRA_ECONF} \ - || die "Configure failed" + + # internal variables of ./Configure + # -D d_portable \ # seems to be a local variable of ./Configure + # -D g4global=n \ # create few BIG global libraries + # -D g4granular=y # create many small libraries for submodules (default) + # -D g4_use_granular=y # link against the BIG global library when compiling apps + # TODO if we really want GLOBAL libraries (too), we would use + # use global && emake global || die "Building global geant failed" + # and set G4LIB_USE_GRANULAR=y in env.*sh # 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 - - ./Configure \ - -deO -build \ - -D g4lib_build_shared=y \ - -D g4lib_build_static=n \ - || die "Building shared geant failed" + cd "${S}/source/" + export G4LIB_BUILD_SHARED=y + emake || die "Building shared geant failed" if use static; then rm -rf tmp - ./Configure \ - -deO -build \ - -D g4lib_build_shared=n \ - -D g4lib_build_static=y \ - || die "Building shared geant failed" + export G4LIB_BUILD_STATIC=y ; unset G4LIB_BUILD_SHARED + emake || die "Building static geant failed" fi } +g4_create_env_scripts() { + # 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="${LIB_DIR_TMP}" + export G4INCLUDE=`echo $G4INCLUDE | sed s:${D}::` + + export G4WORKDIR="/tmp/geant4"/ # TODO howto set it to e.g. $HOME/geant4 ? + echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${G4LIB}" >> "env.sh" + echo "setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:${G4LIB}" >> "env.csh" + echo "export CLHEP_BASE_DIR=$CLHEP_BASE_DIR" >> "env.sh" + echo "setenv CLHEP_BASE_DIR $CLHEP_BASE_DIR" >> "env.csh" + # read env variables defined upto now + for v in `env | grep ^G4 | uniq`; do + echo "export $v" >> "env.sh" # these are already set to "y" + echo "setenv $v y" >> "env.csh" + done + # define env vars for capabilities we can build into user projects + for v in `env | grep ^G4 | uniq | grep DRIVER | cut -d= -f1 | \ + sed -e s~BUILD~USE~ -e s~_DRIVER~~` + do + echo "export $v=y" >> "env.sh" + echo "setenv $v y" >> "env.csh" + done +} + src_install() { - ./Configure \ - -install \ - || die "Install failed" + # install headers via make since we want them in a single directory + cd "${S}/source/" + emake includes || die 'Installing headers failed' + cd "${S}" - ./Configure \ - || die "Final install failed" + # but install libraries and Geant library tool manually + insinto "${LIB_DIR_TMP}" + doins -r "lib/${G4SYSTEM}/"* + exeinto "${LIB_DIR_TMP}" + doexe "lib/${G4SYSTEM}/liblist" - # install env stuff - # todo: try to decipher and translate into a env.d file + # env scripts and configs insinto ${GEANT4_DIR} - sed -i \ - -e "s:${S}:${GEANT4_DIR}:g" \ - -e "s:${D}:/:g" \ - env.*sh + g4_create_env_scripts doins env.*sh || die "failed installing shell scripts" + sed -i s~\$\(G4LIB\)/\$\(G4SYSTEM\)~\$\(G4LIB\)~g \ + config/binmake.gmk || die "Adjusting paths failed" doins -r config # install data - insinto ${GEANT4_DATA_DIR} if use data; then + insinto ${G4DATA} cd "${WORKDIR}" for d in ${GEANT4_DATA}; do local p=${d/.} doins -r *${p/G4} || die "installing data ${d} failed" done + cd "${S}" fi # doc and examples @@ -198,9 +197,9 @@ src_install() { pkg_postinst() { elog "You can set the Geant4 environment variables" - elog "from ${ROOT}${GEANT4_DIR} shell scripts." + elog "from ${GEANT4_DIR} shell scripts." elog "Ex: for bash" - elog " source ${ROOT}${GEANT4_DIR}/env.sh" + elog " source ${GEANT4_DIR}/env.sh" elog elog "Help us to improve the ebuild and dependencies in" elog "http://bugs.gentoo.org/show_bug.cgi?id=212221" diff --git a/geant/metadata.xml b/geant/metadata.xml index 8dada07..256a42f 100644 --- a/geant/metadata.xml +++ b/geant/metadata.xml @@ -5,7 +5,8 @@ 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 + simulations are performed by linking code supplied by the user with the Geant libraries, then running the resulting executable. + Geant-3.* was written in Fortran, while Geant-4.* is a rewrite in C++.