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