Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/cctbx: cctbx-2010.03.29.2334-r1.ebuild ChangeLog cctbx-2010.03.29.2334.ebuild
Date: Sat, 03 Jul 2010 07:16:05
Message-Id: 20100703071602.7F1E02CE15@corvid.gentoo.org
1 jlec 10/07/03 07:16:02
2
3 Modified: ChangeLog
4 Added: cctbx-2010.03.29.2334-r1.ebuild
5 Removed: cctbx-2010.03.29.2334.ebuild
6 Log:
7 Fix for invalid python syntax
8 (Portage version: 2.2_rc67/cvs/Linux x86_64, RepoMan options: --force)
9
10 Revision Changes Path
11 1.6 sci-libs/cctbx/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?rev=1.6&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?rev=1.6&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?r1=1.5&r2=1.6
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v
20 retrieving revision 1.5
21 retrieving revision 1.6
22 diff -u -r1.5 -r1.6
23 --- ChangeLog 28 Jun 2010 16:09:22 -0000 1.5
24 +++ ChangeLog 3 Jul 2010 07:16:02 -0000 1.6
25 @@ -1,6 +1,13 @@
26 # ChangeLog for sci-libs/cctbx
27 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.5 2010/06/28 16:09:22 angelos Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.6 2010/07/03 07:16:02 jlec Exp $
30 +
31 +*cctbx-2010.03.29.2334-r1 (03 Jul 2010)
32 +
33 + 03 Jul 2010; Justin Lecher <jlec@g.o>
34 + +files/2010.03.29.2334-tst_server.py.patch, -cctbx-2010.03.29.2334.ebuild,
35 + +cctbx-2010.03.29.2334-r1.ebuild:
36 + Fix for invalid python syntax
37
38 28 Jun 2010; Christoph Mende <angelos@g.o>
39 cctbx-2010.03.29.2334.ebuild:
40
41
42
43 1.1 sci-libs/cctbx/cctbx-2010.03.29.2334-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: cctbx-2010.03.29.2334-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2010 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r1.ebuild,v 1.1 2010/07/03 07:16:02 jlec Exp $
53
54 EAPI="3"
55 PYTHON_DEPEND="2"
56
57 inherit eutils python toolchain-funcs
58
59 MY_PV="${PV//./_}"
60
61 DESCRIPTION="Computational Crystallography Toolbox"
62 HOMEPAGE="http://cctbx.sourceforge.net/"
63 SRC_URI="http://cci.lbl.gov/cctbx_build/results/${MY_PV}/${PN}_bundle.tar.gz -> ${P}.tar.gz"
64
65 LICENSE="cctbx-2.0"
66 SLOT="0"
67 KEYWORDS="amd64 ~x86 ~amd64-linux ~x86-linux"
68 IUSE="+minimal openmp threads"
69
70 RDEPEND="
71 >dev-libs/boost-1.39
72 sci-libs/fftw
73 !minimal? (
74 sci-chemistry/cns
75 sci-chemistry/shelx )"
76 DEPEND="${RDEPEND}
77 >=dev-util/scons-1.2"
78
79 S="${WORKDIR}"
80 MY_S="${WORKDIR}"/cctbx_sources
81 MY_B="${WORKDIR}"/cctbx_build
82
83 pkg_setup() {
84 if use openmp &&
85 [[ $(tc-getCC)$ == *gcc* ]] &&
86 ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
87 ! built_with_use sys-devel/gcc openmp )
88 then
89 ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
90 ewarn "If you want to build ${PN} with OpenMP, abort now,"
91 ewarn "and switch CC to an OpenMP capable compiler"
92 fi
93 python_set_active_version 2
94 }
95
96 src_prepare() {
97 local opts
98 local optsld
99
100 epatch "${FILESDIR}"/${PV}-tst_server.py.patch
101
102 rm -rf "${MY_S}/scons"
103
104 mkdir -p "${MY_S}"/scons/src/ "${MY_S}/boost"
105
106 ln -sf "${EPREFIX}"/usr/$(get_libdir)/scons-* "${MY_S}"/scons/src/engine || die
107
108 # Get CXXFLAGS in format suitable for substitition into SConscript
109 for i in ${CXXFLAGS}; do
110 opts="${opts} \"${i}\","
111 done
112
113 # Strip off the last comma
114 opts=${opts%,}
115
116 # Fix CXXFLAGS
117 sed -i \
118 -e "s:\"-O3\", \"-ffast-math\":${opts}:g" \
119 ${MY_S}/libtbx/SConscript
120
121 # Get LDFLAGS in format suitable for substitition into SConscript
122 for i in ${LDFLAGS}; do
123 optsld="${optsld} \"${i}\","
124 done
125
126 optsld=${optsld%,}
127
128 # Fix LDFLAGS which should be as-needed ready
129 sed -i \
130 -e "s:\"-shared\":\"-shared\", ${optsld}:g" \
131 ${MY_S}/libtbx/SConscript
132 }
133
134 src_configure() {
135 local compiler
136 local myconf
137
138 myconf="${MY_S}/libtbx/configure.py"
139
140 # Get compiler in the right way
141 compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
142 myconf="${myconf} --compiler=${compiler}"
143
144 # Precompiling python scripts. It is done in upstreams install script.
145 # Perhaps use python_mod_optimize, but as this script works we should stick to it.
146 $(PYTHON -a) "${MY_S}/libtbx/command_line/py_compile_all.py"
147
148 # Additional USE flag usage
149 check_use openmp
150 myconf="${myconf} --enable-openmp-if-possible=${USE_openmp}"
151
152 use threads && USEthreads="--enable-boost-threads" && \
153 ewarn "If using boost threads openmp support is disabled"
154
155 myconf="${myconf} ${USE_threads} --scan-boost"
156
157 mkdir "${MY_B}" && myconf="${myconf} --current_working_directory=${MY_B}"
158 cd "${MY_B}"
159
160 myconf="${myconf} --build=release fftw3tbx rstbx smtbx mmtbx clipper fable"
161 einfo "configuring with ${python} ${myconf}"
162
163 $(PYTHON -a) ${myconf} \
164 || die "configure failed"
165 }
166
167 src_compile() {
168 local makeopts_exp
169
170 cd "${MY_B}"
171
172 makeopts_exp=${MAKEOPTS/j/j }
173 makeopts_exp=${makeopts_exp%-l[0-9]*}
174
175 source setpaths_all.sh
176
177 einfo "compiling with libtbx.scons ${makeopts_exp}"
178 libtbx.scons ${makeopts_exp} .|| die "make failed"
179 }
180
181 src_test(){
182 source "${MY_B}"/setpaths_all.sh
183 libtbx.python $(libtbx.show_dist_paths boost_adaptbx)/tests/tst_rational.py && \
184 libtbx.python ${SCITBX_DIST}/run_tests.py ${MAKEOPTS_EXP} && \
185 libtbx.python ${CCTBX_DIST}/run_tests.py ${MAKEOPTS_EXP} \
186 || die "test failed"
187 }
188
189 src_install(){
190 # This is what Bill Scott does in the fink package. Do we need this as well?
191 # -e "s:prepend:append:g" \
192
193 find cctbx_build/ -type f \( -name "*.py" -o -name "*sh" \) -exec \
194 sed -e "s:${MY_S}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_sources:g" \
195 -e "s:${MY_B}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build:g" \
196 -i '{}' \; || die "Fail to correct path"
197
198 ebegin "removing unnessary files"
199 rm -r "${S}"/cctbx_sources/{boost,scons} || die "failed to remove uneeded scons"
200 find "${S}" -type f -name "*conftest*" -delete || die "failed to remove uneeded *.o"
201 find "${S}" -type f -name "*.o" -delete || die "failed to remove uneeded *.o"
202 find "${S}" -type f -name "*.c" -delete || die "failed to remove uneeded *.c"
203 find "${S}" -type f -name "*.f" -delete || die "failed to remove uneeded *.c"
204 find "${S}" -type f -name "*.cpp" -delete || die "failed to remove uneeded *.cpp"
205 find "${S}" -type f -name "*.pyc" -delete || die "failed to remove uneeded *.pyc"
206 find "${S}" -type d -empty -delete || die
207 eend
208
209 insinto /usr/$(get_libdir)/${PN}
210 doins -r cctbx_sources cctbx_build || die
211
212 # fperms cannot handle wildcards
213 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/*sh && \
214 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/lib/* && \
215 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/array_family/* && \
216 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/serialization/* && \
217 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/error/* && \
218 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/fftpack/timing/* && \
219 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/lbfgs/* && \
220 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/chiltbx/handle_test && \
221 chmod 775 "${ED}"/usr/$(get_libdir)/${PN}/cctbx_build/bin/* || \
222 die
223
224 insinto /etc/profile.d/
225 newins "${MY_B}"/setpaths.sh 30cctbx.sh || die
226 newins "${MY_B}"/setpaths.csh 30cctbx.csh || die
227
228 cat >> "${T}"/30cctbx <<- EOF
229 LDPATH="${EPREFIX}/usr/$(get_libdir)/${PN}/cctbx_build/lib"
230 EOF
231
232 doenvd "${T}"/30cctbx || die
233 }
234
235 pkg_postinst () {
236 python_need_rebuild
237 python_mod_optimize /usr/$(get_libdir)/${PN}/cctbx_sources
238 }
239
240 pkg_postrm () {
241 python_mod_cleanup /usr/$(get_libdir)/${PN}/cctbx_sources
242 }
243
244 check_use() {
245 for var in $@; do
246 if use ${var}; then
247 printf -v "USE_$var" True
248 else
249 printf -v "USE_$var" False
250 fi
251 shift
252 done
253 }