Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-physics/geant: geant-4.9.2.ebuild ChangeLog
Date: Sat, 10 Jan 2009 12:13:09
Message-Id: E1LLciB-0002lj-Nq@stork.gentoo.org
1 bicatali 09/01/10 12:13:07
2
3 Modified: ChangeLog
4 Added: geant-4.9.2.ebuild
5 Log:
6 Version bump. Switched to EAPI=2, added qt4 support, updated data files, updated minimum dependencies, and now propagate LDFLAGS. Closing bug #253769.
7 (Portage version: 2.2_rc20/cvs/Linux 2.6.25-gentoo-r7 x86_64)
8
9 Revision Changes Path
10 1.18 sci-physics/geant/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-physics/geant/ChangeLog?rev=1.18&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-physics/geant/ChangeLog?rev=1.18&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-physics/geant/ChangeLog?r1=1.17&r2=1.18
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v
19 retrieving revision 1.17
20 retrieving revision 1.18
21 diff -u -r1.17 -r1.18
22 --- ChangeLog 24 Nov 2008 16:54:16 -0000 1.17
23 +++ ChangeLog 10 Jan 2009 12:13:07 -0000 1.18
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sci-physics/geant
26 -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.17 2008/11/24 16:54:16 bicatali Exp $
28 +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
29 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.18 2009/01/10 12:13:07 bicatali Exp $
30 +
31 +*geant-4.9.2 (10 Jan 2009)
32 +
33 + 10 Jan 2009; Sébastien Fabbro <bicatali@g.o> +geant-4.9.2.ebuild:
34 + Version bump. Switched to EAPI=2, added qt4 support, updated data files,
35 + updated minimum dependencies, and now propagate LDFLAGS. Closing bug #253769.
36
37 24 Nov 2008; Sébastien Fabbro <bicatali@g.o>
38 -geant-4.9.1_p02.ebuild, geant-4.9.1_p03.ebuild:
39
40
41
42 1.1 sci-physics/geant/geant-4.9.2.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-physics/geant/geant-4.9.2.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-physics/geant/geant-4.9.2.ebuild?rev=1.1&content-type=text/plain
46
47 Index: geant-4.9.2.ebuild
48 ===================================================================
49 # Copyright 1999-2009 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/geant-4.9.2.ebuild,v 1.1 2009/01/10 12:13:07 bicatali Exp $
52
53 EAPI="2"
54
55 inherit eutils fortran multilib versionator toolchain-funcs
56
57 PV1=$(get_version_component_range 1 ${PV})
58 PV2=$(get_version_component_range 2 ${PV})
59 PV3=$(get_version_component_range 3 ${PV})
60 MY_P=${PN}$(replace_version_separator 3 .)
61
62 DESCRIPTION="CERN's detector description and simulation Tool"
63 HOMEPAGE="http://geant4.cern.ch/"
64
65 SRC_COM="http://geant4.web.cern.ch/geant4/support/source"
66 SRC_URI="${SRC_COM}/${MY_P}.tar.gz"
67 GEANT4_DATA="G4NDL.3.13
68 G4EMLOW.6.2
69 G4RadioactiveDecay.3.2
70 PhotonEvaporation.2.0
71 G4ABLA.3.0"
72 for d in ${GEANT4_DATA}; do
73 SRC_URI="${SRC_URI} data? ( ${SRC_COM}/${d}.tar.gz )"
74 done
75
76 LICENSE="geant4"
77 SLOT="4"
78 KEYWORDS="~amd64 ~hppa ~sparc ~x86"
79 IUSE="athena +data dawn debug examples gdml geant3 global minimal +motif
80 +opengl openinventor +raytracerx static +vrml zlib"
81
82 DEPEND=">=sci-physics/clhep-2.0.4.2
83 motif? ( x11-libs/openmotif )
84 athena? ( x11-libs/libXaw )
85 qt4? ( || ( x11-libs/qt:4 x11-libs/qt-gui ) )
86 openinventor? ( >=media-libs/openinventor-2.1.5.10-r3 )
87 raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
88 opengl? ( virtual/opengl
89 athena? ( x11-libs/Xaw3d )
90 qt4? ( || ( x11-libs/qt:4[opengl] x11-libs/qt-opengl ) ) )
91 gdml? ( dev-libs/xerces-c )
92 geant3? ( sci-physics/geant:3 )
93 dawn? ( media-gfx/dawn )"
94
95 S="${WORKDIR}/${MY_P}"
96
97 pkg_setup() {
98 FORTRAN="gfortran g77 ifc"
99 use geant3 && fortran_pkg_setup
100 eval unset ${!G4*}
101 }
102
103 src_prepare() {
104 # propagate user's flags.
105 sed -i -e 's/-o/$(LDFLAGS) -o/g' source/GNUmakefile || die
106 sed -i \
107 -e "/CXXFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${CXXFLAGS}:" \
108 -e "/FCFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${FFLAGS:--O2}:" \
109 -e "/CCFLAGS[[:space:]]*.=[[:space:]]-O2/s:=.*:= ${CFLAGS}:" \
110 -e "s:-Wl,-soname:${LDFLAGS} -Wl,-soname:g" \
111 config/sys/Linux*gmk || die "flag substitution failed"
112
113 # fix forced lib directory
114 sed -i \
115 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4LIB):g' \
116 config/binmake.gmk || die "sed binmake.gmk failed"
117 sed -i \
118 -e '/$(G4LIB)\/$(G4SYSTEM)/d' \
119 config/architecture.gmk || die "sed architecture.gmk failed"
120 sed -i \
121 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
122 config/common.gmk || die "sed common.gmk failed"
123 sed -i \
124 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
125 -e 's:$(G4BIN)/$(G4SYSTEM):$(G4TMP):g' \
126 -e 's:$(G4TMP)/$(G4SYSTEM):$(G4TMP):g' \
127 source/GNUmakefile || die "sed GNUmakefile failed"
128 sed -i \
129 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
130 config/globlib.gmk || die "sed globlib.gmk failed"
131 }
132
133 src_configure() {
134 export GEANT4_DIR="/usr/share/${PN}${PV1}"
135 # where to put compiled libraries;
136 # we set env var G4LIB in src_install()
137 # to avoid confusing make
138 export GEANT4_LIBDIR=/usr/$(get_libdir)/${PN}${PV1}
139
140 # these should always to be set
141 [[ $(tc-getCXX) = ic*c ]] && export G4SYSTEM=Linux-icc \
142 || export G4SYSTEM=Linux-g++
143 export G4INSTALL="${S}"
144 export G4INCLUDE="${D}/usr/include/${PN}"
145 export CLHEP_BASE_DIR=/usr
146
147 # parse USE; just set flags of drivers to build, G4*_USE_* vars are set
148 # later automatically for G4*_BUILD_*_DRIVER
149 use minimal && export G4UI_NONE=y \
150 && export G4VIS_NONE=y
151
152 use motif && export G4UI_BUILD_XM_SESSION=y
153 use athena && export G4UI_BUILD_XAW_SESSION=y
154 use qt4 && export G4UI_BUILD_QT_SESSION=y
155
156 use dawn && export G4VIS_BUILD_DAWN_DRIVER=y
157 use raytracerx && export G4VIS_BUILD_RAYTRACERX_DRIVER=y
158 use openinventor && export G4VIS_BUILD_OI_DRIVER=y
159 use opengl && export G4VIS_BUILD_OPENGLX_DRIVER=y
160 use opengl && use motif && export G4VIS_BUILD_OPENGLXM_DRIVER=y
161
162 use geant3 && export G4LIB_BUILD_G3TOG4=y
163 use zlib && export G4LIB_USE_ZLIB=y
164 use vrml && export G4VIS_BUILD_VRML_DRIVER=y \
165 && export G4VIS_BUILD_VRMLFILE_DRIVER=y
166
167 use data && export G4DATA="${GEANT4_DIR}/data"
168 use debug && export G4DEBUG=y || export G4OPTIMIZE=y
169
170 # switch to see compiling flags
171 export CPPVERBOSE=y
172
173 # if shared libs are built, the script will also build static libs
174 # with pic flags
175 # avoid that by building it twice and removing temporary objects
176 export G4LIB_BUILD_SHARED=y
177
178 }
179
180 src_compile() {
181 cd "${S}/source/"
182 emake || die "Building shared geant failed"
183
184 if use global; then
185 export G4LIB_USE_GRANULAR=y
186 emake global || die "Building global libraries failed"
187 emake || die "Rebuilding shared geant failed"
188 fi
189
190 if use static; then
191 rm -rf tmp
192 export G4LIB_BUILD_STATIC=y ; unset G4LIB_BUILD_SHARED
193 emake || die "Building static geant failed"
194 fi
195 }
196
197 g4_create_env_script() {
198 # we need to change some variables to the final values since we hide these
199 # from make during the compile
200 export G4INSTALL=${GEANT4_DIR}
201 export G4LIB=${GEANT4_LIBDIR}
202 export G4INCLUDE=${G4INCLUDE/${D}/}
203 export G4WORKDIR=\${HOME}/${PN}${PV1}
204
205 local g4env=99${PN}${PV1}
206 cat <<-EOF > ${g4env}
207 LDPATH=${G4LIB}
208 CLHEP_BASE_DIR=${CLHEP_BASE_DIR}
209 EOF
210
211 # detailed data file locations
212 if use data; then
213 G4LEVELGAMMADATA="${G4DATA}/$(basename ${WORKDIR}/PhotonEvaporation*)"
214 G4RADIOACTIVEDATA="${G4DATA}$(basename ${WORKDIR}/RadioactiveDecay*)"
215 G4LEDATA="${G4DATA}/$(basename ${WORKDIR}/G4EMLOW*)"
216 G4ABLADATA="${G4DATA}/$(basename ${WORKDIR}/G4ABLA*)"
217 G4NEUTRONHPCROSSSECTIONS="${G4DATA}/$(basename ${WORKDIR}/G4NDL*)"
218 export G4LEVELGAMMADATA G4RADIOACTIVEDATA G4LEDATA \
219 G4ABLADATA G4NEUTRONHPCROSSSECTIONS
220 fi
221
222 # read env variables defined upto now
223 printenv | grep ^G4 | uniq >> ${g4env}
224 # define env vars for capabilities we can build into user projects
225 printenv | uniq | \
226 sed -n -e '/^G4/s:BUILD\(.*\)_DRIVER:USE\1:gp' >> ${g4env}
227 doenvd ${g4env} || die "Installing environment scripts failed "
228 }
229
230 src_install() {
231 # install headers via make since we want them in a single directory
232 cd "${S}/source/"
233 einfo "Installing Geant4 headers"
234 emake includes || die 'Installing headers failed'
235 cd "${S}"
236
237 # but install libraries and Geant library tool manually
238 einfo "Installing Geant4 libraries"
239 insinto ${GEANT4_LIBDIR}
240 doins tmp/*.so || die
241 doins tmp/libname.map || die
242 if use static; then
243 doins tmp/*.a || die
244 fi
245 exeinto ${GEANT4_LIBDIR}
246 doexe tmp/liblist || die
247
248 g4_create_env_script
249
250 # configs
251 insinto ${GEANT4_DIR}
252 doins -r config || die
253
254 # install data
255 if use data; then
256 einfo "Installing Geant4 data"
257 insinto ${G4DATA}
258 pushd "${WORKDIR}" > /dev/null
259 for d in ${GEANT4_DATA}; do
260 local p=${d/.}
261 doins -r *${p/G4} || die "installing data ${d} failed"
262 done
263 popd > /dev/null
264 fi
265
266 # doc and examples
267 insinto /usr/share/doc/${PF}
268 local mypv="${PV1}.${PV2}.${PV3}"
269 doins ReleaseNotes/ReleaseNotes${mypv}.html
270 [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
271 dodoc ReleaseNotes/Patch${mypv}-*.txt
272
273 use examples && doins -r examples
274
275 # TODO: * momo with momo or java flag, and check java stuff
276 }
277
278 pkg_postinst() {
279 elog "Geant4 projects are by default build in \$HOME/geant4."
280 elog "If you want to change, set \$G4WORKDIR to another directory."
281 }