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: ChangeLog geant-4.9.3_p02.ebuild
Date: Wed, 29 Sep 2010 20:23:49
Message-Id: 20100929202341.8B59B20051@flycatcher.gentoo.org
1 bicatali 10/09/29 20:23:41
2
3 Modified: ChangeLog
4 Added: geant-4.9.3_p02.ebuild
5 Log:
6 Version bump. Patch release, thanks Ben Bannier
7
8 (Portage version: 2.2_rc88/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.41 sci-physics/geant/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/geant/ChangeLog?rev=1.41&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/geant/ChangeLog?rev=1.41&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/geant/ChangeLog?r1=1.40&r2=1.41
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v
20 retrieving revision 1.40
21 retrieving revision 1.41
22 diff -u -r1.40 -r1.41
23 --- ChangeLog 12 Aug 2010 16:26:56 -0000 1.40
24 +++ ChangeLog 29 Sep 2010 20:23:41 -0000 1.41
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sci-physics/geant
27 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.40 2010/08/12 16:26:56 bicatali Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/geant/ChangeLog,v 1.41 2010/09/29 20:23:41 bicatali Exp $
30 +
31 +*geant-4.9.3_p02 (29 Sep 2010)
32 +
33 + 29 Sep 2010; Sébastien Fabbro <bicatali@g.o>
34 + +geant-4.9.3_p02.ebuild:
35 + Version bump
36
37 12 Aug 2010; Sébastien Fabbro <bicatali@g.o>
38 geant-4.9.2_p02.ebuild, -geant-4.9.3.ebuild, geant-4.9.3_p01.ebuild:
39
40
41
42 1.1 sci-physics/geant/geant-4.9.3_p02.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/geant/geant-4.9.3_p02.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/geant/geant-4.9.3_p02.ebuild?rev=1.1&content-type=text/plain
46
47 Index: geant-4.9.3_p02.ebuild
48 ===================================================================
49 # Copyright 1999-2010 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.3_p02.ebuild,v 1.1 2010/09/29 20:23:41 bicatali Exp $
52
53 EAPI=2
54
55 inherit eutils 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="Toolkit for simulation of passage of particles through matter"
63 HOMEPAGE="http://geant4.cern.ch/"
64
65 SRC_COM="http://geant4.cern.ch/support/source"
66 SRC_URI="${SRC_COM}/${MY_P}.tar.gz"
67 GEANT4_DATA="G4NDL.3.13
68 G4EMLOW.6.9
69 G4RadioactiveDecay.3.2
70 PhotonEvaporation.2.0
71 G4ABLA.3.0
72 RealSurface.1.0"
73 for d in ${GEANT4_DATA}; do
74 SRC_URI="${SRC_URI} data? ( ${SRC_COM}/${d}.tar.gz )"
75 done
76
77 LICENSE="geant4"
78 SLOT="4"
79 KEYWORDS="~amd64 ~hppa ~sparc ~x86"
80 IUSE="athena +data dawn debug examples gdml geant3 global minimal +motif
81 +opengl openinventor qt4 +raytracerx static-libs +vrml zlib"
82
83 RDEPEND="<sci-physics/clhep-2.1
84 motif? ( x11-libs/openmotif )
85 athena? ( x11-libs/libXaw )
86 qt4? ( x11-libs/qt-gui:4 )
87 openinventor? ( >=media-libs/openinventor-2.1.5.10-r3 )
88 raytracerx? ( x11-libs/libX11 x11-libs/libXmu )
89 opengl? ( virtual/opengl
90 athena? ( x11-libs/Xaw3d )
91 qt4? ( x11-libs/qt-opengl:4 ) )
92 gdml? ( dev-libs/xerces-c )
93 geant3? ( sci-physics/geant:3 )
94 dawn? ( media-gfx/dawn )
95 zlib? ( sys-libs/zlib )"
96
97 DEPEND="${RDEPEND}"
98
99 S="${WORKDIR}/${MY_P}"
100
101 pkg_setup() {
102 eval unset ${!G4*}
103 }
104
105 src_prepare() {
106 # fix bad zlib dependency
107 epatch "${FILESDIR}"/${PN}-4.9.3-zlib.patch
108
109 # propagate user's flags and compiler settings
110 sed -i -e 's/-o/$(LDFLAGS) -o/g' source/GNUmakefile || die
111 sed -i \
112 -e '/CXX.*:=.*g++/d' \
113 -e '/FC.*:=.*gfortran/d' \
114 -e 's/\(CXXFLAGS.*:=\).*/\1 -ansi/' \
115 -e '/CXXFLAGS.*+=.*pipe/d' \
116 -e "/CXXFLAGS.*=.*-O2/s:=.*:= ${CXXFLAGS}:" \
117 -e "/FCFLAGS.*=.*-O2/s:=.*:= ${FCFLAGS}:" \
118 -e "/CCFLAGS.*=.*-O2/s:=.*:= ${CFLAGS}:" \
119 -e "s:-Wl,-soname:${LDFLAGS} -Wl,-soname:g" \
120 -e "s/libq\*/lib\[q,Q\]t*/g" \
121 config/sys/Linux*gmk || die "flag substitution failed"
122 sed -i \
123 -e 's:g++:$(CXX):g' \
124 config/*.gmk || die "sed for forced g++ failed"
125
126 # fix forced lib directory
127 sed -i \
128 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4LIB):g' \
129 config/binmake.gmk || die "sed binmake.gmk failed"
130 sed -i \
131 -e '/$(G4LIB)\/$(G4SYSTEM)/d' \
132 config/architecture.gmk || die "sed architecture.gmk failed"
133 sed -i \
134 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
135 config/common.gmk || die "sed common.gmk failed"
136 sed -i \
137 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
138 config/moc.gmk || die "sed moc.gmk failed"
139 sed -i \
140 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
141 -e 's:$(G4BIN)/$(G4SYSTEM):$(G4TMP):g' \
142 -e 's:$(G4TMP)/$(G4SYSTEM):$(G4TMP):g' \
143 source/GNUmakefile || die "sed GNUmakefile failed"
144 sed -i \
145 -e 's:$(G4LIB)/$(G4SYSTEM):$(G4TMP):g' \
146 config/globlib.gmk || die "sed globlib.gmk failed"
147
148 # work around a non defined fortran compiler
149 use geant3 && export FC=$(tc-getFC)
150 # don't worry about the g++ name of the file, we remove all specific
151 export G4SYSTEM=Linux-g++
152 }
153
154 src_configure() {
155 export GEANT4_DIR="/usr/share/${PN}${PV1}"
156 # where to put compiled libraries;
157 # we set env var G4LIB in src_install()
158 # to avoid confusing make
159 export GEANT4_LIBDIR=/usr/$(get_libdir)/${PN}${PV1}
160 export G4INSTALL="${S}"
161 export G4WORKDIR="${S}"
162 export G4INCLUDE="${D}/usr/include/${PN}"
163 export CLHEP_BASE_DIR=/usr
164
165 # parse USE; just set flags of drivers to build, G4*_USE_* vars are set
166 # later automatically for G4*_BUILD_*_DRIVER
167 use minimal && export G4UI_NONE=y \
168 && export G4VIS_NONE=y
169
170 use motif && export G4UI_BUILD_XM_SESSION=y
171 use athena && export G4UI_BUILD_XAW_SESSION=y
172 if use qt4; then
173 export G4UI_BUILD_QT_SESSION=y
174 export QTLIBS="-L/usr/$(get_libdir)/qt4 -lQtCore -lQtGui"
175 export QTFLAGS="-I/usr/include/qt4 -I/usr/include/qt4/Qt"
176 use opengl && \
177 export GLQTLIBS="${QTLIBS} -lQtOpenGL"
178 #export QTFLAGS="${QTFLAGS} -I/usr/include/qt4/QtOpenGL"
179 fi
180 use dawn && export G4VIS_BUILD_DAWN_DRIVER=y
181 use raytracerx && export G4VIS_BUILD_RAYTRACERX_DRIVER=y
182 use openinventor && export G4VIS_BUILD_OI_DRIVER=y
183 use opengl && export G4VIS_BUILD_OPENGLX_DRIVER=y
184 use opengl && use motif && export G4VIS_BUILD_OPENGLXM_DRIVER=y
185 use gdml && export G4LIB_BUILD_GDML=y
186 use geant3 && export G4LIB_BUILD_G3TOG4=y
187 use zlib && export G4LIB_USE_ZLIB=y
188 use vrml && export G4VIS_BUILD_VRML_DRIVER=y \
189 && export G4VIS_BUILD_VRMLFILE_DRIVER=y
190 use data && export G4DATA="${GEANT4_DIR}/data"
191 use debug && export G4DEBUG=y || export G4OPTIMIZE=y
192
193 # switch to see compiling flags
194 export CPPVERBOSE=y
195
196 # if shared libs are built, the script will also build static libs
197 # with pic flags
198 # avoid that by building it twice and removing temporary objects
199 export G4LIB_BUILD_SHARED=y
200 }
201
202 src_compile() {
203 cd "${S}/source/"
204 einfo "Building shared library"
205 emake || die "Building shared geant failed"
206
207 if use global; then
208 export G4LIB_USE_GRANULAR=y
209 einfo "Building granular libraries"
210 emake global || die "Building global libraries failed"
211 emake || die "Rebuilding shared geant failed"
212 fi
213
214 if use static-libs; then
215 einfo "Building static libraries"
216 rm -rf tmp
217 export G4LIB_BUILD_STATIC=y ; unset G4LIB_BUILD_SHARED
218 emake || die "Building static geant failed"
219 fi
220 }
221
222 g4_create_env_script() {
223 # we need to change some variables to the final values since we hide these
224 # from make during the compile
225 export G4INSTALL=${GEANT4_DIR}
226 export G4LIB=${GEANT4_LIBDIR}
227 export G4INCLUDE=${G4INCLUDE/${D}/}
228 export G4WORKDIR=\${HOME}/${PN}${PV1}
229
230 local g4env=99${PN}${PV1}
231 cat <<-EOF > ${g4env}
232 LDPATH=${G4LIB}
233 CLHEP_BASE_DIR=${CLHEP_BASE_DIR}
234 EOF
235
236 # detailed data file locations
237 if use data; then
238 G4LEVELGAMMADATA="${G4DATA}/$(basename ${WORKDIR}/PhotonEvaporation*)"
239 G4RADIOACTIVEDATA="${G4DATA}/$(basename ${WORKDIR}/RadioactiveDecay*)"
240 G4LEDATA="${G4DATA}/$(basename ${WORKDIR}/G4EMLOW*)"
241 G4ABLADATA="${G4DATA}/$(basename ${WORKDIR}/G4ABLA*)"
242 G4NEUTRONHPCROSSSECTIONS="${G4DATA}/$(basename ${WORKDIR}/G4NDL*)"
243 G4REALSURFACEDATA="${G4DATA}/$(basename ${WORKDIR}/G4REALSURFACEDATA*)"
244 export G4LEVELGAMMADATA G4RADIOACTIVEDATA G4LEDATA \
245 G4ABLADATA G4NEUTRONHPCROSSSECTIONS G4REALSURFACEDATA
246 fi
247
248 # read env variables defined upto now
249 printenv | grep ^G4 | uniq >> ${g4env}
250 # define env vars for capabilities we can build into user projects
251 printenv | uniq | \
252 sed -n -e '/^G4/s:BUILD\(.*\)_DRIVER:USE\1:gp' >> ${g4env}
253 doenvd ${g4env} || die "Installing environment scripts failed "
254 }
255
256 src_install() {
257 # install headers via make since we want them in a single directory
258 cd "${S}/source/"
259 einfo "Installing Geant4 headers"
260 emake includes || die 'Installing headers failed'
261 cd "${S}"
262
263 # but install libraries and Geant library tool manually
264 einfo "Installing Geant4 libraries"
265 insinto ${GEANT4_LIBDIR}
266 insopts -m0755
267 doins tmp/*.so || die
268 doins tmp/libname.map || die
269 insopts -m0644
270 if use static-libs; then
271 doins tmp/*.a || die
272 fi
273 exeinto ${GEANT4_LIBDIR}
274 doexe tmp/liblist || die
275
276 g4_create_env_script
277
278 # configs
279 insinto ${GEANT4_DIR}
280 doins -r config || die
281
282 # install data
283 if use data; then
284 einfo "Installing Geant4 data"
285 insinto ${G4DATA}
286 pushd "${WORKDIR}" > /dev/null
287 for d in ${GEANT4_DATA}; do
288 local p=${d/.}
289 doins -r *${p/G4} || die "installing data ${d} failed"
290 done
291 popd > /dev/null
292 fi
293
294 # doc and examples
295 insinto /usr/share/doc/${PF}
296 local mypv="${PV1}.${PV2}.${PV3}"
297 doins ReleaseNotes/ReleaseNotes${mypv}.html
298 [[ -e ReleaseNotes/Patch${mypv}-1.txt ]] && \
299 dodoc ReleaseNotes/Patch${mypv}-*.txt
300
301 use examples && doins -r examples
302 # TODO: * momo with momo or java flag, and check java stuff
303 }
304
305 pkg_postinst() {
306 elog "Geant4 projects are by default build in \$HOME/geant4."
307 elog "If you want to change, set \$G4WORKDIR to another directory."
308
309 elog "To use Aida you have to explicitly set G4ANALYSIS_USE=y for"
310 elog "your environment."
311 }