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