Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:ccp4 commit in: sci-libs/cctbx/files/2013.02.27.0005/, sci-libs/cctbx/files/2012.05.08.2305/, ...
Date: Sat, 01 Jun 2013 17:24:39
Message-Id: 1370105343.4dcc9136254923ef49146f459eb013152c907372.jlec@gentoo
1 commit: 4dcc9136254923ef49146f459eb013152c907372
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 1 16:49:03 2013 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 1 16:49:03 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=4dcc9136
7
8 sci-libs/cctbx: Version Bump
9
10 Package-Manager: portage-2.2.0_alpha177
11
12 ---
13 sci-libs/cctbx/ChangeLog | 218 ++++
14 sci-libs/cctbx/cctbx-2012.05.08.2305.ebuild | 81 ++
15 sci-libs/cctbx/cctbx-2013.02.27.0005.ebuild | 81 ++
16 .../0001-remove-hardcoded-libtbx_build-env.patch | 24 +
17 .../0002-fix-opengl-header-missing-gltbx.patch | 51 +
18 ...0003-correct-paths-in-dispatcher-creation.patch | 85 ++
19 ...ream-fix-for-declaration-errors-in-gcc4.7.patch | 442 ++++++++
20 .../0005-fix-for-gcc4.7-compilation-error.patch | 83 ++
21 ...-for-system-libs-installtarget-and-prefix.patch | 1080 +++++++++++++++++++
22 .../0007-adding-shlib-versioning.patch | 208 ++++
23 .../0008-Fix-to-skip-pycbf-build.patch | 52 +
24 .../0009-build-libann-statically.patch | 27 +
25 .../2012.05.08.2305/0010-adding-setup_py.patch | 662 ++++++++++++
26 ...011-fix-missing-python-lib-during-linking.patch | 47 +
27 ...12-fix-to-remove-cctbx.python-interpreter.patch | 29 +
28 ...o-support-LDFLAGS-in-use_enviroment_flags.patch | 90 ++
29 .../0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch | 21 +
30 .../0016-autogenerate-pkgconfig-files.patch | 305 ++++++
31 .../0017-Fix-to-use-systems-include-path.patch | 128 +++
32 ...018-Fix-to-skip-build-of-clipper-examples.patch | 52 +
33 .../files/2012.05.08.2305/0101-system-cbf.patch | 16 +
34 .../2012.05.08.2305/0101-system-clipper.patch | 185 ++++
35 .../files/2012.05.08.2305/0102-dontstrip.patch | 25 +
36 .../0001-remove-hardcoded-libtbx_build-env.patch | 24 +
37 .../0002-fix-opengl-header-missing-gltbx.patch | 51 +
38 ...0003-correct-paths-in-dispatcher-creation.patch | 86 ++
39 ...-for-system-libs-installtarget-and-prefix.patch | 1099 ++++++++++++++++++++
40 .../0007-adding-shlib-versioning.patch | 208 ++++
41 .../0008-Fix-to-skip-pycbf-build.patch | 52 +
42 .../0009-build-libann-statically.patch | 27 +
43 .../2013.02.27.0005/0010-adding-setup_py.patch | 662 ++++++++++++
44 ...011-fix-missing-python-lib-during-linking.patch | 47 +
45 ...12-fix-to-remove-cctbx.python-interpreter.patch | 20 +
46 ...o-support-LDFLAGS-in-use_enviroment_flags.patch | 90 ++
47 .../0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch | 21 +
48 .../0016-autogenerate-pkgconfig-files.patch | 305 ++++++
49 .../0017-Fix-to-use-systems-include-path.patch | 128 +++
50 ...018-Fix-to-skip-build-of-clipper-examples.patch | 52 +
51 .../files/2013.02.27.0005/0101-system-cbf.patch | 16 +
52 .../2013.02.27.0005/0101-system-clipper.patch | 185 ++++
53 .../2013.02.27.0005/0101-system-libccp4.patch | 15 +
54 .../files/2013.02.27.0005/0102-dontstrip.patch | 25 +
55 .../2013.02.27.0005/0103-respect-cflags.patch | 60 ++
56 sci-libs/cctbx/metadata.xml | 18 +
57 44 files changed, 7183 insertions(+)
58
59 diff --git a/sci-libs/cctbx/ChangeLog b/sci-libs/cctbx/ChangeLog
60 new file mode 100644
61 index 0000000..949d710
62 --- /dev/null
63 +++ b/sci-libs/cctbx/ChangeLog
64 @@ -0,0 +1,218 @@
65 +# ChangeLog for sci-libs/cctbx
66 +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
67 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.33 2013/03/19 07:07:15 jlec Exp $
68 +
69 +*cctbx-2013.02.27.0005 (01 Jun 2013)
70 +*cctbx-2012.05.08.2305 (01 Jun 2013)
71 +
72 + 01 Jun 2013; Justin Lecher <jlec@g.o> +cctbx-2012.05.08.2305.ebuild,
73 + +cctbx-2013.02.27.0005.ebuild,
74 + +files/2012.05.08.2305/0001-remove-hardcoded-libtbx_build-env.patch,
75 + +files/2012.05.08.2305/0002-fix-opengl-header-missing-gltbx.patch,
76 + +files/2012.05.08.2305/0003-correct-paths-in-dispatcher-creation.patch,
77 + +files/2012.05.08.2305/0004-upstream-fix-for-declaration-errors-in-gcc4.7.pat
78 + ch, +files/2012.05.08.2305/0005-fix-for-gcc4.7-compilation-error.patch,
79 + +files/2012.05.08.2305/0006-options-for-system-libs-installtarget-and-prefix.
80 + patch, +files/2012.05.08.2305/0007-adding-shlib-versioning.patch,
81 + +files/2012.05.08.2305/0008-Fix-to-skip-pycbf-build.patch,
82 + +files/2012.05.08.2305/0009-build-libann-statically.patch,
83 + +files/2012.05.08.2305/0010-adding-setup_py.patch,
84 + +files/2012.05.08.2305/0011-fix-missing-python-lib-during-linking.patch,
85 + +files/2012.05.08.2305/0012-fix-to-remove-cctbx.python-interpreter.patch,
86 + +files/2012.05.08.2305/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.pa
87 + tch, +files/2012.05.08.2305/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch,
88 + +files/2012.05.08.2305/0016-autogenerate-pkgconfig-files.patch,
89 + +files/2012.05.08.2305/0017-Fix-to-use-systems-include-path.patch,
90 + +files/2012.05.08.2305/0018-Fix-to-skip-build-of-clipper-examples.patch,
91 + +files/2012.05.08.2305/0101-system-cbf.patch,
92 + +files/2012.05.08.2305/0101-system-clipper.patch,
93 + +files/2012.05.08.2305/0102-dontstrip.patch,
94 + +files/2013.02.27.0005/0001-remove-hardcoded-libtbx_build-env.patch,
95 + +files/2013.02.27.0005/0002-fix-opengl-header-missing-gltbx.patch,
96 + +files/2013.02.27.0005/0003-correct-paths-in-dispatcher-creation.patch,
97 + +files/2013.02.27.0005/0006-options-for-system-libs-installtarget-and-prefix.
98 + patch, +files/2013.02.27.0005/0007-adding-shlib-versioning.patch,
99 + +files/2013.02.27.0005/0008-Fix-to-skip-pycbf-build.patch,
100 + +files/2013.02.27.0005/0009-build-libann-statically.patch,
101 + +files/2013.02.27.0005/0010-adding-setup_py.patch,
102 + +files/2013.02.27.0005/0011-fix-missing-python-lib-during-linking.patch,
103 + +files/2013.02.27.0005/0012-fix-to-remove-cctbx.python-interpreter.patch,
104 + +files/2013.02.27.0005/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.pa
105 + tch, +files/2013.02.27.0005/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch,
106 + +files/2013.02.27.0005/0016-autogenerate-pkgconfig-files.patch,
107 + +files/2013.02.27.0005/0017-Fix-to-use-systems-include-path.patch,
108 + +files/2013.02.27.0005/0018-Fix-to-skip-build-of-clipper-examples.patch,
109 + +files/2013.02.27.0005/0101-system-cbf.patch,
110 + +files/2013.02.27.0005/0101-system-clipper.patch,
111 + +files/2013.02.27.0005/0101-system-libccp4.patch,
112 + +files/2013.02.27.0005/0102-dontstrip.patch,
113 + +files/2013.02.27.0005/0103-respect-cflags.patch, +metadata.xml:
114 + Version Bump
115 +
116 + 19 Mar 2013; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r7.ebuild:
117 + Use more functions from new python eclasses, fixes double prefix on PREFIX
118 +
119 + 17 Mar 2013; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r6.ebuild,
120 + cctbx-2010.03.29.2334-r7.ebuild:
121 + Add missing multilib.eclass
122 +
123 +*cctbx-2010.03.29.2334-r7 (17 Mar 2013)
124 +
125 + 17 Mar 2013; Justin Lecher <jlec@g.o>
126 + +cctbx-2010.03.29.2334-r7.ebuild, metadata.xml:
127 + Move to new python eclasses, log all file removals; bump to EAPI=5;add
128 + missing die; use usex instead of custom check_use
129 +
130 + 19 Oct 2012; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r6.ebuild:
131 + Remove virtual/fortran and always call fortran-2_pkg_setup as intend by the
132 + updated fortran-2.eclass
133 +
134 + 18 Oct 2012; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r6.ebuild:
135 + Remove virtual/fortran and always call fortran-2_pkg_setup as intend by the
136 + updated fortran-2.eclass
137 +
138 + 06 Sep 2012; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r6.ebuild:
139 + Use bundled scons on prefix, #391377
140 +
141 + 26 Aug 2012; Justin Lecher <jlec@g.o>
142 + -cctbx-2010.03.29.2334-r3.ebuild, -cctbx-2010.03.29.2334-r4.ebuild,
143 + -cctbx-2010.03.29.2334-r5.ebuild:
144 + Drop old
145 +
146 + 19 Jun 2012; Justin Lecher <jlec@g.o>
147 + +files/2010.03.29.2334-gcc-4.7.patch, cctbx-2010.03.29.2334-r6.ebuild:
148 + Add fix for gcc-4.7
149 +
150 + 14 Jun 2012; Jeff Horelick <jdhore@g.o>
151 + cctbx-2010.03.29.2334-r6.ebuild:
152 + marked x86 per bug 413815
153 +
154 + 23 May 2012; Agostino Sarubbo <ago@g.o>
155 + cctbx-2010.03.29.2334-r6.ebuild:
156 + Stable for amd64, wrt bug #413815
157 +
158 + 10 Feb 2012; Markos Chandras <hwoarang@g.o>
159 + cctbx-2010.03.29.2334-r3.ebuild, cctbx-2010.03.29.2334-r4.ebuild,
160 + cctbx-2010.03.29.2334-r5.ebuild, cctbx-2010.03.29.2334-r6.ebuild:
161 + Update Boost dependencies. Thanks to Arfrever
162 +
163 +*cctbx-2010.03.29.2334-r6 (10 Feb 2012)
164 +
165 + 10 Feb 2012; Justin Lecher <jlec@g.o>
166 + +cctbx-2010.03.29.2334-r6.ebuild:
167 + Add fixes for boost-1.48 and its PyABI specific libs, #401393
168 +
169 +*cctbx-2010.03.29.2334-r5 (04 Dec 2011)
170 +
171 + 04 Dec 2011; Justin Lecher <jlec@g.o>
172 + +cctbx-2010.03.29.2334-r5.ebuild:
173 + Create soname symlink, streamelined find and delete of unwanted files
174 +
175 + 07 Oct 2011; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r3.ebuild,
176 + cctbx-2010.03.29.2334-r4.ebuild, metadata.xml:
177 + Added [python] to dep on dev-libs/boost
178 +
179 + 21 Jun 2011; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r3.ebuild,
180 + cctbx-2010.03.29.2334-r4.ebuild:
181 + Add dependency on virtual/fortran
182 +
183 + 21 Jun 2011; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r3.ebuild,
184 + cctbx-2010.03.29.2334-r4.ebuild:
185 + Added fortran-2.eclass support
186 +
187 +*cctbx-2010.03.29.2334-r4 (10 Apr 2011)
188 +
189 + 10 Apr 2011; Justin Lecher <jlec@g.o>
190 + +files/2010.03.29.2334-gcc-4.6.patch, +cctbx-2010.03.29.2334-r4.ebuild:
191 + Fix changes in gcc-4.6
192 +
193 + 24 Jan 2011; Justin Lecher <jlec@g.o>
194 + -cctbx-2010.03.29.2334-r1.ebuild:
195 + Removed old
196 +
197 + 23 Jan 2011; Thomas Kahle <tomka@g.o> cctbx-2010.03.29.2334-r3.ebuild:
198 + x86 stable per bug 351765
199 +
200 + 16 Jan 2011; Markos Chandras <hwoarang@g.o>
201 + cctbx-2010.03.29.2334-r3.ebuild:
202 + Stable on amd64 wrt bug #351765
203 +
204 + 16 Jan 2011; Kacper Kowalik <xarthisius@g.o>
205 + cctbx-2010.03.29.2334-r3.ebuild:
206 + marked ~ppc wrt #303931
207 +
208 + 15 Jan 2011; Justin Lecher <jlec@g.o>
209 + -cctbx-2009.11.01.0123-r1.ebuild, -cctbx-2010.03.29.2334-r2.ebuild:
210 + Removed old
211 +
212 + 15 Jan 2011; Justin Lecher <jlec@g.o>
213 + files/2010.03.29.2334-boost.patch, cctbx-2010.03.29.2334-r2.ebuild,
214 + cctbx-2010.03.29.2334-r3.ebuild:
215 + Prefix boost detection fix
216 +
217 + 29 Dec 2010; Justin Lecher <jlec@g.o> cctbx-2009.11.01.0123-r1.ebuild,
218 + cctbx-2010.03.29.2334-r1.ebuild, cctbx-2010.03.29.2334-r2.ebuild,
219 + cctbx-2010.03.29.2334-r3.ebuild:
220 + Added missing dependency on clipper
221 +
222 + 16 Dec 2010; Justin Lecher <jlec@g.o> cctbx-2009.11.01.0123-r1.ebuild,
223 + cctbx-2010.03.29.2334-r1.ebuild, cctbx-2010.03.29.2334-r2.ebuild,
224 + cctbx-2010.03.29.2334-r3.ebuild:
225 + Added missing RDEPEND on sci-libs/clipper
226 +
227 +*cctbx-2010.03.29.2334-r3 (15 Dec 2010)
228 +
229 + 15 Dec 2010; Justin Lecher <jlec@g.o>
230 + +cctbx-2010.03.29.2334-r3.ebuild:
231 + Fixing all binaray wrappers
232 +
233 + 12 Sep 2010; Justin Lecher <jlec@g.o>
234 + cctbx-2009.11.01.0123-r1.ebuild, cctbx-2010.03.29.2334-r1.ebuild,
235 + cctbx-2010.03.29.2334-r2.ebuild:
236 + Switched to tc-has-openmp and remove built_with_use
237 +
238 +*cctbx-2010.03.29.2334-r2 (12 Sep 2010)
239 +
240 + 12 Sep 2010; Justin Lecher <jlec@g.o>
241 + +files/2010.03.29.2334-boost.patch, +cctbx-2010.03.29.2334-r2.ebuild,
242 + +files/2010.03.29.2334-clipper.patch, +files/2010.03.29.2334-flags.patch,
243 + +files/2010.03.29.2334-soname.patch:
244 + Big rewrite
245 +
246 +*cctbx-2010.03.29.2334-r1 (03 Jul 2010)
247 +
248 + 03 Jul 2010; Justin Lecher <jlec@g.o>
249 + +files/2010.03.29.2334-tst_server.py.patch, -cctbx-2010.03.29.2334.ebuild,
250 + +cctbx-2010.03.29.2334-r1.ebuild:
251 + Fix for invalid python syntax
252 +
253 + 28 Jun 2010; Christoph Mende <angelos@g.o>
254 + cctbx-2010.03.29.2334.ebuild:
255 + Stable on amd64 wrt bug #325965
256 +
257 + 16 Jun 2010; Justin Lecher <jlec@g.o>
258 + cctbx-2009.11.01.0123-r1.ebuild, cctbx-2010.03.29.2334.ebuild:
259 + Last fixes for prefix and keyworded for *-linux
260 +
261 +*cctbx-2010.03.29.2334 (22 May 2010)
262 +
263 + 22 May 2010; Justin Lecher <jlec@g.o>
264 + +cctbx-2010.03.29.2334.ebuild:
265 + Version bump
266 +
267 + 14 Feb 2010; Justin Lecher (jlec) <jlec@g.o>
268 + -cctbx-2009.11.01.0123.ebuild, +cctbx-2009.11.01.0123-r1.ebuild:
269 + Workaround for broken python.eclass
270 +
271 +*cctbx-2009.11.01.0123-r1 (13 Feb 2010)
272 +
273 + 13 Feb 2010; Justin Lecher (jlec) <jlec@g.o>
274 + +cctbx-2009.11.01.0123-r1.ebuild:
275 + Correct usage of new python.eclass
276 +
277 +*cctbx-2009.11.01.0123 (04 Feb 2010)
278 +
279 + 04 Feb 2010; Justin Lecher (jlec) <jlec@g.o>
280 + +cctbx-2009.11.01.0123.ebuild, +metadata.xml:
281 + New ebuild, initialy written by dberkholz
282 +
283
284 diff --git a/sci-libs/cctbx/cctbx-2012.05.08.2305.ebuild b/sci-libs/cctbx/cctbx-2012.05.08.2305.ebuild
285 new file mode 100644
286 index 0000000..ac51db7
287 --- /dev/null
288 +++ b/sci-libs/cctbx/cctbx-2012.05.08.2305.ebuild
289 @@ -0,0 +1,81 @@
290 +# Copyright 1999-2013 Gentoo Foundation
291 +# Distributed under the terms of the GNU General Public License v2
292 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild,v 1.3 2013/03/19 07:07:15 jlec Exp $
293 +
294 +EAPI=5
295 +
296 +DISTUTILS_SINGLE_IMPL=true
297 +PYTHON_COMPAT=( python{2_6,2_7} )
298 +
299 +inherit distutils-r1 eutils fortran-2 multilib toolchain-funcs
300 +
301 +MY_PV="${PV//./_}"
302 +
303 +DESCRIPTION="Computational Crystallography Toolbox"
304 +HOMEPAGE="http://cctbx.sourceforge.net/"
305 +SRC_URI="http://cci.lbl.gov/cctbx_build/results/${MY_PV}/${PN}_bundle.tar.gz -> ${P}.tar.gz"
306 +
307 +LICENSE="cctbx-2.0"
308 +SLOT="0"
309 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
310 +IUSE="+minimal"
311 +
312 +RDEPEND="
313 + >=dev-libs/boost-1.48[python,${PYTHON_USEDEP}]
314 + sci-libs/clipper
315 + sci-libs/fftw:2.1
316 + sci-libs/libccp4
317 + !minimal? (
318 + sci-chemistry/cns
319 + sci-chemistry/shelx )"
320 +DEPEND="${RDEPEND}
321 + !prefix? ( >=dev-util/scons-1.2[${PYTHON_USEDEP}] )"
322 +
323 +S="${WORKDIR}"
324 +MY_S="${WORKDIR}"/cctbx_sources
325 +MY_B="${WORKDIR}"/cctbx_build
326 +
327 +pkg_setup() {
328 + use openmp && FORTRAN_NEED_OPENMP="1"
329 + if use openmp && ! tc-has-openmp; then
330 + ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 and icc"
331 + ewarn "If you want to build ${PN} with OpenMP, abort now,"
332 + ewarn "and switch CC to an OpenMP capable compiler"
333 + FORTRAN_NEED_OPENMP=1
334 + fi
335 + fortran-2_pkg_setup
336 + python-single-r1_pkg_setup
337 +}
338 +
339 +python_prepare_all() {
340 + local opts
341 + local optsld
342 +
343 + EPATCH_OPTS="-p1" \
344 + epatch \
345 + "${FILESDIR}"/${PV}/*patch
346 +
347 + export MULTILIBDIR=$(get_libdir)
348 +
349 + # Clean sources
350 + rm -rf "${MY_S}"/boost/* || die
351 + rm -rf "${MY_S}"/PyCifRW/* || die
352 + find "${MY_S}"/cbflib -maxdepth 1 -mindepth 1 -not -name examples -exec rm -rf {} + || die
353 + find "${MY_S}"/ccp4io/lib -maxdepth 1 -mindepth 1 -not -name ssm -exec rm -rf {} + || die
354 + find "${MY_S}"/clipper -maxdepth 1 -mindepth 1 -not -name clipper -exec rm -rf {} + || die
355 +# find "${MY_S}"/clipper/clipper -maxdepth 1 -mindepth 1 \( -not -name cctbx -a -not -name contrib \) -exec rm -rf {} + || die
356 + find "${MY_S}"/clipper/clipper -maxdepth 1 -mindepth 1 -not -name cctbx -exec rm -rf {} + || die
357 + rm -rf "${MY_S}"/gui_resources/gl2ps || die
358 +# rm -rf "${MY_S}"/scons || die
359 + rm -rf "${MY_S}"/ucif/antlr3 || die
360 +# rm -rvf "${MY_S}"/ccp4io/lib/ssm || die
361 +
362 +# find "${MY_S}/clipper" -name "*.h" -print -delete >> "${T}"/clean.log || die
363 +
364 + if ! use prefix; then
365 + rm -rvf "${MY_S}/scons" >> "${T}"/clean.log || die
366 + echo "import os, sys; os.execvp('scons', sys.argv)" > "${MY_S}"/libtbx/command_line/scons.py || die
367 + fi
368 +
369 + distutils-r1_python_prepare_all
370 +}
371
372 diff --git a/sci-libs/cctbx/cctbx-2013.02.27.0005.ebuild b/sci-libs/cctbx/cctbx-2013.02.27.0005.ebuild
373 new file mode 100644
374 index 0000000..ac51db7
375 --- /dev/null
376 +++ b/sci-libs/cctbx/cctbx-2013.02.27.0005.ebuild
377 @@ -0,0 +1,81 @@
378 +# Copyright 1999-2013 Gentoo Foundation
379 +# Distributed under the terms of the GNU General Public License v2
380 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild,v 1.3 2013/03/19 07:07:15 jlec Exp $
381 +
382 +EAPI=5
383 +
384 +DISTUTILS_SINGLE_IMPL=true
385 +PYTHON_COMPAT=( python{2_6,2_7} )
386 +
387 +inherit distutils-r1 eutils fortran-2 multilib toolchain-funcs
388 +
389 +MY_PV="${PV//./_}"
390 +
391 +DESCRIPTION="Computational Crystallography Toolbox"
392 +HOMEPAGE="http://cctbx.sourceforge.net/"
393 +SRC_URI="http://cci.lbl.gov/cctbx_build/results/${MY_PV}/${PN}_bundle.tar.gz -> ${P}.tar.gz"
394 +
395 +LICENSE="cctbx-2.0"
396 +SLOT="0"
397 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
398 +IUSE="+minimal"
399 +
400 +RDEPEND="
401 + >=dev-libs/boost-1.48[python,${PYTHON_USEDEP}]
402 + sci-libs/clipper
403 + sci-libs/fftw:2.1
404 + sci-libs/libccp4
405 + !minimal? (
406 + sci-chemistry/cns
407 + sci-chemistry/shelx )"
408 +DEPEND="${RDEPEND}
409 + !prefix? ( >=dev-util/scons-1.2[${PYTHON_USEDEP}] )"
410 +
411 +S="${WORKDIR}"
412 +MY_S="${WORKDIR}"/cctbx_sources
413 +MY_B="${WORKDIR}"/cctbx_build
414 +
415 +pkg_setup() {
416 + use openmp && FORTRAN_NEED_OPENMP="1"
417 + if use openmp && ! tc-has-openmp; then
418 + ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 and icc"
419 + ewarn "If you want to build ${PN} with OpenMP, abort now,"
420 + ewarn "and switch CC to an OpenMP capable compiler"
421 + FORTRAN_NEED_OPENMP=1
422 + fi
423 + fortran-2_pkg_setup
424 + python-single-r1_pkg_setup
425 +}
426 +
427 +python_prepare_all() {
428 + local opts
429 + local optsld
430 +
431 + EPATCH_OPTS="-p1" \
432 + epatch \
433 + "${FILESDIR}"/${PV}/*patch
434 +
435 + export MULTILIBDIR=$(get_libdir)
436 +
437 + # Clean sources
438 + rm -rf "${MY_S}"/boost/* || die
439 + rm -rf "${MY_S}"/PyCifRW/* || die
440 + find "${MY_S}"/cbflib -maxdepth 1 -mindepth 1 -not -name examples -exec rm -rf {} + || die
441 + find "${MY_S}"/ccp4io/lib -maxdepth 1 -mindepth 1 -not -name ssm -exec rm -rf {} + || die
442 + find "${MY_S}"/clipper -maxdepth 1 -mindepth 1 -not -name clipper -exec rm -rf {} + || die
443 +# find "${MY_S}"/clipper/clipper -maxdepth 1 -mindepth 1 \( -not -name cctbx -a -not -name contrib \) -exec rm -rf {} + || die
444 + find "${MY_S}"/clipper/clipper -maxdepth 1 -mindepth 1 -not -name cctbx -exec rm -rf {} + || die
445 + rm -rf "${MY_S}"/gui_resources/gl2ps || die
446 +# rm -rf "${MY_S}"/scons || die
447 + rm -rf "${MY_S}"/ucif/antlr3 || die
448 +# rm -rvf "${MY_S}"/ccp4io/lib/ssm || die
449 +
450 +# find "${MY_S}/clipper" -name "*.h" -print -delete >> "${T}"/clean.log || die
451 +
452 + if ! use prefix; then
453 + rm -rvf "${MY_S}/scons" >> "${T}"/clean.log || die
454 + echo "import os, sys; os.execvp('scons', sys.argv)" > "${MY_S}"/libtbx/command_line/scons.py || die
455 + fi
456 +
457 + distutils-r1_python_prepare_all
458 +}
459
460 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0001-remove-hardcoded-libtbx_build-env.patch b/sci-libs/cctbx/files/2012.05.08.2305/0001-remove-hardcoded-libtbx_build-env.patch
461 new file mode 100644
462 index 0000000..14d3f09
463 --- /dev/null
464 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0001-remove-hardcoded-libtbx_build-env.patch
465 @@ -0,0 +1,24 @@
466 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
467 +Date: Sat, 30 Jun 2012 15:50:22 +0200
468 +Subject: remove-hardcoded-libtbx_build-env
469 +
470 +---
471 + cctbx_sources/libtbx/env_config.py | 5 ++++-
472 + 1 file changed, 4 insertions(+), 1 deletion(-)
473 +
474 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
475 +index 9c01e0f..8a62446 100644
476 +--- a/cctbx_sources/libtbx/env_config.py
477 ++++ b/cctbx_sources/libtbx/env_config.py
478 +@@ -2147,7 +2147,10 @@ def cold_start(args):
479 + env.refresh()
480 +
481 + def unpickle():
482 +- build_path = os.environ["LIBTBX_BUILD"]
483 ++ if os.environ.has_key("LIBTBX_BUILD"):
484 ++ build_path = os.environ["LIBTBX_BUILD"]
485 ++ else:
486 ++ build_path = "/usr/share/cctbx/python%d.%d"%(sys.version_info[:2])
487 + set_preferred_sys_prefix_and_sys_executable(build_path=build_path)
488 + libtbx_env = open(op.join(build_path, "libtbx_env"), "rb")
489 + env = pickle.load(libtbx_env)
490
491 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0002-fix-opengl-header-missing-gltbx.patch b/sci-libs/cctbx/files/2012.05.08.2305/0002-fix-opengl-header-missing-gltbx.patch
492 new file mode 100644
493 index 0000000..d3684a5
494 --- /dev/null
495 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0002-fix-opengl-header-missing-gltbx.patch
496 @@ -0,0 +1,51 @@
497 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
498 +Date: Sat, 30 Jun 2012 15:51:06 +0200
499 +Subject: fix-opengl-header-missing-gltbx
500 +
501 +---
502 + cctbx_sources/gltbx/SConscript | 32 ++++++++++++++++----------------
503 + 1 file changed, 16 insertions(+), 16 deletions(-)
504 +
505 +diff --git a/cctbx_sources/gltbx/SConscript b/cctbx_sources/gltbx/SConscript
506 +index d02e7a5..4b2213d 100644
507 +--- a/cctbx_sources/gltbx/SConscript
508 ++++ b/cctbx_sources/gltbx/SConscript
509 +@@ -45,22 +45,22 @@ if (not env_etc.no_boost_python):
510 + env=env,
511 + paths=env_etc.gltbx_common_includes + [env_etc.python_include])
512 + #
513 +- env_etc.gltbx_has_usable_opengl = False
514 +- conf = trial_env.Configure()
515 +- flag, output = conf.TryRun("""
516 +-#include <gltbx/include_opengl.h>
517 +-#include <iostream>
518 +-int main() { std::cout << GL_POINT << std::endl; return 0; }
519 +-""", extension=".cpp")
520 +- conf.Finish()
521 +- if (flag and len(output.strip()) != 0):
522 +- conf = env.Configure()
523 +- if (conf.TryCompile("""
524 +-#include <gltbx/include_opengl.h>
525 +-""", extension=".cpp")):
526 +- env_etc.gltbx_has_usable_opengl = True
527 +- conf.Finish()
528 +- #
529 ++ env_etc.gltbx_has_usable_opengl = True
530 ++# conf = trial_env.Configure()
531 ++# flag, output = conf.TryRun("""
532 ++##include <gltbx/include_opengl.h>
533 ++##include <iostream>
534 ++#int main() { std::cout << GL_POINT << std::endl; return 0; }
535 ++#""", extension=".cpp")
536 ++# conf.Finish()
537 ++# if (flag and len(output.strip()) != 0):
538 ++# conf = env.Configure()
539 ++# if (conf.TryCompile("""
540 ++##include <gltbx/include_opengl.h>
541 ++#""", extension=".cpp")):
542 ++# env_etc.gltbx_has_usable_opengl = True
543 ++# conf.Finish()
544 ++# #
545 + if (not env_etc.gltbx_has_usable_opengl):
546 + print "gltbx: OpenGL headers and/or libraries not available."
547 + print "gltbx: Compilation skipped."
548
549 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0003-correct-paths-in-dispatcher-creation.patch b/sci-libs/cctbx/files/2012.05.08.2305/0003-correct-paths-in-dispatcher-creation.patch
550 new file mode 100644
551 index 0000000..4fe0ea3
552 --- /dev/null
553 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0003-correct-paths-in-dispatcher-creation.patch
554 @@ -0,0 +1,85 @@
555 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
556 +Date: Sat, 30 Jun 2012 16:01:20 +0200
557 +Subject: correct-paths-in-dispatcher-creation
558 +
559 +---
560 + cctbx_sources/libtbx/env_config.py | 48 ++++++++++++++++++------------------
561 + 1 file changed, 24 insertions(+), 24 deletions(-)
562 +
563 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
564 +index 8a62446..c3e1c7d 100644
565 +--- a/cctbx_sources/libtbx/env_config.py
566 ++++ b/cctbx_sources/libtbx/env_config.py
567 +@@ -894,26 +894,26 @@ Wait for the command to finish, then try again.""" % vars())
568 + print >> f, '# command at the end.'
569 + print >> f, '#'
570 + write_do_not_edit(f=f)
571 +- print >> f, '# To customize this auto-generated script create'
572 ++ #print >> f, '# To customize this auto-generated script create'
573 + print >> f, '#'
574 +- print >> f, '# dispatcher_include*.sh'
575 ++ #print >> f, '# dispatcher_include*.sh'
576 + print >> f, '#'
577 +- print >> f, '# files in %s and run' % show_string(abs(self.build_path))
578 ++ #print >> f, '# files in %s and run' % show_string(abs(self.build_path))
579 + print >> f, '#'
580 +- print >> f, '# libtbx.refresh'
581 ++ #print >> f, '# libtbx.refresh'
582 + print >> f, '#'
583 + print >> f, '# to re-generate the dispatchers (libtbx.refresh is a subset'
584 + print >> f, '# of the functionality of the libtbx/configure.py command).'
585 + print >> f, '#'
586 +- print >> f, '# See also:'
587 +- print >> f, '# %s' \
588 +- % show_string(self.under_build("dispatcher_include_template.sh"))
589 ++ #print >> f, '# See also:'
590 ++ #print >> f, '# %s' \
591 ++ # % show_string(self.under_build("dispatcher_include_template.sh"))
592 + print >> f, '#'
593 + print >> f, 'unset PYTHONHOME'
594 + print >> f, 'LC_ALL=C'
595 + print >> f, 'export LC_ALL'
596 +- print >> f, 'LIBTBX_BUILD="$(cd "$(dirname "$0")" && cd .. && pwd -P)"'
597 +- print >> f, 'export LIBTBX_BUILD'
598 ++ #print >> f, 'LIBTBX_BUILD="$(cd "$(dirname "$0")" && cd .. && pwd -P)"'
599 ++ #print >> f, 'export LIBTBX_BUILD'
600 + print >> f, 'LIBTBX_PYEXE_BASENAME="%s"' % self.python_exe.basename()
601 + print >> f, 'export LIBTBX_PYEXE_BASENAME'
602 + source_is_py = False
603 +@@ -930,21 +930,21 @@ Wait for the command to finish, then try again.""" % vars())
604 + source_is_py = True
605 + for line in self.dispatcher_include(where="at_start"):
606 + print >> f, line
607 +- essentials = [("PYTHONPATH", self.pythonpath)]
608 +- essentials.append((
609 +- ld_library_path_var_name(),
610 +- self.ld_library_path_additions()))
611 +- essentials.append(("PATH", [self.bin_path]))
612 +- for n,v in essentials:
613 +- if (len(v) == 0): continue
614 +- v = ":".join([p.sh_value() for p in v])
615 +- print >> f, 'if [ -n "$%s" ]; then' % n
616 +- print >> f, ' %s="%s:$%s"' % (n, v, n)
617 +- print >> f, ' export %s' % n
618 +- print >> f, 'else'
619 +- print >> f, ' %s="%s"' % (n, v)
620 +- print >> f, ' export %s' % n
621 +- print >> f, 'fi'
622 ++ # essentials = [("PYTHONPATH", self.pythonpath)]
623 ++ # essentials.append((
624 ++ # ld_library_path_var_name(),
625 ++ # self.ld_library_path_additions()))
626 ++ # essentials.append(("PATH", [self.bin_path]))
627 ++ # for n,v in essentials:
628 ++ # if (len(v) == 0): continue
629 ++ # v = ":".join([p.sh_value() for p in v])
630 ++ # print >> f, 'if [ -n "$%s" ]; then' % n
631 ++ # print >> f, ' %s="%s:$%s"' % (n, v, n)
632 ++ # print >> f, ' export %s' % n
633 ++ # print >> f, 'else'
634 ++ # print >> f, ' %s="%s"' % (n, v)
635 ++ # print >> f, ' export %s' % n
636 ++ # print >> f, 'fi'
637 + precall_commands = self.dispatcher_precall_commands()
638 + if (precall_commands is not None):
639 + for line in precall_commands:
640
641 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0004-upstream-fix-for-declaration-errors-in-gcc4.7.patch b/sci-libs/cctbx/files/2012.05.08.2305/0004-upstream-fix-for-declaration-errors-in-gcc4.7.patch
642 new file mode 100644
643 index 0000000..a3acee5
644 --- /dev/null
645 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0004-upstream-fix-for-declaration-errors-in-gcc4.7.patch
646 @@ -0,0 +1,442 @@
647 +From: Radostan Riedel <raybuntu@××××××××××.com>
648 +Date: Mon, 9 Jul 2012 19:37:49 +0200
649 +Subject: upstream fix for declaration errors in gcc4.7
650 +
651 +---
652 + cctbx_sources/mmtbx/bulk_solvent/bulk_solvent.h | 416 +++++++++++------------
653 + 1 file changed, 208 insertions(+), 208 deletions(-)
654 +
655 +diff --git a/cctbx_sources/mmtbx/bulk_solvent/bulk_solvent.h b/cctbx_sources/mmtbx/bulk_solvent/bulk_solvent.h
656 +index 6959f18..0be075f 100644
657 +--- a/cctbx_sources/mmtbx/bulk_solvent/bulk_solvent.h
658 ++++ b/cctbx_sources/mmtbx/bulk_solvent/bulk_solvent.h
659 +@@ -322,6 +322,214 @@ private:
660 + };
661 +
662 + //------------------------------------------------------------------------------
663 ++template <typename FloatType, typename ComplexType>
664 ++FloatType
665 ++scale(af::const_ref<FloatType> const& fo,
666 ++ af::const_ref<ComplexType> const& fc)
667 ++{
668 ++ MMTBX_ASSERT(fo.size()==fc.size());
669 ++ FloatType num=0.0;
670 ++ FloatType denum=0.0;
671 ++ for(std::size_t i=0; i < fo.size(); i++) {
672 ++ FloatType fc_abs = std::abs(fc[i]);
673 ++ num += fo[i] * fc_abs;
674 ++ denum += fc_abs * fc_abs;
675 ++ }
676 ++ return (denum == 0 ? 0 : num/denum);
677 ++};
678 ++
679 ++template <typename FloatType, typename ComplexType>
680 ++FloatType
681 ++scale(af::const_ref<FloatType> const& fo,
682 ++ af::const_ref<ComplexType> const& fc,
683 ++ af::const_ref<bool> const& selection)
684 ++{
685 ++ MMTBX_ASSERT(fo.size()==fc.size());
686 ++ MMTBX_ASSERT(fo.size()==selection.size());
687 ++ FloatType num=0.0;
688 ++ FloatType denum=0.0;
689 ++ for(std::size_t i=0; i < fo.size(); i++) {
690 ++ if(selection[i]) {
691 ++ FloatType fc_abs = std::abs(fc[i]);
692 ++ num += fo[i] * fc_abs;
693 ++ denum += fc_abs * fc_abs;
694 ++ }
695 ++ }
696 ++ return (denum == 0 ? 0 : num/denum);
697 ++};
698 ++
699 ++
700 ++template <typename FloatType>
701 ++FloatType
702 ++scale(af::const_ref<FloatType> const& fo,
703 ++ af::const_ref<FloatType> const& fc)
704 ++{
705 ++ MMTBX_ASSERT(fo.size()==fc.size());
706 ++ FloatType num=0.0;
707 ++ FloatType denum=0.0;
708 ++ for(std::size_t i=0; i < fo.size(); i++) {
709 ++ num += fo[i] * fc[i];
710 ++ denum += fc[i] * fc[i];
711 ++ }
712 ++ return (denum == 0 ? 0 : num/denum);
713 ++};
714 ++
715 ++template <typename FloatType, typename ComplexType>
716 ++FloatType
717 ++scale(
718 ++ af::const_ref<FloatType> const& fo,
719 ++ af::const_ref< std::complex<ComplexType> > const& fc1,
720 ++ af::const_ref< std::complex<ComplexType> > const& fc2,
721 ++ FloatType const& twin_fraction)
722 ++{
723 ++ MMTBX_ASSERT(fo.size()==fc1.size());
724 ++ MMTBX_ASSERT(fo.size()==fc2.size());
725 ++ af::shared<FloatType> fc_abs(fo.size());
726 ++ for(std::size_t i=0; i < fo.size(); i++) {
727 ++ FloatType fc_abs1 = std::abs(fc1[i]);
728 ++ FloatType fc_abs2 = std::abs(fc2[i]);
729 ++ fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
730 ++ twin_fraction *fc_abs2*fc_abs2);
731 ++ }
732 ++ return scale(fo,fc_abs.const_ref());
733 ++};
734 ++
735 ++template <typename FloatType>
736 ++FloatType
737 ++r_factor(
738 ++ af::const_ref<FloatType> const& fo,
739 ++ af::const_ref<FloatType> const& fc,
740 ++ FloatType const& scale)
741 ++{
742 ++ MMTBX_ASSERT(fo.size()==fc.size());
743 ++ FloatType num=0.0;
744 ++ FloatType denum=0.0;
745 ++ for(std::size_t i=0; i < fo.size(); i++) {
746 ++ num += std::abs(fo[i] - fc[i] * scale);
747 ++ denum += fo[i];
748 ++ }
749 ++ if(denum == 0) return 1.e+9;
750 ++ return num/denum;
751 ++};
752 ++
753 ++template <typename FloatType>
754 ++FloatType
755 ++r_factor(
756 ++ af::const_ref<FloatType> const& fo,
757 ++ af::const_ref< std::complex<FloatType> > const& fc,
758 ++ FloatType const& scale)
759 ++{
760 ++ MMTBX_ASSERT(fo.size()==fc.size());
761 ++ FloatType num=0.0;
762 ++ FloatType denum=0.0;
763 ++ for(std::size_t i=0; i < fo.size(); i++) {
764 ++ num += std::abs(fo[i] - std::abs(fc[i]) * scale);
765 ++ denum += fo[i];
766 ++ }
767 ++ if(denum == 0) return 1.e+9;
768 ++ return num/denum;
769 ++};
770 ++
771 ++template <typename FloatType>
772 ++FloatType
773 ++r_factor(
774 ++ af::const_ref<FloatType> const& fo,
775 ++ af::const_ref< std::complex<FloatType> > const& fc,
776 ++ af::const_ref<bool> const& selection,
777 ++ FloatType const& scale)
778 ++{
779 ++ MMTBX_ASSERT(fo.size()==fc.size());
780 ++ MMTBX_ASSERT(fo.size()==selection.size());
781 ++ FloatType num=0.0;
782 ++ FloatType denum=0.0;
783 ++ for(std::size_t i=0; i < fo.size(); i++) {
784 ++ if(selection[i]) {
785 ++ num += std::abs(fo[i] - std::abs(fc[i]) * scale);
786 ++ denum += fo[i];
787 ++ }
788 ++ }
789 ++ if(denum == 0) return 1.e+9;
790 ++ return num/denum;
791 ++};
792 ++
793 ++template <typename FloatType>
794 ++FloatType
795 ++r_factor(
796 ++ af::const_ref<FloatType> const& fo,
797 ++ af::const_ref<FloatType> const& fc)
798 ++{
799 ++ MMTBX_ASSERT(fo.size()==fc.size());
800 ++ FloatType sc = scale(fo,fc);
801 ++ return r_factor(fo,fc,sc);
802 ++};
803 ++
804 ++template <typename FloatType, typename ComplexType>
805 ++FloatType
806 ++r_factor(
807 ++ af::const_ref<FloatType> const& fo,
808 ++ af::const_ref<std::complex<ComplexType> > const& fc)
809 ++{
810 ++ MMTBX_ASSERT(fo.size()==fc.size());
811 ++ FloatType sc = scale(fo,fc);
812 ++ return r_factor(fo,fc,sc);
813 ++};
814 ++
815 ++template <typename FloatType, typename ComplexType>
816 ++FloatType
817 ++r_factor(
818 ++ af::const_ref<FloatType> const& fo,
819 ++ af::const_ref<std::complex<ComplexType> > const& fc,
820 ++ af::const_ref<bool> const& selection)
821 ++{
822 ++ MMTBX_ASSERT(fo.size()==fc.size());
823 ++ MMTBX_ASSERT(fo.size()==selection.size());
824 ++ FloatType sc = scale(fo,fc,selection);
825 ++ return r_factor(fo,fc,selection,sc);
826 ++};
827 ++
828 ++template <typename FloatType, typename ComplexType>
829 ++FloatType
830 ++r_factor(
831 ++ af::const_ref<FloatType> const& fo,
832 ++ af::const_ref< std::complex<ComplexType> > const& fc1,
833 ++ af::const_ref< std::complex<ComplexType> > const& fc2,
834 ++ FloatType const& twin_fraction)
835 ++{
836 ++ MMTBX_ASSERT(fo.size()==fc1.size());
837 ++ MMTBX_ASSERT(fo.size()==fc2.size());
838 ++ af::shared<FloatType> fc_abs(fo.size());
839 ++ for(std::size_t i=0; i < fo.size(); i++) {
840 ++ FloatType fc_abs1 = std::abs(fc1[i]);
841 ++ FloatType fc_abs2 = std::abs(fc2[i]);
842 ++ fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
843 ++ twin_fraction *fc_abs2*fc_abs2);
844 ++ }
845 ++ FloatType sc = scale(fo,fc_abs.const_ref());
846 ++ return r_factor(fo,fc_abs.const_ref(),sc);
847 ++};
848 ++
849 ++template <typename FloatType, typename ComplexType>
850 ++FloatType
851 ++r_factor(
852 ++ af::const_ref<FloatType> const& fo,
853 ++ af::const_ref< std::complex<ComplexType> > const& fc1,
854 ++ af::const_ref< std::complex<ComplexType> > const& fc2,
855 ++ FloatType const& twin_fraction,
856 ++ FloatType const& scale)
857 ++{
858 ++ MMTBX_ASSERT(fo.size()==fc1.size());
859 ++ MMTBX_ASSERT(fo.size()==fc2.size());
860 ++ af::shared<FloatType> fc_abs(fo.size());
861 ++ for(std::size_t i=0; i < fo.size(); i++) {
862 ++ FloatType fc_abs1 = std::abs(fc1[i]);
863 ++ FloatType fc_abs2 = std::abs(fc2[i]);
864 ++ fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
865 ++ twin_fraction *fc_abs2*fc_abs2);
866 ++ }
867 ++ return r_factor(fo,fc_abs.const_ref(),scale);
868 ++};
869 ++
870 ++//------------------------------------------------------------------------------
871 + // All scales (overall, overall anisotropic, etc) must be applied.
872 + template <
873 + typename FloatType=double,
874 +@@ -744,214 +952,6 @@ template <typename FloatType>
875 + };
876 +
877 + //------------------------------------------------------------------------------
878 +-template <typename FloatType, typename ComplexType>
879 +-FloatType
880 +-scale(af::const_ref<FloatType> const& fo,
881 +- af::const_ref<ComplexType> const& fc)
882 +-{
883 +- MMTBX_ASSERT(fo.size()==fc.size());
884 +- FloatType num=0.0;
885 +- FloatType denum=0.0;
886 +- for(std::size_t i=0; i < fo.size(); i++) {
887 +- FloatType fc_abs = std::abs(fc[i]);
888 +- num += fo[i] * fc_abs;
889 +- denum += fc_abs * fc_abs;
890 +- }
891 +- return (denum == 0 ? 0 : num/denum);
892 +-};
893 +-
894 +-template <typename FloatType, typename ComplexType>
895 +-FloatType
896 +-scale(af::const_ref<FloatType> const& fo,
897 +- af::const_ref<ComplexType> const& fc,
898 +- af::const_ref<bool> const& selection)
899 +-{
900 +- MMTBX_ASSERT(fo.size()==fc.size());
901 +- MMTBX_ASSERT(fo.size()==selection.size());
902 +- FloatType num=0.0;
903 +- FloatType denum=0.0;
904 +- for(std::size_t i=0; i < fo.size(); i++) {
905 +- if(selection[i]) {
906 +- FloatType fc_abs = std::abs(fc[i]);
907 +- num += fo[i] * fc_abs;
908 +- denum += fc_abs * fc_abs;
909 +- }
910 +- }
911 +- return (denum == 0 ? 0 : num/denum);
912 +-};
913 +-
914 +-
915 +-template <typename FloatType>
916 +-FloatType
917 +-scale(af::const_ref<FloatType> const& fo,
918 +- af::const_ref<FloatType> const& fc)
919 +-{
920 +- MMTBX_ASSERT(fo.size()==fc.size());
921 +- FloatType num=0.0;
922 +- FloatType denum=0.0;
923 +- for(std::size_t i=0; i < fo.size(); i++) {
924 +- num += fo[i] * fc[i];
925 +- denum += fc[i] * fc[i];
926 +- }
927 +- return (denum == 0 ? 0 : num/denum);
928 +-};
929 +-
930 +-template <typename FloatType, typename ComplexType>
931 +-FloatType
932 +-scale(
933 +- af::const_ref<FloatType> const& fo,
934 +- af::const_ref< std::complex<ComplexType> > const& fc1,
935 +- af::const_ref< std::complex<ComplexType> > const& fc2,
936 +- FloatType const& twin_fraction)
937 +-{
938 +- MMTBX_ASSERT(fo.size()==fc1.size());
939 +- MMTBX_ASSERT(fo.size()==fc2.size());
940 +- af::shared<FloatType> fc_abs(fo.size());
941 +- for(std::size_t i=0; i < fo.size(); i++) {
942 +- FloatType fc_abs1 = std::abs(fc1[i]);
943 +- FloatType fc_abs2 = std::abs(fc2[i]);
944 +- fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
945 +- twin_fraction *fc_abs2*fc_abs2);
946 +- }
947 +- return scale(fo,fc_abs.const_ref());
948 +-};
949 +-
950 +-template <typename FloatType>
951 +-FloatType
952 +-r_factor(
953 +- af::const_ref<FloatType> const& fo,
954 +- af::const_ref<FloatType> const& fc,
955 +- FloatType const& scale)
956 +-{
957 +- MMTBX_ASSERT(fo.size()==fc.size());
958 +- FloatType num=0.0;
959 +- FloatType denum=0.0;
960 +- for(std::size_t i=0; i < fo.size(); i++) {
961 +- num += std::abs(fo[i] - fc[i] * scale);
962 +- denum += fo[i];
963 +- }
964 +- if(denum == 0) return 1.e+9;
965 +- return num/denum;
966 +-};
967 +-
968 +-template <typename FloatType>
969 +-FloatType
970 +-r_factor(
971 +- af::const_ref<FloatType> const& fo,
972 +- af::const_ref< std::complex<FloatType> > const& fc,
973 +- FloatType const& scale)
974 +-{
975 +- MMTBX_ASSERT(fo.size()==fc.size());
976 +- FloatType num=0.0;
977 +- FloatType denum=0.0;
978 +- for(std::size_t i=0; i < fo.size(); i++) {
979 +- num += std::abs(fo[i] - std::abs(fc[i]) * scale);
980 +- denum += fo[i];
981 +- }
982 +- if(denum == 0) return 1.e+9;
983 +- return num/denum;
984 +-};
985 +-
986 +-template <typename FloatType>
987 +-FloatType
988 +-r_factor(
989 +- af::const_ref<FloatType> const& fo,
990 +- af::const_ref< std::complex<FloatType> > const& fc,
991 +- af::const_ref<bool> const& selection,
992 +- FloatType const& scale)
993 +-{
994 +- MMTBX_ASSERT(fo.size()==fc.size());
995 +- MMTBX_ASSERT(fo.size()==selection.size());
996 +- FloatType num=0.0;
997 +- FloatType denum=0.0;
998 +- for(std::size_t i=0; i < fo.size(); i++) {
999 +- if(selection[i]) {
1000 +- num += std::abs(fo[i] - std::abs(fc[i]) * scale);
1001 +- denum += fo[i];
1002 +- }
1003 +- }
1004 +- if(denum == 0) return 1.e+9;
1005 +- return num/denum;
1006 +-};
1007 +-
1008 +-template <typename FloatType>
1009 +-FloatType
1010 +-r_factor(
1011 +- af::const_ref<FloatType> const& fo,
1012 +- af::const_ref<FloatType> const& fc)
1013 +-{
1014 +- MMTBX_ASSERT(fo.size()==fc.size());
1015 +- FloatType sc = scale(fo,fc);
1016 +- return r_factor(fo,fc,sc);
1017 +-};
1018 +-
1019 +-template <typename FloatType, typename ComplexType>
1020 +-FloatType
1021 +-r_factor(
1022 +- af::const_ref<FloatType> const& fo,
1023 +- af::const_ref<std::complex<ComplexType> > const& fc)
1024 +-{
1025 +- MMTBX_ASSERT(fo.size()==fc.size());
1026 +- FloatType sc = scale(fo,fc);
1027 +- return r_factor(fo,fc,sc);
1028 +-};
1029 +-
1030 +-template <typename FloatType, typename ComplexType>
1031 +-FloatType
1032 +-r_factor(
1033 +- af::const_ref<FloatType> const& fo,
1034 +- af::const_ref<std::complex<ComplexType> > const& fc,
1035 +- af::const_ref<bool> const& selection)
1036 +-{
1037 +- MMTBX_ASSERT(fo.size()==fc.size());
1038 +- MMTBX_ASSERT(fo.size()==selection.size());
1039 +- FloatType sc = scale(fo,fc,selection);
1040 +- return r_factor(fo,fc,selection,sc);
1041 +-};
1042 +-
1043 +-template <typename FloatType, typename ComplexType>
1044 +-FloatType
1045 +-r_factor(
1046 +- af::const_ref<FloatType> const& fo,
1047 +- af::const_ref< std::complex<ComplexType> > const& fc1,
1048 +- af::const_ref< std::complex<ComplexType> > const& fc2,
1049 +- FloatType const& twin_fraction)
1050 +-{
1051 +- MMTBX_ASSERT(fo.size()==fc1.size());
1052 +- MMTBX_ASSERT(fo.size()==fc2.size());
1053 +- af::shared<FloatType> fc_abs(fo.size());
1054 +- for(std::size_t i=0; i < fo.size(); i++) {
1055 +- FloatType fc_abs1 = std::abs(fc1[i]);
1056 +- FloatType fc_abs2 = std::abs(fc2[i]);
1057 +- fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
1058 +- twin_fraction *fc_abs2*fc_abs2);
1059 +- }
1060 +- FloatType sc = scale(fo,fc_abs.const_ref());
1061 +- return r_factor(fo,fc_abs.const_ref(),sc);
1062 +-};
1063 +-
1064 +-template <typename FloatType, typename ComplexType>
1065 +-FloatType
1066 +-r_factor(
1067 +- af::const_ref<FloatType> const& fo,
1068 +- af::const_ref< std::complex<ComplexType> > const& fc1,
1069 +- af::const_ref< std::complex<ComplexType> > const& fc2,
1070 +- FloatType const& twin_fraction,
1071 +- FloatType const& scale)
1072 +-{
1073 +- MMTBX_ASSERT(fo.size()==fc1.size());
1074 +- MMTBX_ASSERT(fo.size()==fc2.size());
1075 +- af::shared<FloatType> fc_abs(fo.size());
1076 +- for(std::size_t i=0; i < fo.size(); i++) {
1077 +- FloatType fc_abs1 = std::abs(fc1[i]);
1078 +- FloatType fc_abs2 = std::abs(fc2[i]);
1079 +- fc_abs[i]=std::sqrt((1-twin_fraction)*fc_abs1*fc_abs1+
1080 +- twin_fraction *fc_abs2*fc_abs2);
1081 +- }
1082 +- return r_factor(fo,fc_abs.const_ref(),scale);
1083 +-};
1084 +-
1085 +-//------------------------------------------------------------------------------
1086 +
1087 + template <typename DataType, typename TagType>
1088 + void
1089
1090 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0005-fix-for-gcc4.7-compilation-error.patch b/sci-libs/cctbx/files/2012.05.08.2305/0005-fix-for-gcc4.7-compilation-error.patch
1091 new file mode 100644
1092 index 0000000..f2b9523
1093 --- /dev/null
1094 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0005-fix-for-gcc4.7-compilation-error.patch
1095 @@ -0,0 +1,83 @@
1096 +From: Radostan Riedel <raybuntu@××××××××××.com>
1097 +Date: Mon, 9 Jul 2012 19:58:46 +0200
1098 +Subject: fix for gcc4.7 compilation error
1099 +
1100 +---
1101 + .../scitbx/math/boost_python/distributions.cpp | 60 +++++++++++++-------
1102 + 1 file changed, 41 insertions(+), 19 deletions(-)
1103 +
1104 +diff --git a/cctbx_sources/scitbx/math/boost_python/distributions.cpp b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
1105 +index e430cad..3d16a9c 100644
1106 +--- a/cctbx_sources/scitbx/math/boost_python/distributions.cpp
1107 ++++ b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
1108 +@@ -75,29 +75,51 @@ namespace {
1109 + {
1110 + typedef Distribution wt;
1111 +
1112 ++ #define NEW_MEMBER(name) \
1113 ++ static FloatType name(wt const &self) { \
1114 ++ return boost::math::name(self); \
1115 ++ }
1116 ++
1117 ++ NEW_MEMBER(mean);
1118 ++ NEW_MEMBER(median);
1119 ++ NEW_MEMBER(mode);
1120 ++ NEW_MEMBER(variance);
1121 ++ NEW_MEMBER(standard_deviation);
1122 ++ NEW_MEMBER(skewness);
1123 ++ NEW_MEMBER(kurtosis);
1124 ++
1125 ++ #undef NEW_MEMBER
1126 ++
1127 ++ #define NEW_MEMBER(name) \
1128 ++ static FloatType name(wt const &self, FloatType arg) { \
1129 ++ return boost::math::name(self, arg); \
1130 ++ }
1131 ++
1132 ++ NEW_MEMBER(pdf);
1133 ++ NEW_MEMBER(cdf);
1134 ++ NEW_MEMBER(quantile);
1135 ++
1136 ++ #undef NEW_MEMBER
1137 ++
1138 ++ static scitbx::af::shared<FloatType> quantiles(wt const &self, std::size_t n) {
1139 ++ return scitbx::math::quantiles<FloatType>(self, n);
1140 ++ }
1141 ++
1142 + static void
1143 + wrap()
1144 + {
1145 + using namespace boost::python;
1146 +- def("mean", (FloatType(*)(wt const&)) boost::math::mean);
1147 +- def("median", (FloatType(*)(wt const&)) boost::math::median);
1148 +- def("mode", (FloatType(*)(wt const&)) boost::math::mode);
1149 +- def("variance", (FloatType(*)(wt const&)) boost::math::variance);
1150 +- def("standard_deviation",
1151 +- (FloatType(*)(wt const&)) boost::math::standard_deviation);
1152 +- def("skewness", (FloatType(*)(wt const&)) boost::math::skewness);
1153 +- def("kurtosis", (FloatType(*)(wt const&)) boost::math::kurtosis);
1154 +- def("pdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::pdf);
1155 +- def("cdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::cdf);
1156 +- def("quantile", (FloatType(*)(wt const&, FloatType const&))
1157 +- boost::math::quantile);
1158 +- def("quantiles",
1159 +-#if BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
1160 +- (scitbx::af::shared<FloatType>(*)(wt const&, std::size_t)) quantiles
1161 +-#else
1162 +- quantiles<FloatType, wt>
1163 +-#endif
1164 +- );
1165 ++ def("mean" , mean);
1166 ++ def("median" , median);
1167 ++ def("mode" , mode);
1168 ++ def("variance" , variance);
1169 ++ def("standard_deviation", standard_deviation);
1170 ++ def("skewness" , skewness);
1171 ++ def("kurtosis" , kurtosis);
1172 ++ def("pdf" , pdf);
1173 ++ def("cdf" , cdf);
1174 ++ def("quantile" , quantile);
1175 ++ def("quantiles" , quantiles);
1176 + }
1177 + };
1178 +
1179
1180 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0006-options-for-system-libs-installtarget-and-prefix.patch b/sci-libs/cctbx/files/2012.05.08.2305/0006-options-for-system-libs-installtarget-and-prefix.patch
1181 new file mode 100644
1182 index 0000000..a3a6dd8
1183 --- /dev/null
1184 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0006-options-for-system-libs-installtarget-and-prefix.patch
1185 @@ -0,0 +1,1080 @@
1186 +From: Radostan Riedel <raybuntu@××××××××××.com>
1187 +Date: Mon, 23 Jul 2012 18:28:04 +0200
1188 +Subject: options for system libs installtarget and prefix
1189 +
1190 +---
1191 + cctbx_sources/boost_adaptbx/SConscript | 26 +-
1192 + cctbx_sources/cbflib_adaptbx/SConscript | 89 +++---
1193 + .../detectors/boost_python/SConscript | 4 +-
1194 + cctbx_sources/ccp4io_adaptbx/SConscript | 284 ++++++++++----------
1195 + cctbx_sources/cctbx/SConscript | 2 +-
1196 + cctbx_sources/clipper_adaptbx/SConscript | 94 ++++---
1197 + cctbx_sources/clipper_adaptbx/clipper/SConscript | 10 +-
1198 + cctbx_sources/gltbx/SConscript | 20 +-
1199 + cctbx_sources/iotbx/cif/boost_python/SConscript | 13 +-
1200 + cctbx_sources/iotbx/mtz/SConscript | 3 +-
1201 + cctbx_sources/iotbx/pdb/SConscript | 2 +-
1202 + cctbx_sources/libtbx/SConscript | 86 +++++-
1203 + cctbx_sources/libtbx/env_config.py | 34 +++
1204 + cctbx_sources/mmtbx/den/SConscript | 2 +-
1205 + cctbx_sources/mmtbx/geometry_restraints/SConscript | 2 +-
1206 + cctbx_sources/mmtbx/secondary_structure/SConscript | 2 +-
1207 + cctbx_sources/rstbx/SConscript | 2 +-
1208 + cctbx_sources/scitbx/SConscript | 2 +-
1209 + cctbx_sources/scitbx/boost_python/SConscript | 4 +-
1210 + .../smtbx/refinement/boost_python/SConscript | 4 +-
1211 + .../refinement/constraints/boost_python/SConscript | 4 +-
1212 + cctbx_sources/spotfinder/SConscript | 2 +-
1213 + 22 files changed, 431 insertions(+), 260 deletions(-)
1214 +
1215 +diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
1216 +index 866b1c1..68cac89 100644
1217 +--- a/cctbx_sources/boost_adaptbx/SConscript
1218 ++++ b/cctbx_sources/boost_adaptbx/SConscript
1219 +@@ -9,7 +9,13 @@ import sys, os
1220 + op = os.path
1221 + Import("env_base", "env_etc")
1222 + env_etc.boost_dist = libtbx.env.dist_path("boost")
1223 +-env_etc.boost_include = env_etc.boost_dist
1224 ++if not env_etc.check_syslib(env_etc.boost_python, extra_libs=env_etc.py_lib)\
1225 ++ or not env_etc.check_syslib('boost_thread'):
1226 ++ env_etc.boost_include = env_etc.boost_dist
1227 ++else:
1228 ++ # This way the compiler looks in the standard location for includes
1229 ++ # should work on all platforms.
1230 ++ env_etc.boost_include = ''
1231 + env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
1232 + env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
1233 +
1234 +@@ -35,9 +41,10 @@ def build_boost_thread():
1235 + lo="boost/libs/thread/src/libboost_thread.lo",
1236 + dylib="lib/libboost_thread.dylib")
1237 + env.Repository(os.path.dirname(env_etc.boost_dist))
1238 +- env.SharedLibrary(
1239 +- target='#lib/boost_thread',
1240 +- source=source)
1241 ++ if not env_etc.check_syslib('boost_thread'):
1242 ++ env.SharedLibrary(
1243 ++ target='#lib/boost_thread',
1244 ++ source=source)
1245 +
1246 + build_boost_thread()
1247 +
1248 +@@ -50,7 +57,7 @@ if (not env_etc.no_boost_python):
1249 + env_no_includes_boost_python_ext = env_base.Clone(
1250 + SHLINKFLAGS=env_etc.shlinkflags_bpl,
1251 + SHLIBPREFIX="",
1252 +- LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
1253 ++ LIBS=[env_etc.boost_python] + env_etc.libs_python + env_etc.libm)
1254 + env_no_includes_boost_python_ext.Append(
1255 + LIBPATH=env_etc.libpath_python)
1256 + env_no_includes_boost_python_ext.Append(
1257 +@@ -235,10 +242,11 @@ object/function_doc_signature.cpp
1258 + bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
1259 + #
1260 + env.Repository(os.path.dirname(env_etc.boost_dist))
1261 +- if (env_etc.static_bpl):
1262 +- env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
1263 +- else:
1264 +- env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
1265 ++ if not env_etc.check_syslib(env_etc.boost_python, extra_libs=env_etc.py_lib):
1266 ++ if (env_etc.static_bpl):
1267 ++ env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
1268 ++ else:
1269 ++ env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
1270 + if (bool(int(ARGUMENTS.get("boost_python_tests", "0")))):
1271 + warn_if_unexpected_md5_hexdigest(
1272 + path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
1273 +diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
1274 +index 4ac6717..334cfc2 100644
1275 +--- a/cctbx_sources/cbflib_adaptbx/SConscript
1276 ++++ b/cctbx_sources/cbflib_adaptbx/SConscript
1277 +@@ -3,9 +3,14 @@ import os
1278 + Import("env_base","env_etc")
1279 +
1280 + env_etc.cbflib_dist = libtbx.env.dist_path("cbflib")
1281 +-env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
1282 +- env_etc.norm_join(env_etc.cbflib_dist,"include"),
1283 +- ]
1284 ++if not env_etc.check_syslib('cbf'):
1285 ++ env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
1286 ++ env_etc.norm_join(env_etc.cbflib_dist,"include"),
1287 ++ ]
1288 ++else:
1289 ++ env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
1290 ++ "",
1291 ++ ]
1292 + env_etc.cbflib_adaptbx_dist = libtbx.env.dist_path("cbflib_adaptbx")
1293 +
1294 + env_etc.cbflib_common_includes = [
1295 +@@ -34,39 +39,47 @@ cbflib_092_forward = []
1296 + if os.path.isfile( os.path.join(env_etc.cbflib_dist,"src","cbf_ws.c") ):
1297 + cbflib_092_forward.append("src/cbf_ws.c")
1298 +
1299 +-env.StaticLibrary(target='#lib/cbf',
1300 +- source = [prefix+"/"+s for s in [
1301 +- "examples/img.c",
1302 +- "src/cbf.c",
1303 +- "src/cbf_alloc.c",
1304 +- "src/cbf_ascii.c",
1305 +- "src/cbf_binary.c",
1306 +- "src/cbf_byte_offset.c",
1307 +- "src/cbf_canonical.c",
1308 +- "src/cbf_codes.c",
1309 +- "src/cbf_compress.c",
1310 +- "src/cbf_context.c",
1311 +- "src/cbf_file.c",
1312 +- "src/cbf_lex.c",
1313 +- "src/cbf_packed.c",
1314 +- "src/cbf_predictor.c",
1315 +- "src/cbf_read_binary.c",
1316 +- "src/cbf_read_mime.c",
1317 +- "src/cbf_simple.c",
1318 +- "src/cbf_string.c",
1319 +- "src/cbf_stx.c",
1320 +- "src/cbf_tree.c",
1321 +- "src/cbf_uncompressed.c",
1322 +- "src/cbf_write.c",
1323 +- "src/cbf_write_binary.c",
1324 +- "src/md5c.c",
1325 +- ] + cbflib_092_forward ] + [
1326 +- "detectors/mar_adaptor.cpp",
1327 +- "detectors/cbf_adaptor.cpp",
1328 +- "detectors/cbf_byte_offset_optimized.cpp",
1329 +- "detectors/buffer_based_service.cpp",
1330 +- ],
1331 +- CPPPATH=env_etc.cbflib_common_includes )
1332 ++cbflib_src = ["src/cbf.c",
1333 ++ "src/cbf_alloc.c",
1334 ++ "src/cbf_ascii.c",
1335 ++ "src/cbf_binary.c",
1336 ++ "src/cbf_byte_offset.c",
1337 ++ "src/cbf_canonical.c",
1338 ++ "src/cbf_codes.c",
1339 ++ "src/cbf_compress.c",
1340 ++ "src/cbf_context.c",
1341 ++ "src/cbf_file.c",
1342 ++ "src/cbf_lex.c",
1343 ++ "src/cbf_packed.c",
1344 ++ "src/cbf_predictor.c",
1345 ++ "src/cbf_read_binary.c",
1346 ++ "src/cbf_read_mime.c",
1347 ++ "src/cbf_simple.c",
1348 ++ "src/cbf_string.c",
1349 ++ "src/cbf_stx.c",
1350 ++ "src/cbf_tree.c",
1351 ++ "src/cbf_uncompressed.c",
1352 ++ "src/cbf_write.c",
1353 ++ "src/cbf_write_binary.c",
1354 ++ "src/md5c.c",
1355 ++ ]
1356 ++adaptor_src = ["detectors/mar_adaptor.cpp",
1357 ++ "detectors/cbf_adaptor.cpp",
1358 ++ "detectors/cbf_byte_offset_optimized.cpp",
1359 ++ "detectors/buffer_based_service.cpp",
1360 ++ ]
1361 ++if not env_etc.check_syslib('cbf'):
1362 ++ env.StaticLibrary(target='#lib/cbf',
1363 ++ source = [prefix+"/"+s for s in [
1364 ++ "examples/img.c"] + cbflib_src + cbflib_092_forward] + adaptor_src,
1365 ++ CPPPATH=env_etc.cbflib_common_includes )
1366 ++ env_etc.cbf_lib = ['cbf',]
1367 ++else:
1368 ++ env.StaticLibrary(target='#lib/cbf_adaptor',
1369 ++ source = [prefix+"/"+s for s in [
1370 ++ "examples/img.c"]] + adaptor_src,
1371 ++ CPPPATH=env_etc.cbflib_common_includes )
1372 ++ env_etc.cbf_lib = ['cbf','cbf_adaptor']
1373 +
1374 + if (not env_etc.no_boost_python):
1375 + Import("env_no_includes_boost_python_ext")
1376 +@@ -80,7 +93,7 @@ if (not env_etc.no_boost_python):
1377 + env_cbflib_boost_python_ext.SharedLibrary(
1378 + target='#lib/_pycbf',
1379 + source=[prefix+"/pycbf/pycbf_wrap.c"],
1380 +- LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
1381 ++ LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
1382 +
1383 + Export("env_cbflib_boost_python_ext")
1384 +
1385 +@@ -89,7 +102,7 @@ if (not env_etc.no_boost_python):
1386 + env_standalone = env.Clone(
1387 + LIBS = [env_etc.libm,],CPPPATH=env_etc.cbflib_common_includes
1388 + )
1389 +-env_standalone.Prepend(LIBS=["cbf",])
1390 ++env_standalone.Prepend(LIBS=env_etc.cbf_lib)
1391 +
1392 + for source in ["detectors/tst_memory",]:
1393 + target = "cbflib."+os.path.basename(source)
1394 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
1395 +index 2027439..8e987cc 100644
1396 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
1397 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
1398 +@@ -1,6 +1,6 @@
1399 +-Import("env_cbflib_boost_python_ext")
1400 ++Import("env_cbflib_boost_python_ext", "env_etc")
1401 + env = env_cbflib_boost_python_ext.Clone()
1402 +-env.Prepend(LIBS=["cbf",])
1403 ++env.Prepend(LIBS=env_etc.cbf_lib)
1404 + env.SharedLibrary(
1405 + target="#lib/cbflib_ext",
1406 + source=["cbflib_ext.cpp",])
1407 +diff --git a/cctbx_sources/ccp4io_adaptbx/SConscript b/cctbx_sources/ccp4io_adaptbx/SConscript
1408 +index f55cc92..01600d6 100644
1409 +--- a/cctbx_sources/ccp4io_adaptbx/SConscript
1410 ++++ b/cctbx_sources/ccp4io_adaptbx/SConscript
1411 +@@ -36,118 +36,152 @@ else:
1412 + # clean out after completely removing support for
1413 + # old CCP4 directory structure above
1414 +
1415 +-build_ccp4io_adaptbx = libtbx.env.under_build("ccp4io_adaptbx")
1416 +-if (not op.isdir(build_ccp4io_adaptbx)):
1417 +- os.mkdir(build_ccp4io_adaptbx)
1418 +- assert op.isdir(build_ccp4io_adaptbx)
1419 +-
1420 +-def replace_printf(file_name):
1421 +- full_path = op.join(path_lib_src, file_name)
1422 +- if (not op.isfile(full_path)):
1423 +- full_path = op.join(op.dirname(path_lib_src), "fortran", file_name)
1424 +- result = ["#include <ccp4io_adaptbx/printf_wrappers.h>"]
1425 +- for line in open(full_path).read().splitlines():
1426 +- for key in ["printf", "fprintf"]:
1427 +- matches = list(re.finditer(
1428 +- pattern="[^A-Za-z0-9_]%s[^A-Za-z0-9_]" % key, string=line))
1429 +- if (len(matches) != 0):
1430 +- for m in reversed(matches):
1431 +- s,e = m.start(), m.end()
1432 +- line = line[:s] \
1433 +- + line[s:e].replace(key, "ccp4io_%s" % key) \
1434 +- + line[e:]
1435 +- result.append(line)
1436 +- return "\n".join(result)
1437 +-
1438 +-env = env_base.Clone(
1439 +- SHLINKFLAGS=env_etc.shlinkflags)
1440 +-env.Append(CCFLAGS=env_etc.ccp4io_defines)
1441 +-env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
1442 +-env_etc.include_registry.append(
1443 +- env=env,
1444 +- paths=[
1445 +- "#",
1446 +- op.dirname(env_etc.ccp4io_include),
1447 +- env_etc.ccp4io_include,
1448 +- op.join(env_etc.ccp4io_dist, "lib", mmdb_src),
1449 +- op.join(env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb")])
1450 +-env.Append(LIBS=env_etc.libm)
1451 +-if ( op.normcase(op.dirname(env_etc.ccp4io_dist))
1452 +- != op.normcase("ccp4io")):
1453 +- env.Repository(op.dirname(env_etc.ccp4io_dist))
1454 + source = []
1455 +-
1456 + c_files = []
1457 +-c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
1458 +-library_err.c
1459 +-library_file.c
1460 +-library_utils.c
1461 +-ccp4_array.c
1462 +-ccp4_parser.c
1463 +-ccp4_unitcell.c
1464 +-cvecmat.c
1465 +-cmtzlib.c
1466 +-""".splitlines()])
1467 +-open(op.join(build_ccp4io_adaptbx, "csymlib.c"), "w").write(
1468 +- open(op.join(path_lib_src, "csymlib.c")).read()
1469 +- .replace(
1470 +- "static int reported_syminfo = 0",
1471 +- "static int reported_syminfo = 1"))
1472 +-source.append(op.join("#ccp4io_adaptbx", "csymlib.c"))
1473 ++if not env_etc.check_syslib('ccp4c')\
1474 ++ or not env_etc.check_syslib('mmdb'):
1475 ++ build_ccp4io_adaptbx = libtbx.env.under_build("ccp4io_adaptbx")
1476 ++ if (not op.isdir(build_ccp4io_adaptbx)):
1477 ++ os.mkdir(build_ccp4io_adaptbx)
1478 ++ assert op.isdir(build_ccp4io_adaptbx)
1479 ++
1480 ++ def replace_printf(file_name):
1481 ++ full_path = op.join(path_lib_src, file_name)
1482 ++ if (not op.isfile(full_path)):
1483 ++ full_path = op.join(op.dirname(path_lib_src), "fortran", file_name)
1484 ++ result = ["#include <ccp4io_adaptbx/printf_wrappers.h>"]
1485 ++ for line in open(full_path).read().splitlines():
1486 ++ for key in ["printf", "fprintf"]:
1487 ++ matches = list(re.finditer(
1488 ++ pattern="[^A-Za-z0-9_]%s[^A-Za-z0-9_]" % key, string=line))
1489 ++ if (len(matches) != 0):
1490 ++ for m in reversed(matches):
1491 ++ s,e = m.start(), m.end()
1492 ++ line = line[:s] \
1493 ++ + line[s:e].replace(key, "ccp4io_%s" % key) \
1494 ++ + line[e:]
1495 ++ result.append(line)
1496 ++ return "\n".join(result)
1497 ++ env = env_base.Clone(
1498 ++ SHLINKFLAGS=env_etc.shlinkflags)
1499 ++ env.Append(CCFLAGS=env_etc.ccp4io_defines)
1500 ++ env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
1501 ++ env_etc.include_registry.append(
1502 ++ env=env,
1503 ++ paths=[
1504 ++ "#",
1505 ++ op.dirname(env_etc.ccp4io_include),
1506 ++ env_etc.ccp4io_include,
1507 ++ op.join(env_etc.ccp4io_dist, "lib", mmdb_src),
1508 ++ op.join(env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb")])
1509 ++ env.Append(LIBS=env_etc.libm)
1510 ++ if ( op.normcase(op.dirname(env_etc.ccp4io_dist))
1511 ++ != op.normcase("ccp4io")):
1512 ++ env.Repository(op.dirname(env_etc.ccp4io_dist))
1513 +
1514 +-probe_file_name = op.join(path_lib_src, "cmaplib.h")
1515 +-env_etc.ccp4io_has_cmaplib = op.isfile(probe_file_name)
1516 +-if (env_etc.ccp4io_has_cmaplib):
1517 + c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
1518 +-cmap_accessor.c
1519 +-cmap_close.c
1520 +-cmap_data.c
1521 +-cmap_header.c
1522 +-cmap_labels.c
1523 +-cmap_open.c
1524 +-cmap_skew.c
1525 +-cmap_stats.c
1526 +-cmap_symop.c
1527 +-""".splitlines()])
1528 ++ library_err.c
1529 ++ library_file.c
1530 ++ library_utils.c
1531 ++ ccp4_array.c
1532 ++ ccp4_parser.c
1533 ++ ccp4_unitcell.c
1534 ++ cvecmat.c
1535 ++ cmtzlib.c
1536 ++ """.splitlines()])
1537 ++ open(op.join(build_ccp4io_adaptbx, "csymlib.c"), "w").write(
1538 ++ open(op.join(path_lib_src, "csymlib.c")).read()
1539 ++ .replace(
1540 ++ "static int reported_syminfo = 0",
1541 ++ "static int reported_syminfo = 1"))
1542 ++ source.append(op.join("#ccp4io_adaptbx", "csymlib.c"))
1543 +
1544 +-c_files.extend(["%s/mmdb/%s.cpp" % ( mmdb_src, bn ) for bn in """\
1545 +-bfgs_min
1546 +-file_
1547 +-hybrid_36
1548 +-linalg_
1549 +-machine_
1550 +-math_
1551 +-mattype_
1552 +-mmdb_align
1553 +-mmdb_atom
1554 +-mmdb_bondmngr
1555 +-mmdb_chain
1556 +-mmdb_cifdefs
1557 +-mmdb_coormngr
1558 +-mmdb_cryst
1559 +-mmdb_ficif
1560 +-mmdb_file
1561 +-mmdb_graph
1562 +-mmdb_manager
1563 +-mmdb_mask
1564 +-mmdb_mmcif
1565 +-mmdb_model
1566 +-mmdb_rwbrook
1567 +-mmdb_sbase
1568 +-mmdb_sbase0
1569 +-mmdb_selmngr
1570 +-mmdb_symop
1571 +-mmdb_tables
1572 +-mmdb_title
1573 +-mmdb_uddata
1574 +-mmdb_utils
1575 +-mmdb_xml
1576 +-random_n
1577 +-stream_
1578 +-""".splitlines()])
1579 +-prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib")
1580 +-for file_name in c_files:
1581 +- source.append(op.join(prefix, file_name))
1582 ++ probe_file_name = op.join(path_lib_src, "cmaplib.h")
1583 ++ env_etc.ccp4io_has_cmaplib = op.isfile(probe_file_name)
1584 ++ if (env_etc.ccp4io_has_cmaplib):
1585 ++ c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
1586 ++ cmap_accessor.c
1587 ++ cmap_close.c
1588 ++ cmap_data.c
1589 ++ cmap_header.c
1590 ++ cmap_labels.c
1591 ++ cmap_open.c
1592 ++ cmap_skew.c
1593 ++ cmap_stats.c
1594 ++ cmap_symop.c
1595 ++ """.splitlines()])
1596 ++
1597 ++ c_files.extend(["%s/mmdb/%s.cpp" % ( mmdb_src, bn ) for bn in """\
1598 ++ bfgs_min
1599 ++ file_
1600 ++ hybrid_36
1601 ++ linalg_
1602 ++ machine_
1603 ++ math_
1604 ++ mattype_
1605 ++ mmdb_align
1606 ++ mmdb_atom
1607 ++ mmdb_bondmngr
1608 ++ mmdb_chain
1609 ++ mmdb_cifdefs
1610 ++ mmdb_coormngr
1611 ++ mmdb_cryst
1612 ++ mmdb_ficif
1613 ++ mmdb_file
1614 ++ mmdb_graph
1615 ++ mmdb_manager
1616 ++ mmdb_mask
1617 ++ mmdb_mmcif
1618 ++ mmdb_model
1619 ++ mmdb_rwbrook
1620 ++ mmdb_sbase
1621 ++ mmdb_sbase0
1622 ++ mmdb_selmngr
1623 ++ mmdb_symop
1624 ++ mmdb_tables
1625 ++ mmdb_title
1626 ++ mmdb_uddata
1627 ++ mmdb_utils
1628 ++ mmdb_xml
1629 ++ random_n
1630 ++ stream_
1631 ++ """.splitlines()])
1632 ++ prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib")
1633 ++ for file_name in c_files:
1634 ++ source.append(op.join(prefix, file_name))
1635 ++
1636 ++ need_f_c = (
1637 ++ libtbx.env.has_module("solve_resolve")
1638 ++ or libtbx.env.find_in_repositories(relative_path="mosflm_fable"))
1639 ++ if (need_f_c or os.name != "nt"):
1640 ++ source.append(op.join("#ccp4io_adaptbx", "fortran_call_stubs.c"))
1641 ++ for file_name in """\
1642 ++ ccp4_diskio_f.c
1643 ++ ccp4_general.c
1644 ++ ccp4_general_f.c
1645 ++ ccp4_parser_f.c
1646 ++ ccp4_program.c
1647 ++ ccp4_unitcell_f.c
1648 ++ cmaplib_f.c
1649 ++ cmtzlib_f.c
1650 ++ csymlib_f.c
1651 ++ library_f.c
1652 ++ """.splitlines():
1653 ++ open(op.join(build_ccp4io_adaptbx, file_name), "w").write(
1654 ++ replace_printf(file_name=file_name))
1655 ++ source.append(op.join("#ccp4io_adaptbx", file_name))
1656 ++ source.append(op.join("#ccp4io_adaptbx", "printf_wrappers.c"))
1657 ++ env_etc.ccp4io_lib = "ccp4io"
1658 ++ mmdb_path= [ os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src ),
1659 ++ os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb" ),
1660 ++ ]
1661 ++else:
1662 ++ env = env_base.Clone(
1663 ++ SHLINKFLAGS=env_etc.shlinkflags)
1664 ++ env.Append(CCFLAGS=env_etc.ccp4io_defines)
1665 ++ env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
1666 ++ env_etc.ccp4io_lib = ["ccp4io", "mmdb", "ccp4c"]
1667 ++ mmdb_path= []
1668 +
1669 + ssm_prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib", "ssm")
1670 + ssm_sources = """\
1671 +@@ -159,46 +193,20 @@ ssm_superpose.cpp
1672 + """.splitlines()
1673 + source.extend( [ op.join( ssm_prefix, f ) for f in ssm_sources ] )
1674 +
1675 +-need_f_c = (
1676 +- libtbx.env.has_module("solve_resolve")
1677 +- or libtbx.env.find_in_repositories(relative_path="mosflm_fable"))
1678 +-if (need_f_c or os.name != "nt"):
1679 +- source.append(op.join("#ccp4io_adaptbx", "fortran_call_stubs.c"))
1680 +- for file_name in """\
1681 +-ccp4_diskio_f.c
1682 +-ccp4_general.c
1683 +-ccp4_general_f.c
1684 +-ccp4_parser_f.c
1685 +-ccp4_program.c
1686 +-ccp4_unitcell_f.c
1687 +-cmaplib_f.c
1688 +-cmtzlib_f.c
1689 +-csymlib_f.c
1690 +-library_f.c
1691 +-""".splitlines():
1692 +- open(op.join(build_ccp4io_adaptbx, file_name), "w").write(
1693 +- replace_printf(file_name=file_name))
1694 +- source.append(op.join("#ccp4io_adaptbx", file_name))
1695 +- source.append(op.join("#ccp4io_adaptbx", "printf_wrappers.c"))
1696 +-
1697 + # static library for solve_resolve
1698 + env.StaticLibrary(target='#lib/ccp4io', source=source)
1699 +-env_etc.ccp4io_lib = "ccp4io"
1700 +
1701 + if ( libtbx.env.has_module("boost")
1702 + and not env_etc.no_boost_python):
1703 + Import( "env_no_includes_boost_python_ext" )
1704 + sources = [ "#ccp4io_adaptbx/ext.cpp" ]
1705 + env_ext = env_no_includes_boost_python_ext.Clone()
1706 +- env_ext.Prepend( LIBS = "ccp4io" )
1707 ++ env_ext.Prepend( LIBS = env_etc.ccp4io_lib )
1708 + env_etc.include_registry.append(
1709 + env = env_ext,
1710 +- paths = [
1711 +- os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src ),
1712 +- os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb" ),
1713 +- os.path.join( env_etc.ccp4io_dist, "lib", "ssm"),
1714 +- env_etc.boost_include,
1715 +- env_etc.python_include,
1716 +- ]
1717 ++ paths = mmdb_path + [ os.path.join( env_etc.ccp4io_dist, "lib", "ssm"),
1718 ++ env_etc.boost_include,
1719 ++ env_etc.python_include,
1720 ++ ]
1721 + )
1722 + env_ext.SharedLibrary( target = "#lib/ccp4io_adaptbx_ext", source = sources )
1723 +diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
1724 +index af767ae..6ce770c 100644
1725 +--- a/cctbx_sources/cctbx/SConscript
1726 ++++ b/cctbx_sources/cctbx/SConscript
1727 +@@ -106,7 +106,7 @@ if (not env_etc.no_boost_python):
1728 + Import("env_no_includes_boost_python_ext")
1729 +
1730 + env_cctbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
1731 +- env_cctbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
1732 ++ env_cctbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
1733 + env_etc.include_registry.append(
1734 + env=env_cctbx_boost_python_ext,
1735 + paths=env_etc.cctbx_common_includes + [env_etc.python_include])
1736 +diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
1737 +index 9cce49e..c39047f 100644
1738 +--- a/cctbx_sources/clipper_adaptbx/SConscript
1739 ++++ b/cctbx_sources/clipper_adaptbx/SConscript
1740 +@@ -3,54 +3,63 @@ Import("env_base", "env_etc")
1741 +
1742 + env_etc.clipper_dist = libtbx.env.dist_path("clipper")
1743 + env_etc.clipper_include = env_etc.clipper_dist
1744 ++# This way the compiler looks in the standard location for includes
1745 ++# should work on all platforms
1746 ++env_etc.clipper_sysinclude = ''
1747 +
1748 + env = env_base.Clone(
1749 + SHLINKFLAGS=env_etc.shlinkflags,
1750 + LIBS=env_etc.libm)
1751 +-env.Prepend(CPPPATH=[env_etc.clipper_include])
1752 +-
1753 +-if (env_etc.static_libraries): builder = env.StaticLibrary
1754 +-else: builder = env.SharedLibrary
1755 +-builder(target='#lib/clipper',
1756 +- source = ["../clipper/clipper/core/"+file_name for file_name in """
1757 +- atomsf.cpp
1758 +- cell.cpp
1759 +- clipper_memory.cpp
1760 +- clipper_message.cpp
1761 +- clipper_stats.cpp
1762 +- clipper_types.cpp
1763 +- clipper_util.cpp
1764 +- container.cpp
1765 +- container_hkl.cpp
1766 +- container_map.cpp
1767 +- container_types.cpp
1768 +- coords.cpp
1769 +- derivs.cpp
1770 +- hkl_compute.cpp
1771 +- hkl_data.cpp
1772 +- hkl_datatypes.cpp
1773 +- hkl_info.cpp
1774 +- hkl_lookup.cpp
1775 +- hkl_operators.cpp
1776 +- map_interp.cpp
1777 +- map_utils.cpp
1778 +- nxmap.cpp
1779 +- nxmap_operator.cpp
1780 +- ramachandran.cpp
1781 +- resol_basisfn.cpp
1782 +- resol_fn.cpp
1783 +- resol_targetfn.cpp
1784 +- rotation.cpp
1785 +- spacegroup.cpp
1786 +- spacegroup_data.cpp
1787 +- symop.cpp
1788 +- xmap.cpp
1789 +-""".split()])
1790 +-# fftmap_sparse.cpp
1791 +-# fftmap.cpp
1792 ++if env_etc.check_syslib('clipper-core') and \
1793 ++ env_etc.check_syslib('clipper-contrib'):
1794 ++ env.Prepend(CPPPATH=[env_etc.clipper_sysinclude])
1795 ++ env_etc.clipper_libs=['clipper-core', 'clipper-contrib']
1796 ++ env_etc.has_clipper_contrib = True
1797 ++else:
1798 ++ env.Prepend(CPPPATH=[env_etc.clipper_include])
1799 ++ env_etc.clipper_libs=['clipper',]
1800 ++ if (env_etc.static_libraries): builder = env.StaticLibrary
1801 ++ else: builder = env.SharedLibrary
1802 ++ builder(target='#lib/'+env_etc.clipper_libs[0],
1803 ++ source = ["../clipper/clipper/core/"+file_name for file_name in """
1804 ++ atomsf.cpp
1805 ++ cell.cpp
1806 ++ clipper_memory.cpp
1807 ++ clipper_message.cpp
1808 ++ clipper_stats.cpp
1809 ++ clipper_types.cpp
1810 ++ clipper_util.cpp
1811 ++ container.cpp
1812 ++ container_hkl.cpp
1813 ++ container_map.cpp
1814 ++ container_types.cpp
1815 ++ coords.cpp
1816 ++ derivs.cpp
1817 ++ hkl_compute.cpp
1818 ++ hkl_data.cpp
1819 ++ hkl_datatypes.cpp
1820 ++ hkl_info.cpp
1821 ++ hkl_lookup.cpp
1822 ++ hkl_operators.cpp
1823 ++ map_interp.cpp
1824 ++ map_utils.cpp
1825 ++ nxmap.cpp
1826 ++ nxmap_operator.cpp
1827 ++ ramachandran.cpp
1828 ++ resol_basisfn.cpp
1829 ++ resol_fn.cpp
1830 ++ resol_targetfn.cpp
1831 ++ rotation.cpp
1832 ++ spacegroup.cpp
1833 ++ spacegroup_data.cpp
1834 ++ symop.cpp
1835 ++ xmap.cpp
1836 ++ """.split()])
1837 ++ # fftmap_sparse.cpp
1838 ++ # fftmap.cpp
1839 +
1840 + env_exe = env.Clone()
1841 +-env_exe.Prepend(LIBS=["clipper"])
1842 ++env_exe.Prepend(LIBS=[env_etc.clipper_libs[0]])
1843 +
1844 + exe = env_exe.Program(
1845 + target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
1846 +@@ -77,6 +86,7 @@ if (hasattr(env_etc, "cctbx_include")):
1847 + env=env_clipper_boost_python_ext,
1848 + paths=[
1849 + env_etc.clipper_include,
1850 ++ env_etc.clipper_sysinclude,
1851 + env_etc.libtbx_include,
1852 + env_etc.cctbx_include,
1853 + env_etc.scitbx_include,
1854 +diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
1855 +index 9f79f83..1911eb1 100644
1856 +--- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
1857 ++++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
1858 +@@ -1,6 +1,10 @@
1859 +-Import("env_clipper_boost_python_ext")
1860 ++Import("env_clipper_boost_python_ext", "env_etc")
1861 + env = env_clipper_boost_python_ext.Clone()
1862 +-env.Prepend(LIBS=["clipper", "cctbx"])
1863 ++env.Prepend(LIBS=env_etc.clipper_libs+["cctbx"])
1864 ++if (env_etc.has_clipper_contrib):
1865 ++ clipper_contrib_files = []
1866 ++else:
1867 ++ clipper_contrib_files = ["../../clipper/clipper/contrib/sfweight.cpp",]
1868 + env.SharedLibrary(
1869 + target="#lib/clipper_ext",
1870 + source=[
1871 +@@ -8,4 +12,4 @@ env.SharedLibrary(
1872 + "hendrickson_lattman_bpl.cpp",
1873 + "sigmaa_bpl.cpp",
1874 + "../../clipper/clipper/contrib/sfweight.cpp",
1875 +- "../../clipper/clipper/cctbx/clipper_cctbx.cpp"])
1876 ++ "../../clipper/clipper/cctbx/clipper_cctbx.cpp"]+clipper_contrib_files)
1877 +diff --git a/cctbx_sources/gltbx/SConscript b/cctbx_sources/gltbx/SConscript
1878 +index 4b2213d..04e0654 100644
1879 +--- a/cctbx_sources/gltbx/SConscript
1880 ++++ b/cctbx_sources/gltbx/SConscript
1881 +@@ -12,14 +12,15 @@ env_etc.gltbx_common_includes = [
1882 + env_etc.scitbx_include,
1883 + env_etc.boost_include,
1884 + ]
1885 +-if (gl2ps_path is not None):
1886 +- env_etc.gltbx_common_includes.append(gl2ps_path)
1887 ++if not env_etc.check_syslib('gl2ps', extra_libs='GL'):
1888 ++ if (gl2ps_path is not None):
1889 ++ env_etc.gltbx_common_includes.append(gl2ps_path)
1890 +
1891 + if (not env_etc.no_boost_python):
1892 + Import("env_base", "env_no_includes_boost_python_ext")
1893 + trial_env = env_base.Clone()
1894 + env = env_no_includes_boost_python_ext.Clone()
1895 +- env.Prepend(LIBS=["scitbx_boost_python"])
1896 ++ env.Prepend(LIBS=[env_etc.scitbx_boost_python])
1897 + if (env_etc.compiler == "win32_cl"):
1898 + for e in [trial_env, env]:
1899 + e.Append(LIBS=["glu32", "opengl32"])
1900 +@@ -79,10 +80,15 @@ if (not env_etc.no_boost_python):
1901 + source=source)
1902 + env_util = env
1903 + source = ["util_ext.cpp"]
1904 +- if (gl2ps_path is not None):
1905 +- source.append("#gui_resources/gl2ps/gl2ps.c")
1906 +- env_util = env.Clone()
1907 +- env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
1908 ++ if not env_etc.check_syslib('gl2ps', extra_libs='GL'):
1909 ++ if (gl2ps_path is not None):
1910 ++ source.append("#gui_resources/gl2ps/gl2ps.c")
1911 ++ env_util = env.Clone()
1912 ++ env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
1913 ++ else:
1914 ++ env_util = env.Clone()
1915 ++ env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
1916 ++ env_util.Append(LIBS=["gl2ps"])
1917 + env_util.SharedLibrary(
1918 + target="#lib/gltbx_util_ext",
1919 + source=source)
1920 +diff --git a/cctbx_sources/iotbx/cif/boost_python/SConscript b/cctbx_sources/iotbx/cif/boost_python/SConscript
1921 +index 49837af..2833ff1 100644
1922 +--- a/cctbx_sources/iotbx/cif/boost_python/SConscript
1923 ++++ b/cctbx_sources/iotbx/cif/boost_python/SConscript
1924 +@@ -34,15 +34,18 @@ antlr3_src_files = [
1925 + ]
1926 +
1927 + prefix = "#ucif/antlr3/src"
1928 +-source = [os.path.join(prefix, file_name) for file_name in antlr3_src_files]
1929 ++if not env_etc.check_syslib('antlr3c'):
1930 ++ source = [os.path.join(prefix, file_name) for file_name in antlr3_src_files]
1931 ++ env_etc.include_registry.append(
1932 ++ env=env,
1933 ++ paths=[antlr3_include, antlr3_dist])
1934 ++else:
1935 ++ source = []
1936 ++ env.Append(LIBS=['antlr3c'])
1937 + source.extend([
1938 + "cif_ext.cpp",
1939 + "#ucif/cifParser.cpp",
1940 + "#ucif/cifLexer.cpp",
1941 + ])
1942 +
1943 +-env_etc.include_registry.append(
1944 +- env=env,
1945 +- paths=[antlr3_include, antlr3_dist])
1946 +-
1947 + env.SharedLibrary(target="#lib/iotbx_cif_ext", source=source)
1948 +diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
1949 +index c0a4bb0..cd539e6 100644
1950 +--- a/cctbx_sources/iotbx/mtz/SConscript
1951 ++++ b/cctbx_sources/iotbx/mtz/SConscript
1952 +@@ -22,7 +22,8 @@ if (not env_etc.no_boost_python):
1953 + env = env_iotbx_boost_python_ext.Clone()
1954 + env.Append(CXXFLAGS=env_etc.ccp4io_defines)
1955 + env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
1956 +- env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib, "scitbx_boost_python"])
1957 ++ env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib,
1958 ++ env_etc.scitbx_boost_python])
1959 + env_etc.enable_more_warnings(env=env)
1960 + env.SharedLibrary(
1961 + target="#lib/iotbx_mtz_ext",
1962 +diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
1963 +index 6af2664..9b89fe1 100644
1964 +--- a/cctbx_sources/iotbx/pdb/SConscript
1965 ++++ b/cctbx_sources/iotbx/pdb/SConscript
1966 +@@ -33,7 +33,7 @@ env.Program(target="hybrid_36_fem", source=["hybrid_36_fem.cpp"])
1967 + if (not env_etc.no_boost_python):
1968 + Import("env_iotbx_boost_python_ext")
1969 + env = env_iotbx_boost_python_ext.Clone()
1970 +- env.Prepend(LIBS=["iotbx_pdb", "cctbx", "scitbx_boost_python"])
1971 ++ env.Prepend(LIBS=["iotbx_pdb", "cctbx", env_etc.scitbx_boost_python])
1972 + env_etc.enable_more_warnings(env=env)
1973 + env.SharedLibrary(
1974 + target="#lib/iotbx_pdb_ext",
1975 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
1976 +index debf569..429c44b 100644
1977 +--- a/cctbx_sources/libtbx/SConscript
1978 ++++ b/cctbx_sources/libtbx/SConscript
1979 +@@ -4,7 +4,7 @@ from libtbx import easy_run
1980 + from libtbx.utils import getenv_bool
1981 + from libtbx.str_utils import show_string
1982 + from libtbx.path import norm_join, full_command_path
1983 +-import sys, os
1984 ++import sys, os, re
1985 + op = os.path
1986 +
1987 + if (hasattr(Environment, "Clone")):
1988 +@@ -1018,4 +1018,88 @@ def enable_cuda_if_possible():
1989 + enable_openmp_if_possible()
1990 + enable_cuda_if_possible()
1991 +
1992 ++env_etc.use_system_libs = False
1993 ++def check_syslib(lib, extra_libs=None):
1994 ++ """ Check if a system library is available """
1995 ++ if not env_etc.use_system_libs:
1996 ++ return False
1997 ++ env_syslib = env_base.Clone(LIBS=extra_libs)
1998 ++ conf = env_syslib.Configure()
1999 ++ if not conf.CheckLib(library=lib):
2000 ++ print 'Could not find %s library!'%(lib)
2001 ++ conf.Finish()
2002 ++ return False
2003 ++ else:
2004 ++ conf.Finish()
2005 ++ return True
2006 ++env_etc.check_syslib = check_syslib
2007 ++
2008 ++env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
2009 ++
2010 ++if (libtbx.env.build_options.use_system_libs):
2011 ++ env_etc.use_system_libs = True
2012 ++
2013 ++deb_py_str = '-py%s%s'%(sys.version[0], sys.version[2])
2014 ++gentoo_py_str = '-%s.%s'%(sys.version[0], sys.version[2])
2015 ++# This list can be extended by other distro's
2016 ++py_str_lst = [deb_py_str, gentoo_py_str]
2017 ++
2018 ++for py_str in py_str_lst:
2019 ++ if env_etc.check_syslib('boost_python%s'%py_str,
2020 ++ extra_libs=env_etc.py_lib):
2021 ++ env_etc.boost_python = 'boost_python%s'%py_str
2022 ++ env_etc.scitbx_boost_python = 'scitbx_boost_python%s'%py_str
2023 ++ break
2024 ++ else:
2025 ++ env_etc.boost_python = 'boost_python'
2026 ++ env_etc.scitbx_boost_python = 'scitbx_boost_python'
2027 ++
2028 ++env_etc.prefix = libtbx.env.build_options.install_prefix
2029 ++env_etc.destdir = libtbx.env.build_options.install_destdir
2030 ++env_etc.libdir = libtbx.env.build_options.libdir
2031 ++env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
2032 ++env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
2033 ++env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
2034 ++env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
2035 ++env_etc.rpath = os.path.join(env_etc.prefix, 'lib')
2036 ++
2037 ++def create_install_targets():
2038 ++ cwd = os.getcwd()
2039 ++ rp = libtbx.env.repository_paths
2040 ++ lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
2041 ++ exe_dev = libtbx.env.under_build("exe_dev")
2042 ++ include_path = libtbx.env.include_path
2043 ++ if not os.path.exists(lib_dir):
2044 ++ os.makedirs(lib_dir)
2045 ++ rp = list(rp)
2046 ++ rp.append(lib_dir)
2047 ++ rp.append(include_path)
2048 ++ for p in rp:
2049 ++ if isinstance(p, str):
2050 ++ src_dir = p
2051 ++ else:
2052 ++ src_dir = abs(p)
2053 ++ os.chdir(src_dir)
2054 ++ dest = None
2055 ++ for root, dirnames, filenames in os.walk('.'):
2056 ++ for filename in filenames:
2057 ++ if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
2058 ++ dest = os.path.join(env_etc.libpath, root)
2059 ++ src = os.path.join(src_dir, root, filename)
2060 ++ env_base.Install(dest, src)
2061 ++ env_base.Alias("install-shlib", dest)
2062 ++ if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
2063 ++ dest = os.path.join(env_etc.inclpath, root)
2064 ++ src = os.path.join(src_dir, root, filename)
2065 ++ env_base.Install(dest, src)
2066 ++ env_base.Alias("install-header", dest)
2067 ++ dest = env_etc.binpath
2068 ++ env_base.Install(dest, Glob('%s/*'%(exe_dev)))
2069 ++ env_base.Alias("install-bin", dest)
2070 ++ Alias('install', ['install-header', 'install-shlib', 'install-bin'])
2071 ++ os.chdir(cwd)
2072 ++
2073 ++if 'install' in COMMAND_LINE_TARGETS:
2074 ++ create_install_targets()
2075 ++
2076 + Export("env_base", "env_etc")
2077 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
2078 +index c3e1c7d..0885527 100644
2079 +--- a/cctbx_sources/libtbx/env_config.py
2080 ++++ b/cctbx_sources/libtbx/env_config.py
2081 +@@ -701,6 +701,10 @@ Wait for the command to finish, then try again.""" % vars())
2082 + precompile_headers=command_line.options.precompile_headers,
2083 + static_libraries=command_line.options.static_libraries,
2084 + static_exe=command_line.options.static_exe,
2085 ++ use_system_libs=command_line.options.use_system_libs,
2086 ++ install_prefix=command_line.options.install_prefix,
2087 ++ libdir=command_line.options.libdir,
2088 ++ install_destdir=command_line.options.install_destdir,
2089 + scan_boost=command_line.options.scan_boost,
2090 + write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
2091 + boost_python_no_py_signatures
2092 +@@ -1759,6 +1763,10 @@ class build_options:
2093 + warning_level,
2094 + static_libraries,
2095 + static_exe,
2096 ++ use_system_libs,
2097 ++ install_prefix,
2098 ++ libdir,
2099 ++ install_destdir,
2100 + scan_boost,
2101 + write_full_flex_fwd_h=default_write_full_flex_fwd_h,
2102 + build_boost_python_extensions=default_build_boost_python_extensions,
2103 +@@ -1822,6 +1830,10 @@ class build_options:
2104 + print >> f, "Boost threads enabled:", self.enable_boost_threads
2105 + print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
2106 + print >> f, "Enable CUDA:", self.enable_cuda
2107 ++ print >> f, "Use System Libraries:", self.use_system_libs
2108 ++ print >> f, "Install Prefix:", self.install_prefix
2109 ++ print >> f, "Libdir:", self.libdir
2110 ++ print >> f, "Install Destdir:", self.install_destdir
2111 + print >> f, "Use opt_resources if available:", self.opt_resources
2112 + print >> f, "Use environment flags:", self.use_environment_flags
2113 + if( self.use_environment_flags ):
2114 +@@ -1940,6 +1952,28 @@ class pre_process_args:
2115 + action="store_true",
2116 + default=False,
2117 + help="link all executables statically (implies --static_libraries)")
2118 ++ parser.option(None, "--use_system_libs",
2119 ++ action="store_true",
2120 ++ default=False,
2121 ++ help="Use system Libraries to build.")
2122 ++ parser.option(None, "--install_destdir",
2123 ++ type="string",
2124 ++ action="store",
2125 ++ default="",
2126 ++ help="sets the destdir for the install targets.",
2127 ++ metavar="DIRECTORY")
2128 ++ parser.option(None, "--libdir",
2129 ++ type="string",
2130 ++ action="store",
2131 ++ default="lib",
2132 ++ help="sets the libdir relative to the PREFIX for the install targets. Default: lib",
2133 ++ metavar="DIRECTORY")
2134 ++ parser.option(None, "--install_prefix",
2135 ++ type="string",
2136 ++ action="store",
2137 ++ default="/usr/local",
2138 ++ help="sets the prefix for the install targets. Default: /usr/local",
2139 ++ metavar="DIRECTORY")
2140 + parser.option(None, "--scan_boost",
2141 + action="store_true",
2142 + default=False,
2143 +diff --git a/cctbx_sources/mmtbx/den/SConscript b/cctbx_sources/mmtbx/den/SConscript
2144 +index 2d3ce36..1a2b171 100644
2145 +--- a/cctbx_sources/mmtbx/den/SConscript
2146 ++++ b/cctbx_sources/mmtbx/den/SConscript
2147 +@@ -3,7 +3,7 @@ Import("env_etc")
2148 + if (not env_etc.no_boost_python):
2149 + Import("env_iotbx_boost_python_ext")
2150 + env = env_iotbx_boost_python_ext.Clone()
2151 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
2152 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
2153 + env_etc.enable_more_warnings(env=env)
2154 + env.SharedLibrary(
2155 + target="#lib/mmtbx_den_restraints_ext",
2156 +diff --git a/cctbx_sources/mmtbx/geometry_restraints/SConscript b/cctbx_sources/mmtbx/geometry_restraints/SConscript
2157 +index 222d5f6..e11e5f9 100644
2158 +--- a/cctbx_sources/mmtbx/geometry_restraints/SConscript
2159 ++++ b/cctbx_sources/mmtbx/geometry_restraints/SConscript
2160 +@@ -3,7 +3,7 @@ Import("env_etc")
2161 + if (not env_etc.no_boost_python):
2162 + Import("env_iotbx_boost_python_ext")
2163 + env = env_iotbx_boost_python_ext.Clone()
2164 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
2165 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
2166 + env_etc.enable_more_warnings(env=env)
2167 + env.SharedLibrary(
2168 + target="#lib/mmtbx_hbond_restraints_ext",
2169 +diff --git a/cctbx_sources/mmtbx/secondary_structure/SConscript b/cctbx_sources/mmtbx/secondary_structure/SConscript
2170 +index 7e82b43..5698af5 100644
2171 +--- a/cctbx_sources/mmtbx/secondary_structure/SConscript
2172 ++++ b/cctbx_sources/mmtbx/secondary_structure/SConscript
2173 +@@ -3,7 +3,7 @@ Import("env_etc")
2174 + if (not env_etc.no_boost_python):
2175 + Import("env_iotbx_boost_python_ext")
2176 + env = env_iotbx_boost_python_ext.Clone()
2177 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
2178 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
2179 + env_etc.enable_more_warnings(env=env)
2180 + env.SharedLibrary(
2181 + target="#lib/mmtbx_secondary_structure_ext",
2182 +diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
2183 +index a1ab8e5..e2958a1 100644
2184 +--- a/cctbx_sources/rstbx/SConscript
2185 ++++ b/cctbx_sources/rstbx/SConscript
2186 +@@ -39,7 +39,7 @@ if (not env_etc.no_boost_python):
2187 + Import("env_boost_python_ext")
2188 + env_rstbx_boost_python_ext = env_boost_python_ext.Clone()
2189 + env_rstbx_boost_python_ext.Prepend(
2190 +- LIBS=["rstbx", "cctbx", "scitbx_boost_python"])
2191 ++ LIBS=["rstbx", "cctbx", env_etc.scitbx_boost_python])
2192 + env_rstbx_boost_python_ext.SharedLibrary(
2193 + target="#lib/rstbx_ext", source="ext.cpp")
2194 + env_rstbx_boost_python_ext.SharedLibrary(
2195 +diff --git a/cctbx_sources/scitbx/SConscript b/cctbx_sources/scitbx/SConscript
2196 +index 9199ae0..6045fbc 100644
2197 +--- a/cctbx_sources/scitbx/SConscript
2198 ++++ b/cctbx_sources/scitbx/SConscript
2199 +@@ -28,7 +28,7 @@ SConscript("sparse/tests/SConscript")
2200 + if (not env_etc.no_boost_python):
2201 + Import("env_no_includes_boost_python_ext")
2202 + env_scitbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
2203 +- env_scitbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
2204 ++ env_scitbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
2205 + env_etc.include_registry.append(
2206 + env=env_scitbx_boost_python_ext,
2207 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
2208 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
2209 +index eda7b03..1f396e5 100644
2210 +--- a/cctbx_sources/scitbx/boost_python/SConscript
2211 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
2212 +@@ -7,7 +7,7 @@ env_etc.enable_more_warnings(env=env)
2213 + env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
2214 + env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
2215 + env.Append(LIBPATH=env_etc.libpath_python)
2216 +-env.Append(LIBS=["boost_python"] + env_etc.libs_python)
2217 ++env.Append(LIBS=[env_etc.boost_python] + env_etc.libs_python)
2218 + env_etc.include_registry.append(
2219 + env=env,
2220 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
2221 +@@ -20,5 +20,5 @@ lib_scitbx_boost_python_sources = [
2222 + if (env_etc.static_libraries): builder = env.StaticLibrary
2223 + else: builder = env.SharedLibrary
2224 + builder(
2225 +- target="#lib/scitbx_boost_python",
2226 ++ target="#lib/%s"%env_etc.scitbx_boost_python,
2227 + source=lib_scitbx_boost_python_sources)
2228 +diff --git a/cctbx_sources/smtbx/refinement/boost_python/SConscript b/cctbx_sources/smtbx/refinement/boost_python/SConscript
2229 +index 0387e1d..5144996 100644
2230 +--- a/cctbx_sources/smtbx/refinement/boost_python/SConscript
2231 ++++ b/cctbx_sources/smtbx/refinement/boost_python/SConscript
2232 +@@ -1,6 +1,6 @@
2233 +-Import("env_smtbx_boost_python_ext")
2234 ++Import("env_smtbx_boost_python_ext", "env_etc")
2235 + env = env_smtbx_boost_python_ext.Clone()
2236 +-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
2237 ++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
2238 + env.SharedLibrary(target="#lib/smtbx_refinement_least_squares_ext", source=[
2239 + "least_squares_ext.cpp",
2240 + "weighting_schemes.cpp",
2241 +diff --git a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
2242 +index 009d288..1eb176b 100644
2243 +--- a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
2244 ++++ b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
2245 +@@ -1,5 +1,5 @@
2246 +-Import("env_smtbx_boost_python_ext")
2247 ++Import("env_smtbx_boost_python_ext", "env_etc")
2248 + env = env_smtbx_boost_python_ext.Clone()
2249 +-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
2250 ++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
2251 + env.SharedLibrary(target="#lib/smtbx_refinement_constraints_ext",
2252 + source=Glob("*.cpp"))
2253 +diff --git a/cctbx_sources/spotfinder/SConscript b/cctbx_sources/spotfinder/SConscript
2254 +index 1d280d4..1d73677 100644
2255 +--- a/cctbx_sources/spotfinder/SConscript
2256 ++++ b/cctbx_sources/spotfinder/SConscript
2257 +@@ -54,7 +54,7 @@ if (not env_etc.no_boost_python):
2258 + Import("env_no_includes_boost_python_ext")
2259 +
2260 + env_spotfinder_boost_python_ext = env_no_includes_boost_python_ext.Clone()
2261 +- env_spotfinder_boost_python_ext.Prepend(LIBS=[ "scitbx_boost_python"])
2262 ++ env_spotfinder_boost_python_ext.Prepend(LIBS=[ env_etc.scitbx_boost_python ])
2263 + env_etc.include_registry.append(
2264 + env=env_spotfinder_boost_python_ext,
2265 + paths=env_etc.spotfinder_common_includes + [env_etc.python_include])
2266
2267 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0007-adding-shlib-versioning.patch b/sci-libs/cctbx/files/2012.05.08.2305/0007-adding-shlib-versioning.patch
2268 new file mode 100644
2269 index 0000000..fd1888e
2270 --- /dev/null
2271 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0007-adding-shlib-versioning.patch
2272 @@ -0,0 +1,208 @@
2273 +From: Radostan Riedel <raybuntu@××××××××××.com>
2274 +Date: Mon, 23 Jul 2012 18:33:07 +0200
2275 +Subject: adding-shlib-versioning
2276 +
2277 +---
2278 + cctbx_sources/boost_adaptbx/SConscript | 3 +
2279 + cctbx_sources/libtbx/SConscript | 115 +++++++++++++++++++++++++++++---
2280 + cctbx_sources/libtbx/env_config.py | 7 ++
2281 + 3 files changed, 116 insertions(+), 9 deletions(-)
2282 +
2283 +diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
2284 +index 68cac89..dedbb05 100644
2285 +--- a/cctbx_sources/boost_adaptbx/SConscript
2286 ++++ b/cctbx_sources/boost_adaptbx/SConscript
2287 +@@ -58,6 +58,9 @@ if (not env_etc.no_boost_python):
2288 + SHLINKFLAGS=env_etc.shlinkflags_bpl,
2289 + SHLIBPREFIX="",
2290 + LIBS=[env_etc.boost_python] + env_etc.libs_python + env_etc.libm)
2291 ++ if (libtbx.env.build_options.libtoolize):
2292 ++ # Need to unset libtool since it does not support linking python-ext
2293 ++ env_etc.unset_libtool(env_no_includes_boost_python_ext)
2294 + env_no_includes_boost_python_ext.Append(
2295 + LIBPATH=env_etc.libpath_python)
2296 + env_no_includes_boost_python_ext.Append(
2297 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
2298 +index 429c44b..58bdd30 100644
2299 +--- a/cctbx_sources/libtbx/SConscript
2300 ++++ b/cctbx_sources/libtbx/SConscript
2301 +@@ -1061,16 +1061,99 @@ env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
2302 + env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
2303 + env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
2304 + env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
2305 +-env_etc.rpath = os.path.join(env_etc.prefix, 'lib')
2306 ++env_etc.rpath = os.path.abspath(env_etc.prefix + '/' + env_etc.libdir)
2307 ++
2308 ++def set_libtool(env):
2309 ++ # Versioning can be provided by appending "-version-info 3:12:1" to SHLINKFLAGS
2310 ++ # Please see:
2311 ++ # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
2312 ++ # for reference. Otherwise it will be set to 0:0:0
2313 ++ env_etc.shobjsuffix_save = env['SHOBJSUFFIX']
2314 ++ env_etc.SharedLibBuilder_save = env['BUILDERS']['SharedLibrary']
2315 ++ env.Replace(
2316 ++ SHLINKFLAGS='-rpath ' + env_etc.rpath,
2317 ++ SHOBJSUFFIX='.lo',
2318 ++ SHLIBSUFFIX='.la',
2319 ++ )
2320 ++ LIBTOOLCOM = 'libtool --mode=compile --tag='
2321 ++ LIBTOOLCCOM = LIBTOOLCOM + 'CC '
2322 ++ LIBTOOLCXXCOM = LIBTOOLCOM + 'CXX '
2323 ++ LIBTOOLLINK = 'libtool --mode=link --tag=CXX '
2324 ++ ShCAction = SCons.Action.Action(LIBTOOLCCOM + "$SHCCCOM", "$SHCCCOMSTR")
2325 ++ ShCXXAction = SCons.Action.Action(LIBTOOLCXXCOM + "$SHCXXCOM", "$SHCXXCOMSTR")
2326 ++ ShLinkAction = SCons.Action.Action(LIBTOOLLINK + "$SHLINKCOM", "$SHLINKCOMSTR")
2327 ++ libtool_install = 'libtool --mode=install install -D ${TARGET.abspath} %s%s/${TARGET.file}'%(abs(libtbx.env.lib_path), env_etc.rpath)
2328 ++
2329 ++ action_list = [ SCons.Defaults.SharedCheck,
2330 ++ ShLinkAction,
2331 ++ libtool_install,
2332 ++ ]
2333 ++ CSuffixes = SCons.Tool.cc.CSuffixes
2334 ++ # Can't import SCons.Tool.c++.CSuffixes because of that 'c++'
2335 ++ CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
2336 ++ shared_obj = SCons.Builder.Builder(action = {},
2337 ++ emitter = {},
2338 ++ prefix = '$SHOBJPREFIX',
2339 ++ suffix = '$SHOBJSUFFIX',
2340 ++ src_builder = ['CFile', 'CXXFile'],
2341 ++ source_scanner = SourceFileScanner,
2342 ++ single_source = 1)
2343 ++ for suffix in CXXSuffixes:
2344 ++ shared_obj.add_action(suffix, ShCXXAction)
2345 ++ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
2346 ++ for suffix in CSuffixes:
2347 ++ shared_obj.add_action(suffix, ShCAction)
2348 ++ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
2349 ++
2350 ++ LibtoolBuilder = SCons.Builder.Builder(action = action_list,
2351 ++ emitter = "$SHLIBEMITTER",
2352 ++ prefix = '$SHLIBPREFIX',
2353 ++ suffix = '$SHLIBSUFFIX',
2354 ++ target_scanner = ProgramScanner,
2355 ++ src_suffix = '$SHOBJSUFFIX',
2356 ++ src_builder = shared_obj)
2357 ++
2358 ++ from SCons.Tool.install import add_targets_to_INSTALLED_FILES
2359 ++ LibtoolInstall = SCons.Builder.Builder(
2360 ++ action = 'libtool --mode=install install -D ${SOURCE.abspath} ${TARGET.abspath}',
2361 ++ target_factory = env.fs.Entry,
2362 ++ source_factory = env.fs.Entry,
2363 ++ multi = 1,
2364 ++ emitter = [ add_targets_to_INSTALLED_FILES, ],
2365 ++ name = 'LibtoolInstall')
2366 ++
2367 ++ env['BUILDERS']['LibtoolInstall'] = LibtoolInstall
2368 ++
2369 ++ lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
2370 ++ if not os.path.exists(lib_dir):
2371 ++ os.makedirs(lib_dir)
2372 ++ libtool_install_path = '#lib' + env_etc.rpath
2373 ++ env.Append(LIBPATH=libtool_install_path)
2374 ++ env['BUILDERS']['SharedLibrary'] = LibtoolBuilder
2375 ++env_etc.set_libtool = set_libtool
2376 ++
2377 ++def unset_libtool(env):
2378 ++ env['BUILDERS']['SharedLibrary'] = env_etc.SharedLibBuilder_save
2379 ++ env.Replace(
2380 ++ SHOBJSUFFIX=env_etc.shobjsuffix_save,
2381 ++ )
2382 ++env_etc.unset_libtool = unset_libtool
2383 ++
2384 ++if (libtbx.env.build_options.libtoolize):
2385 ++ env_etc.shlibsuffix = ".la"
2386 ++ env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
2387 ++ rpath_link = ['-rpath', env_etc.rpath]
2388 ++ env_etc.shlinkflags.extend(rpath_link)
2389 ++ if '-shared' in env_etc.shlinkflags:
2390 ++ env_etc.shlinkflags.remove('-shared')
2391 ++ env_etc.set_libtool(env_base)
2392 +
2393 + def create_install_targets():
2394 + cwd = os.getcwd()
2395 + rp = libtbx.env.repository_paths
2396 +- lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
2397 ++ lib_dir = abs(libtbx.env.lib_path)
2398 + exe_dev = libtbx.env.under_build("exe_dev")
2399 + include_path = libtbx.env.include_path
2400 +- if not os.path.exists(lib_dir):
2401 +- os.makedirs(lib_dir)
2402 + rp = list(rp)
2403 + rp.append(lib_dir)
2404 + rp.append(include_path)
2405 +@@ -1082,17 +1165,31 @@ def create_install_targets():
2406 + os.chdir(src_dir)
2407 + dest = None
2408 + for root, dirnames, filenames in os.walk('.'):
2409 ++ # exclude .libs dir
2410 ++ if '.libs' in dirnames:
2411 ++ dirnames.remove('.libs')
2412 + for filename in filenames:
2413 +- if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
2414 +- dest = os.path.join(env_etc.libpath, root)
2415 +- src = os.path.join(src_dir, root, filename)
2416 +- env_base.Install(dest, src)
2417 +- env_base.Alias("install-shlib", dest)
2418 ++ if not (libtbx.env.build_options.libtoolize):
2419 ++ if re.match('^lib.*\.(so|dylib|a)$', filename, flags=re.IGNORECASE):
2420 ++ dest = os.path.join(env_etc.libpath, root)
2421 ++ src = os.path.join(src_dir, root, filename)
2422 ++ env_base.Install(dest, src)
2423 ++ env_base.Alias("install-shlib", dest)
2424 ++ else:
2425 ++ if re.match('^lib.*\.la$', filename, flags=re.IGNORECASE):
2426 ++ dest = os.path.join(env_etc.libpath, root, filename)
2427 ++ src = os.path.join(src_dir, root, filename)
2428 ++ env_base.LibtoolInstall(dest, src)
2429 ++ env_base.Alias("install-shlib", dest)
2430 + if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
2431 + dest = os.path.join(env_etc.inclpath, root)
2432 + src = os.path.join(src_dir, root, filename)
2433 + env_base.Install(dest, src)
2434 + env_base.Alias("install-header", dest)
2435 ++ if src_dir == lib_dir:
2436 ++ break
2437 ++
2438 ++ env_base.Alias("install-shlib", dest)
2439 + dest = env_etc.binpath
2440 + env_base.Install(dest, Glob('%s/*'%(exe_dev)))
2441 + env_base.Alias("install-bin", dest)
2442 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
2443 +index 0885527..3d9133e 100644
2444 +--- a/cctbx_sources/libtbx/env_config.py
2445 ++++ b/cctbx_sources/libtbx/env_config.py
2446 +@@ -705,6 +705,7 @@ Wait for the command to finish, then try again.""" % vars())
2447 + install_prefix=command_line.options.install_prefix,
2448 + libdir=command_line.options.libdir,
2449 + install_destdir=command_line.options.install_destdir,
2450 ++ libtoolize=command_line.options.libtoolize,
2451 + scan_boost=command_line.options.scan_boost,
2452 + write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
2453 + boost_python_no_py_signatures
2454 +@@ -1767,6 +1768,7 @@ class build_options:
2455 + install_prefix,
2456 + libdir,
2457 + install_destdir,
2458 ++ libtoolize,
2459 + scan_boost,
2460 + write_full_flex_fwd_h=default_write_full_flex_fwd_h,
2461 + build_boost_python_extensions=default_build_boost_python_extensions,
2462 +@@ -1830,6 +1832,7 @@ class build_options:
2463 + print >> f, "Boost threads enabled:", self.enable_boost_threads
2464 + print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
2465 + print >> f, "Enable CUDA:", self.enable_cuda
2466 ++ print >> f, "Libtoolize:", self.libtoolize
2467 + print >> f, "Use System Libraries:", self.use_system_libs
2468 + print >> f, "Install Prefix:", self.install_prefix
2469 + print >> f, "Libdir:", self.libdir
2470 +@@ -1974,6 +1977,10 @@ class pre_process_args:
2471 + default="/usr/local",
2472 + help="sets the prefix for the install targets. Default: /usr/local",
2473 + metavar="DIRECTORY")
2474 ++ parser.option(None, "--libtoolize",
2475 ++ action="store_true",
2476 ++ default=False,
2477 ++ help="build all shared libraries with libtool.")
2478 + parser.option(None, "--scan_boost",
2479 + action="store_true",
2480 + default=False,
2481
2482 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0008-Fix-to-skip-pycbf-build.patch b/sci-libs/cctbx/files/2012.05.08.2305/0008-Fix-to-skip-pycbf-build.patch
2483 new file mode 100644
2484 index 0000000..7aa3a39
2485 --- /dev/null
2486 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0008-Fix-to-skip-pycbf-build.patch
2487 @@ -0,0 +1,52 @@
2488 +From: Radostan Riedel <raybuntu@××××××××××.com>
2489 +Date: Tue, 7 Aug 2012 18:08:30 +0200
2490 +Subject: Fix to skip pycbf build
2491 +
2492 +---
2493 + cctbx_sources/cbflib_adaptbx/SConscript | 8 ++++----
2494 + cctbx_sources/cbflib_adaptbx/libtbx_refresh.py | 16 ++++++++--------
2495 + 2 files changed, 12 insertions(+), 12 deletions(-)
2496 +
2497 +diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
2498 +index 334cfc2..42ab9c3 100644
2499 +--- a/cctbx_sources/cbflib_adaptbx/SConscript
2500 ++++ b/cctbx_sources/cbflib_adaptbx/SConscript
2501 +@@ -90,10 +90,10 @@ if (not env_etc.no_boost_python):
2502 + env=env_cbflib_boost_python_ext,
2503 + paths=env_etc.cbflib_common_includes + [env_etc.python_include])
2504 +
2505 +- env_cbflib_boost_python_ext.SharedLibrary(
2506 +- target='#lib/_pycbf',
2507 +- source=[prefix+"/pycbf/pycbf_wrap.c"],
2508 +- LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
2509 ++ #env_cbflib_boost_python_ext.SharedLibrary(
2510 ++ # target='#lib/_pycbf',
2511 ++ # source=[prefix+"/pycbf/pycbf_wrap.c"],
2512 ++ # LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
2513 +
2514 + Export("env_cbflib_boost_python_ext")
2515 +
2516 +diff --git a/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py b/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
2517 +index 51b3e42..dd1b8e9 100644
2518 +--- a/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
2519 ++++ b/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
2520 +@@ -1,11 +1,11 @@
2521 + from libtbx.str_utils import show_string
2522 + import os
2523 + op = os.path
2524 +-pycbf_py = self.env.under_dist(module_name="cbflib", path="pycbf/pycbf.py")
2525 +-if (not op.isfile(pycbf_py)):
2526 +- raise RuntimeError("Missing file: %s" % show_string(pycbf_py))
2527 +-target_dir = self.env.under_build(path="lib")
2528 +-if (not op.isdir(target_dir)):
2529 +- os.makedirs(target_dir)
2530 +-print " Copying to lib: %s" % show_string(pycbf_py)
2531 +-open(op.join(target_dir, "pycbf.py"), "w").write(open(pycbf_py).read())
2532 ++#pycbf_py = self.env.under_dist(module_name="cbflib", path="pycbf/pycbf.py")
2533 ++#if (not op.isfile(pycbf_py)):
2534 ++# raise RuntimeError("Missing file: %s" % show_string(pycbf_py))
2535 ++#target_dir = self.env.under_build(path="lib")
2536 ++#if (not op.isdir(target_dir)):
2537 ++# os.makedirs(target_dir)
2538 ++#print " Copying to lib: %s" % show_string(pycbf_py)
2539 ++#open(op.join(target_dir, "pycbf.py"), "w").write(open(pycbf_py).read())
2540
2541 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0009-build-libann-statically.patch b/sci-libs/cctbx/files/2012.05.08.2305/0009-build-libann-statically.patch
2542 new file mode 100644
2543 index 0000000..77ba2b2
2544 --- /dev/null
2545 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0009-build-libann-statically.patch
2546 @@ -0,0 +1,27 @@
2547 +From: Radostan Riedel <raybuntu@××××××××××.com>
2548 +Date: Thu, 19 Jul 2012 11:29:57 +0200
2549 +Subject: build libann statically
2550 +
2551 +---
2552 + cctbx_sources/annlib_adaptbx/SConscript | 8 +++++---
2553 + 1 file changed, 5 insertions(+), 3 deletions(-)
2554 +
2555 +diff --git a/cctbx_sources/annlib_adaptbx/SConscript b/cctbx_sources/annlib_adaptbx/SConscript
2556 +index 31b4da6..f217b3f 100644
2557 +--- a/cctbx_sources/annlib_adaptbx/SConscript
2558 ++++ b/cctbx_sources/annlib_adaptbx/SConscript
2559 +@@ -29,9 +29,11 @@ if (libtbx.manual_date_stamp < 20090819):
2560 + env.Replace(CXXFLAGS=env_etc.cxxflags_base)
2561 + env.Replace(SHCXXFLAGS=env_etc.cxxflags_base)
2562 +
2563 +-if (env_etc.static_libraries): builder = env.StaticLibrary
2564 +-else: builder = env.SharedLibrary
2565 +-builder(target='#lib/ann',
2566 ++#if (env_etc.static_libraries): builder = env.StaticLibrary
2567 ++#else: builder = env.SharedLibrary
2568 ++# Create a static library since the changes are incompatiple
2569 ++# with debian's libann
2570 ++env.StaticLibrary(target='#lib/ann',
2571 + source = ["../annlib/src/ANN.cpp",
2572 + "../annlib/src/bd_fix_rad_search.cpp",
2573 + "../annlib/src/bd_pr_search.cpp",
2574
2575 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0010-adding-setup_py.patch b/sci-libs/cctbx/files/2012.05.08.2305/0010-adding-setup_py.patch
2576 new file mode 100644
2577 index 0000000..7599d82
2578 --- /dev/null
2579 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0010-adding-setup_py.patch
2580 @@ -0,0 +1,662 @@
2581 +From: Baptiste Carvello <devel@×××××××××××××××××.net>
2582 +Date: Tue, 21 Aug 2012 16:10:19 +0200
2583 +Subject: adding-setup_py
2584 +
2585 +---
2586 + cctbx_sources/stdlib.py | 4 +
2587 + sconsutils.py | 485 +++++++++++++++++++++++++++++++++++++++++++++++
2588 + setup.py | 136 +++++++++++++
2589 + 3 files changed, 625 insertions(+)
2590 + create mode 100755 cctbx_sources/stdlib.py
2591 + create mode 100644 sconsutils.py
2592 + create mode 100755 setup.py
2593 +
2594 +diff --git a/cctbx_sources/stdlib.py b/cctbx_sources/stdlib.py
2595 +new file mode 100755
2596 +index 0000000..759f689
2597 +--- /dev/null
2598 ++++ b/cctbx_sources/stdlib.py
2599 +@@ -0,0 +1,4 @@
2600 ++from libtbx.forward_compatibility import stdlib_import
2601 ++
2602 ++math = stdlib_import("math")
2603 ++random = stdlib_import("random")
2604 +diff --git a/sconsutils.py b/sconsutils.py
2605 +new file mode 100644
2606 +index 0000000..322585b
2607 +--- /dev/null
2608 ++++ b/sconsutils.py
2609 +@@ -0,0 +1,485 @@
2610 ++from distutils.sysconfig import get_python_lib, get_config_var
2611 ++from distutils.command.build_ext import build_ext as _build_ext
2612 ++from distutils.command.build_py import build_py as _build_py
2613 ++from distutils.command.install_lib import install_lib as _install_lib
2614 ++from distutils.command.install_data import install_data as _install_data
2615 ++from distutils.command.clean import clean as _clean
2616 ++from distutils.cmd import Command as _Command
2617 ++from distutils.dir_util import remove_tree
2618 ++from distutils.util import change_root, convert_path
2619 ++from distutils.errors import DistutilsExecError
2620 ++from distutils import log
2621 ++import sys, os
2622 ++import SCons.Script
2623 ++import libtbx
2624 ++import libtbx.env_config
2625 ++from libtbx.path import relocatable_path, absolute_path
2626 ++from libtbx.path import relpath # don't use relpath from os.path, introduced in 2.6
2627 ++from libtbx.utils import import_python_object
2628 ++import threading
2629 ++import pickle
2630 ++
2631 ++opj = os.path.join
2632 ++configure_list = []
2633 ++scons_buildargv = []
2634 ++scons_installargv = []
2635 ++SRCDIR=''
2636 ++
2637 ++class Command(_Command):
2638 ++ def run_scons(self, argv):
2639 ++ cwd = os.getcwd()
2640 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build') # build_temp must be set by subclass
2641 ++ if not os.path.exists(builddir):
2642 ++ if not os.path.exists(os.path.abspath(self.build_temp)):
2643 ++ os.mkdir(os.path.abspath(self.build_temp))
2644 ++ os.mkdir(builddir)
2645 ++ elif not os.path.isdir(builddir):
2646 ++ raise RuntimeError(("Build directory '%s' cannot be created "
2647 ++ "because of existing file") % builddir)
2648 ++ os.chdir(builddir)
2649 ++ if '%PREFIX%' in configure_list:
2650 ++ idx=configure_list.index('%PREFIX%')
2651 ++ configure_list[idx] = self.prefix # prefix must be set by subclass
2652 ++ libtbx.env_config.cold_start(configure_list)
2653 ++ os.environ["LIBTBX_BUILD"] = builddir
2654 ++ os.environ['PYTHONPATH'] = ':'.join(sys.path)
2655 ++ self.spawn(argv)
2656 ++ os.chdir(cwd)
2657 ++
2658 ++class build_ext(_build_ext, Command):
2659 ++ user_options = _build_ext.user_options + [
2660 ++ ('prefix=', None, "installation prefix (default: python installation prefix")
2661 ++ ]
2662 ++ def initialize_options(self):
2663 ++ _build_ext.initialize_options(self)
2664 ++ self.prefix = None
2665 ++ def finalize_options(self):
2666 ++ _build_ext.finalize_options(self)
2667 ++ if not self.prefix:
2668 ++ self.prefix = get_config_var('prefix') # on Debian: 'usr'
2669 ++ def run(self):
2670 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build') # build_temp set by _build_ext
2671 ++ self.run_scons(scons_buildargv)
2672 ++ for ext in self.extensions:
2673 ++ if len(ext.sources) != 1 or ext.sources[0] != '%SCONSLIB%':
2674 ++ log.warn("Don't know how to build extension '%s' -- skipping",
2675 ++ ext.name)
2676 ++ continue
2677 ++ dst = self.get_ext_fullpath(ext.name)
2678 ++ bld = opj(builddir, 'lib', os.path.basename(dst))
2679 ++ if os.path.isfile(bld):
2680 ++ self.copy_file(bld, dst)
2681 ++
2682 ++class build_py(_build_py):
2683 ++ def build_module (self, module, module_file, package):
2684 ++ if type(package) is str:
2685 ++ package = package.split('.')
2686 ++ elif type(package) not in (list, tuple):
2687 ++ raise TypeError, \
2688 ++ "'package' must be a string (dot-separated), list, or tuple"
2689 ++
2690 ++ # Now put the module source file into the "build" area -- this is
2691 ++ # easy, we just copy it somewhere under self.build_lib (the build
2692 ++ # directory for Python source).
2693 ++ outfile = self.get_module_outfile(self.build_lib, package, module)
2694 ++ dir = os.path.dirname(outfile)
2695 ++ self.mkpath(dir)
2696 ++ # If the module contains non-blank, non-comment/docstring lines, and doesn't have
2697 ++ # the __future__ import, add it before the first non-comment/docstring line
2698 ++ empty = True
2699 ++ found = False
2700 ++ docstring = None
2701 ++ file_obj = open(module_file)
2702 ++ for line in file_obj:
2703 ++ if docstring:
2704 ++ if (line.count(docstring) % 2) == 1:
2705 ++ # FIXME this logic will fail with lines such as """ + ''',
2706 ++ # but nobody with a sane mind would do that, would they ?
2707 ++ docstring = None
2708 ++ continue
2709 ++ if line == "from __future__ import division\n":
2710 ++ found = True
2711 ++ break
2712 ++ if line.isspace() or line.startswith('#'):
2713 ++ continue
2714 ++ if line.startswith('"""') and (line.count('"""') % 2) == 1:
2715 ++ docstring = '"""'
2716 ++ continue
2717 ++ if line.startswith('"'):
2718 ++ continue
2719 ++ if line.startswith("'''") and (line.count("'''") % 2) == 1:
2720 ++ docstring = "'''"
2721 ++ continue
2722 ++ if line.startswith("'"):
2723 ++ continue
2724 ++ empty = False
2725 ++ break
2726 ++ file_obj.close()
2727 ++ if empty or found:
2728 ++ return self.copy_file(module_file, outfile, preserve_mode=0)
2729 ++ elif self.dry_run:
2730 ++ if os.path.isdir(outfile):
2731 ++ outfile = opj(outfile, os.path.basename(module_file))
2732 ++ log.info("copying with modification %s -> %s", module_file, outfile)
2733 ++ return outfile, True
2734 ++ else:
2735 ++ if os.path.isdir(outfile):
2736 ++ outfile = opj(outfile, os.path.basename(module_file))
2737 ++ log.info("copying with modification %s -> %s", module_file, outfile)
2738 ++ file_obj = open(module_file)
2739 ++ outfile_obj = open(outfile, 'w')
2740 ++ written = False
2741 ++ docstring = None
2742 ++ for line in file_obj:
2743 ++ if not written:
2744 ++ if docstring:
2745 ++ if (line.count(docstring) % 2) == 1:
2746 ++ docstring = None
2747 ++ outfile_obj.write(line)
2748 ++ continue
2749 ++ if line.isspace() or line.startswith('#'):
2750 ++ outfile_obj.write(line)
2751 ++ continue
2752 ++ if line.startswith('"""') and (line.count('"""') % 2) == 1:
2753 ++ docstring = '"""'
2754 ++ outfile_obj.write(line)
2755 ++ continue
2756 ++ if line.startswith('"'):
2757 ++ outfile_obj.write(line)
2758 ++ continue
2759 ++ if line.startswith("'''") and (line.count("'''") % 2) == 1:
2760 ++ docstring = "'''"
2761 ++ outfile_obj.write(line)
2762 ++ continue
2763 ++ if line.startswith("'"):
2764 ++ outfile_obj.write(line)
2765 ++ continue
2766 ++ outfile_obj.write("from __future__ import division\n")
2767 ++ written = True
2768 ++ outfile_obj.write(line)
2769 ++ outfile_obj.close()
2770 ++ file_obj.close()
2771 ++ return outfile, True
2772 ++
2773 ++class test(_Command):
2774 ++ description = "runs the tests in the distutils build directory"
2775 ++ user_options = [
2776 ++ ('build-lib=', None,
2777 ++ "distutils build directory (default: 'build.build-lib')"),
2778 ++ ('build-temp=', 't',
2779 ++ "directory for temporary files (default: 'build.build-temp')")
2780 ++ ]
2781 ++ def initialize_options(self):
2782 ++ self.build_lib = None
2783 ++ self.build_temp = None
2784 ++ def finalize_options(self):
2785 ++ self.set_undefined_options('build',
2786 ++ ('build_lib', 'build_lib'),
2787 ++ ('build_temp', 'build_temp'))
2788 ++ def run(self):
2789 ++ libdir = os.path.abspath(os.path.abspath(self.build_lib))
2790 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
2791 ++ testdir = opj(os.path.abspath(self.build_temp), 'cctbx-test')
2792 ++ self.setup_test_env(builddir, libdir, testdir)
2793 ++ os.environ["LIBTBX_BUILD"] = testdir
2794 ++ env = libtbx.env_config.unpickle()
2795 ++ os.environ['PYTHONPATH'] = ':'.join([libdir] + sys.path[5:])
2796 ++ llp = os.environ.get('LD_LIBRARY_PATH')
2797 ++ if llp is not None:
2798 ++ os.environ['LD_LIBRARY_PATH'] = ':'.join([opj(builddir, 'lib', '.libs'), llp])
2799 ++ else:
2800 ++ os.environ['LD_LIBRARY_PATH'] = opj(builddir, 'lib', '.libs')
2801 ++ os.chdir(testdir)
2802 ++ failed = []
2803 ++ for m in env.module_list:
2804 ++ for (module_name,dist_path) in m.name_and_dist_path_pairs():
2805 ++ try:
2806 ++# tst_list = import_python_object(
2807 ++# import_path="%s.run_tests.tst_list" % module_name, Does not work yet
2808 ++# error_prefix="",
2809 ++# target_must_be="",
2810 ++# where_str="").object
2811 ++ run_func = import_python_object(
2812 ++ import_path="%s.run_tests.run" % module_name,
2813 ++ error_prefix="",
2814 ++ target_must_be="",
2815 ++ where_str="").object
2816 ++ tst_mod = file(opj(abs(dist_path), "run_tests.py")) # Ugly, temporary
2817 ++ tst_lines = [l.strip() for l in tst_mod]
2818 ++ tst_mod.close()
2819 ++ tst_code = " ".join(["("] +
2820 ++ tst_lines[(tst_lines.index("tst_list = (")+1)
2821 ++ :(tst_lines.index(")")+1)]
2822 ++ )
2823 ++ tst_list = eval(tst_code)
2824 ++
2825 ++ except Exception:
2826 ++ continue
2827 ++ for tst in tst_list: # adapted from libtbx.test_utils.iter_tests_cmd
2828 ++ cmd_args = []
2829 ++ if (type(tst) == type([])):
2830 ++# cmd_args = tst[1:] FIXME why only in quick mode?
2831 ++ tst = tst[0]
2832 ++ if (tst.startswith("$B")):
2833 ++ tst_path = tst.replace("$B", builddir)
2834 ++ else:
2835 ++ tst_path = tst.replace("$D", abs(dist_path))
2836 ++ if "$" in tst_path or '"' in tst_path:
2837 ++ log.warn("Could not run test '%s':\n%s", tst, "Unexpected '$' in test path")
2838 ++ failed.append([module_name,tst,AssertionError("Unexpected '$' in test path")])
2839 ++ continue
2840 ++ if '"' in tst_path:
2841 ++ log.warn("Could not run test '%s':\n%s", tst, "Unexpected '\"' in test path")
2842 ++ failed.append([module_name,tst,AssertionError("Unexpected '\"' in test path")])
2843 ++ continue
2844 ++ tst_path = os.path.normpath(tst_path)
2845 ++ if (tst_path.endswith(".py")):
2846 ++ cmd = [sys.executable, tst_path] + cmd_args
2847 ++ else:
2848 ++ cmd = [tst_path] + cmd_args
2849 ++ try:
2850 ++ self.spawn(cmd)
2851 ++ except DistutilsExecError, e:
2852 ++ log.warn("Failure in test '%s':\n%s", tst, str(e))
2853 ++ failed.append([module_name,tst,e])
2854 ++ except Exception, e:
2855 ++ log.warn("Exception in test '%s':\n%s", tst, str(e))
2856 ++ failed.append([module_name,tst,e])
2857 ++ if failed:
2858 ++ log.warn("Some tests failed:")
2859 ++ for n,t,e in failed:
2860 ++ log.warn(" module %s, test %s" % (n,t))
2861 ++ raise RuntimeError("Test failures")
2862 ++
2863 ++ def setup_test_env(self, builddir, libdir, testdir):
2864 ++ """ Create the test directory and the temporary libtbx_env pickle object """
2865 ++ if not os.path.exists(testdir):
2866 ++ if not os.path.exists(os.path.abspath(self.build_temp)):
2867 ++ os.mkdir(os.path.abspath(self.build_temp))
2868 ++ os.mkdir(testdir)
2869 ++ elif not os.path.isdir(testdir):
2870 ++ raise RuntimeError(("Test directory '%s' cannot be created "
2871 ++ "because of existing file") % testdir)
2872 ++ os.environ["LIBTBX_BUILD"] = builddir
2873 ++ env = libtbx.env_config.unpickle()
2874 ++ module_dist_paths = {}
2875 ++ for key, value in env.module_dist_paths.items():
2876 ++ head, module = os.path.split(abs(value))
2877 ++ module_dist_paths[key] = relocatable_path(absolute_path(libdir), module)
2878 ++ env.module_dist_paths = module_dist_paths
2879 ++ for module in env.module_list:
2880 ++ paths = []
2881 ++ for path in module.dist_paths:
2882 ++ if path != None:
2883 ++ head, tail = os.path.split(abs(path))
2884 ++ rp = relocatable_path(absolute_path(libdir), tail)
2885 ++ paths.append(rp)
2886 ++ else:
2887 ++ paths.append(None)
2888 ++ module.dist_paths = paths
2889 ++ file_obj = open(opj(testdir,'libtbx_env'), 'wb')
2890 ++ pickle.dump(env, file_obj, 0)
2891 ++ file_obj.close()
2892 ++
2893 ++class install_lib(_install_lib, Command):
2894 ++ user_options = _install_lib.user_options + [
2895 ++ ('build-temp=', 't',
2896 ++ "directory for temporary files (default: 'build.build-temp')"),
2897 ++ ('prefix=', None, "installation prefix (default: 'install.prefix')"),
2898 ++ ('root=', None,
2899 ++ "install everything relative to this alternate root directory (default: 'install.root')")
2900 ++ ]
2901 ++ def initialize_options(self):
2902 ++ _install_lib.initialize_options(self)
2903 ++ self.build_temp = None
2904 ++ self.prefix = None
2905 ++ self.root = None
2906 ++ def finalize_options(self):
2907 ++ _install_lib.finalize_options(self)
2908 ++ self.set_undefined_options('build',
2909 ++ ('build_temp', 'build_temp'))
2910 ++ self.set_undefined_options('install',
2911 ++ ('prefix', 'prefix'),
2912 ++ ('root', 'root'))
2913 ++ def run(self):
2914 ++ _install_lib.run(self)
2915 ++ if self.root != None:
2916 ++ ip = '--install_destdir'
2917 ++ if ip not in configure_list:
2918 ++ configure_list.extend([ip, self.root])
2919 ++ self.run_scons(scons_installargv)
2920 ++
2921 ++class install_data(_install_data, Command):
2922 ++ user_options = _install_data.user_options + [
2923 ++ ('build-temp=', 't',
2924 ++ "directory for temporary files (default: 'build.build-temp')"),
2925 ++ ('prefix=', None, "installation prefix (default: 'install.prefix')")
2926 ++ ]
2927 ++ def initialize_options(self):
2928 ++ _install_data.initialize_options(self)
2929 ++ self.build_temp = None
2930 ++ self.prefix = None
2931 ++ def finalize_options(self):
2932 ++ _install_data.finalize_options(self)
2933 ++ self.set_undefined_options('build',
2934 ++ ('build_temp', 'build_temp'))
2935 ++ self.set_undefined_options('install',
2936 ++ ('prefix', 'prefix'))
2937 ++ def run(self):
2938 ++ # filter the list
2939 ++ newdf = []
2940 ++ libtbx_env_path = None
2941 ++ for f in self.data_files:
2942 ++ if type(f) is str:
2943 ++ newdf.append(f)
2944 ++ continue
2945 ++ if '%LIBTBXENV%' in f[1]:
2946 ++ f = (f[0], [p for p in f[1] if p != '%LIBTBXENV%'])
2947 ++ libtbx_env_path = opj(convert_path(f[0]), 'libtbx_env')
2948 ++ if not os.path.isabs(libtbx_env_path): # mimic the logic in install_data
2949 ++ libtbx_env_path = opj(self.install_dir, libtbx_env_path)
2950 ++ elif self.root:
2951 ++ libtbx_env_path = change_root(self.root, libtbx_env_path)
2952 ++ # we leave the directory in, so that distutils will create it
2953 ++ newdf.append(f)
2954 ++ self.data_files = newdf
2955 ++ _install_data.run(self)
2956 ++ if libtbx_env_path is not None:
2957 ++ self.install_libtbx_env(libtbx_env_path)
2958 ++ self.outfiles.append(libtbx_env_path)
2959 ++
2960 ++ def install_libtbx_env(self, libtbx_env_path):
2961 ++ """ Modify libtbx_env pickle object to set the correct paths. """
2962 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
2963 ++ os.environ["LIBTBX_BUILD"] = builddir
2964 ++ env = libtbx.env_config.unpickle()
2965 ++ env.build_path = absolute_path(self.prefix)
2966 ++ build_path = env.build_path
2967 ++ python_lib = get_python_lib()
2968 ++ rel_path = opj(python_lib, 'cctbx')
2969 ++ env.bin_path = relocatable_path(build_path, 'bin')
2970 ++ env.lib_path = relocatable_path(build_path, 'lib')
2971 ++ env.include_path = relocatable_path(build_path, 'include')
2972 ++ env.repository_paths = relocatable_path(build_path, rel_path)
2973 ++ env.scons_dist_path = None
2974 ++ env.pythonpath = None
2975 ++ env.exe_path = env.bin_path
2976 ++ env.python_exe = relocatable_path(build_path, sys.executable)
2977 ++ env.path_utility = relocatable_path(build_path,
2978 ++ opj(rel_path, 'libtbx', 'command_line', 'path_utility.py'))
2979 ++ module_dist_paths = {}
2980 ++ for key, value in env.module_dist_paths.items():
2981 ++ head, module = os.path.split(abs(value))
2982 ++ module_dist_paths[key] = relocatable_path(build_path,
2983 ++ opj(rel_path, module))
2984 ++ env.module_dist_paths = module_dist_paths
2985 ++ for module in env.module_list:
2986 ++ paths = []
2987 ++ for path in module.dist_paths:
2988 ++ if path != None:
2989 ++ head, tail = os.path.split(abs(path))
2990 ++ rp = relocatable_path(build_path, opj(rel_path, tail))
2991 ++ paths.append(rp)
2992 ++ else:
2993 ++ paths.append(None)
2994 ++ module.dist_paths = paths
2995 ++ _dispatcher_registry={}
2996 ++ for key, value in env._dispatcher_registry.items():
2997 ++ new_key = relocatable_path(anchor=build_path,
2998 ++ relocatable=key.relocatable)
2999 ++ rel = relpath(abs(value), SRCDIR)
3000 ++ new_val = relocatable_path(anchor=absolute_path(rel_path),
3001 ++ relocatable=rel)
3002 ++ _dispatcher_registry[new_key] = new_val
3003 ++ env._dispatcher_registry = _dispatcher_registry
3004 ++ # install the environment file in the data dir
3005 ++ file_obj = open(libtbx_env_path, 'wb')
3006 ++ pickle.dump(env, file_obj, 0)
3007 ++ file_obj.close()
3008 ++
3009 ++class clean(_clean):
3010 ++ def run(self):
3011 ++ # remove the scons build dir
3012 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
3013 ++ if os.path.exists(builddir):
3014 ++ remove_tree(builddir, dry_run=self.dry_run)
3015 ++ else:
3016 ++ log.debug("'%s' does not exist -- can't clean it",
3017 ++ builddir)
3018 ++ # remove the scons test dir
3019 ++ testdir = opj(os.path.abspath(self.build_temp), 'cctbx-test')
3020 ++ if os.path.exists(testdir):
3021 ++ remove_tree(testdir, dry_run=self.dry_run)
3022 ++ else:
3023 ++ log.debug("'%s' does not exist -- can't clean it",
3024 ++ testdir)
3025 ++ # call the base class to remove the distutils dirs
3026 ++ _clean.run(self)
3027 ++
3028 ++# adapted from setuptools
3029 ++# authors: Phillip J. Eby, Tarek Ziade and the distutils SIG
3030 ++# licence: PSF or ZPL
3031 ++
3032 ++from distutils.util import convert_path
3033 ++import re
3034 ++
3035 ++EXTPAT1 = re.compile(r"^from (\S+_ext) import")
3036 ++EXTPAT2 = re.compile(r"^import (\S+_ext)$")
3037 ++EXTPAT3 = re.compile(r"boost.python.import_ext\(['\"](\S+_ext)['\"]\)$")
3038 ++EXTPAT4 = re.compile(r"import_ext\(['\"](\S+_ext)['\"]\)$") # in module boost.python!
3039 ++
3040 ++def find_packages_and_extensions(where='.', exclude=()):
3041 ++ """Return a list all Python packages found within directory 'where'
3042 ++ and a list all extensions that need to be installed inside those packages
3043 ++
3044 ++ 'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
3045 ++ will be converted to the appropriate local path syntax. 'exclude' is a
3046 ++ sequence of package names to exclude; '*' can be used as a wildcard in the
3047 ++ names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
3048 ++ 'foo' itself).
3049 ++ """
3050 ++ out = []
3051 ++ outext = set()
3052 ++ stack=[(convert_path(where), '')]
3053 ++
3054 ++ while stack:
3055 ++
3056 ++ where,prefix = stack.pop(0)
3057 ++ for name in os.listdir(where):
3058 ++
3059 ++ fn = opj(where,name)
3060 ++ if ('.' not in name and os.path.isdir(fn) and
3061 ++ os.path.isfile(opj(fn,'__init__.py'))
3062 ++ ):
3063 ++
3064 ++ out.append(prefix+name); stack.append((fn,prefix+name+'.'))
3065 ++
3066 ++ if name.endswith('.py'):
3067 ++
3068 ++ f = open(opj(where, name))
3069 ++ for l in f:
3070 ++
3071 ++ m = EXTPAT1.match(l)
3072 ++ if m is not None:
3073 ++ outext.add(m.group(1))
3074 ++
3075 ++ m = EXTPAT2.match(l)
3076 ++ if m is not None:
3077 ++ outext.add(m.group(1))
3078 ++
3079 ++ m = EXTPAT3.search(l)
3080 ++ if m is not None:
3081 ++ outext.add(m.group(1))
3082 ++
3083 ++ if name == 'python.py' and prefix.endswith('boost.'):
3084 ++ m = EXTPAT4.search(l)
3085 ++ if m is not None:
3086 ++ outext.add(m.group(1))
3087 ++
3088 ++ f.close()
3089 ++
3090 ++ for pat in list(exclude)+['ez_setup', 'distribute_setup']:
3091 ++ from fnmatch import fnmatchcase
3092 ++ out = [item for item in out if not fnmatchcase(item,pat)]
3093 ++
3094 ++ return out, list(outext)
3095 +diff --git a/setup.py b/setup.py
3096 +new file mode 100755
3097 +index 0000000..033dc9e
3098 +--- /dev/null
3099 ++++ b/setup.py
3100 +@@ -0,0 +1,142 @@
3101 ++from distutils.core import setup, Extension
3102 ++import sys, os, shutil
3103 ++
3104 ++# General settings
3105 ++opj = os.path.join
3106 ++CURDIR = os.getcwd()
3107 ++SRCDIR = opj(CURDIR, 'cctbx_sources')
3108 ++py_vers = sys.version_info
3109 ++py_major = py_vers[0]
3110 ++py_minor = py_vers[1]
3111 ++py_str = 'python%s.%s'%(py_major, py_minor)
3112 ++clipper = opj('clipper_adaptbx','clipper')
3113 ++boost = opj('boost_adaptbx','boost')
3114 ++libtbx_pypath = opj('libtbx','pythonpath')
3115 ++scons_exe = '/usr/bin/scons' # FIXME platform dependent path
3116 ++scons_path = '/usr/lib/scons/'
3117 ++PATHLIST= [ SRCDIR,
3118 ++ opj(SRCDIR, libtbx_pypath),
3119 ++ opj(SRCDIR, clipper),
3120 ++ opj(SRCDIR, boost),
3121 ++ scons_path,
3122 ++ ]
3123 ++for p in PATHLIST:
3124 ++ if p not in sys.path:
3125 ++ # we need to insert at the front, in case cctbx is already installed
3126 ++ sys.path.insert(0,p)
3127 ++
3128 ++import sconsutils
3129 ++from sconsutils import find_packages_and_extensions, build_ext, build_py, test, install_lib, install_data, clean
3130 ++
3131 ++sconsutils.SRCDIR = SRCDIR
3132 ++
3133 ++# Debian Multiarch magic
3134 ++multiarch = os.environ.get('DEB_HOST_MULTIARCH')
3135 ++libdir = os.environ.get('MULTILIBDIR')
3136 ++if multiarch == None:
3137 ++ multiarch = ''
3138 ++else:
3139 ++ libdir = 'lib/' + multiarch
3140 ++
3141 ++if libdir == None:
3142 ++ libdir = 'lib'
3143 ++# Configure settings
3144 ++# We need this directory to get env_config.cold_start to run!
3145 ++# trailing slash is important
3146 ++init_dir = opj(SRCDIR, 'libtbx')+os.sep # the separator is needed for dirname to do the right thing
3147 ++build_opts = [ '--libtoolize',
3148 ++ '--use_system_libs',
3149 ++ '--use-environment-flags',
3150 ++ '--libdir', libdir,
3151 ++ '--install_prefix', '%PREFIX%', # prefix will be replaced at run time
3152 ++ ]
3153 ++conf_modules = [ 'annlib_adaptbx',
3154 ++ 'boost_adaptbx',
3155 ++ 'cbflib_adaptbx',
3156 ++ 'ccp4io_adaptbx',
3157 ++ 'cctbx',
3158 ++ 'chiltbx',
3159 ++ 'clipper_adaptbx',
3160 ++ 'crys3d',
3161 ++ 'fable',
3162 ++ 'fftw3tbx',
3163 ++ 'gltbx',
3164 ++ 'iotbx',
3165 ++ 'libtbx',
3166 ++ 'mmtbx',
3167 ++ 'omptbx',
3168 ++ 'rstbx',
3169 ++ 'scitbx',
3170 ++ 'smtbx',
3171 ++ 'spotfinder',
3172 ++ 'tbxx',
3173 ++ 'tntbx',
3174 ++ 'ucif',
3175 ++ 'wxtbx',
3176 ++ ]
3177 ++sconsutils.configure_list = [init_dir]
3178 ++sconsutils.configure_list.extend(build_opts)
3179 ++sconsutils.configure_list.extend(conf_modules)
3180 ++
3181 ++# Build settings
3182 ++sconsutils.scons_buildargv = [sys.executable, scons_exe]
3183 ++
3184 ++# Install settings
3185 ++sconsutils.scons_installargv = [sys.executable, scons_exe, 'install']
3186 ++
3187 ++# Setup settings
3188 ++
3189 ++NAME = 'cctbx'
3190 ++VERSION = '2012.05.08.2305'
3191 ++DESCRIPTION = 'cctbx'
3192 ++AUTHOR = 'cctbx'
3193 ++AUTHOR_EMAIL = 'cctbx@×××××××.gov'
3194 ++URL = 'http://cctbx.sourceforge.net/'
3195 ++LICENSE = 'CCTBX 2.0'
3196 ++KEYWORDS = 'crystallography'
3197 ++SCRIPTS = []
3198 ++PKG_DATA = {}
3199 ++EXTRA_PATH = 'cctbx'
3200 ++
3201 ++MODS = ['stdlib']
3202 ++
3203 ++PACKDIR = { 'boost' : 'cctbx_sources/boost_adaptbx/boost', # in setup, paths must stay in unix syntax
3204 ++ 'clipper' : 'cctbx_sources/clipper_adaptbx/clipper', # also, let's keep them relative
3205 ++ 'optik' : 'cctbx_sources/libtbx/pythonpath/optik', # FIXME installs incompatible fork to global path
3206 ++ 'tntbx' : 'cctbx_sources/tntbx/tntbx',
3207 ++ '' : 'cctbx_sources',
3208 ++ }
3209 ++
3210 ++PACKS = []
3211 ++EXT_MODULES = []
3212 ++for key, value in PACKDIR.items():
3213 ++ p, e = find_packages_and_extensions(value)
3214 ++ PACKS.extend(p)
3215 ++ EXT_MODULES.extend(e)
3216 ++ if key != '':
3217 ++ PACKS.append(key)
3218 ++
3219 ++EXT_MODULES = [ Extension(e, ['%SCONSLIB%']) for e in EXT_MODULES ] # special treatment from install_lib
3220 ++
3221 ++setup(name=NAME,
3222 ++ version = VERSION,
3223 ++ author = AUTHOR,
3224 ++ author_email = AUTHOR_EMAIL,
3225 ++ url = URL,
3226 ++ description = DESCRIPTION,
3227 ++ license = LICENSE,
3228 ++ keywords = KEYWORDS,
3229 ++ extra_path = EXTRA_PATH,
3230 ++ scripts = SCRIPTS,
3231 ++ py_modules = MODS,
3232 ++ package_dir = PACKDIR,
3233 ++ packages = PACKS,
3234 ++ ext_modules = EXT_MODULES,
3235 ++ data_files = [('share/cctbx/%s'%(py_str), ['%LIBTBXENV%'])], # special treatment from install_data
3236 ++ cmdclass = {'build_ext': build_ext,
3237 ++ 'build_py': build_py,
3238 ++ 'test': test,
3239 ++ 'install_lib': install_lib,
3240 ++ 'install_data': install_data,
3241 ++ 'clean': clean},
3242 ++ )
3243
3244 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0011-fix-missing-python-lib-during-linking.patch b/sci-libs/cctbx/files/2012.05.08.2305/0011-fix-missing-python-lib-during-linking.patch
3245 new file mode 100644
3246 index 0000000..6724c0c
3247 --- /dev/null
3248 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0011-fix-missing-python-lib-during-linking.patch
3249 @@ -0,0 +1,47 @@
3250 +From: Radostan Riedel <raybuntu@××××××××××.com>
3251 +Date: Thu, 19 Jul 2012 23:26:30 +0200
3252 +Subject: fix missing python lib during linking
3253 +
3254 +---
3255 + cctbx_sources/libtbx/SConscript | 4 ++--
3256 + cctbx_sources/scitbx/boost_python/SConscript | 2 +-
3257 + 2 files changed, 3 insertions(+), 3 deletions(-)
3258 +
3259 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
3260 +index 58bdd30..53e1512 100644
3261 +--- a/cctbx_sources/libtbx/SConscript
3262 ++++ b/cctbx_sources/libtbx/SConscript
3263 +@@ -54,9 +54,11 @@ def set_python_include_and_libs(env_etc):
3264 + env_etc.python_include = libtbx.env_config.python_include_path()
3265 + if (sys.platform == "win32"):
3266 + env_etc.libs_python = ["python" + sys.version[0] + sys.version[2]]
3267 ++ env_etc.py_lib = 'python%s%s'%(sys.version[0], sys.version[2])
3268 + env_etc.libpath_python = [sys.prefix + r"\libs"]
3269 + else:
3270 + env_etc.libs_python = []
3271 ++ env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
3272 + env_etc.libpath_python = []
3273 + if (env_etc.compiler.startswith("darwin_")):
3274 + env_etc.python_framework = "/".join(
3275 +@@ -1034,8 +1036,6 @@ def check_syslib(lib, extra_libs=None):
3276 + return True
3277 + env_etc.check_syslib = check_syslib
3278 +
3279 +-env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
3280 +-
3281 + if (libtbx.env.build_options.use_system_libs):
3282 + env_etc.use_system_libs = True
3283 +
3284 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
3285 +index 1f396e5..b906eb3 100644
3286 +--- a/cctbx_sources/scitbx/boost_python/SConscript
3287 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
3288 +@@ -7,7 +7,7 @@ env_etc.enable_more_warnings(env=env)
3289 + env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
3290 + env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
3291 + env.Append(LIBPATH=env_etc.libpath_python)
3292 +-env.Append(LIBS=[env_etc.boost_python] + env_etc.libs_python)
3293 ++env.Append(LIBS=[env_etc.boost_python] + [env_etc.py_lib,] + env_etc.libs_python)
3294 + env_etc.include_registry.append(
3295 + env=env,
3296 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
3297
3298 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0012-fix-to-remove-cctbx.python-interpreter.patch b/sci-libs/cctbx/files/2012.05.08.2305/0012-fix-to-remove-cctbx.python-interpreter.patch
3299 new file mode 100644
3300 index 0000000..ec9a216
3301 --- /dev/null
3302 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0012-fix-to-remove-cctbx.python-interpreter.patch
3303 @@ -0,0 +1,29 @@
3304 +From: Radostan Riedel <raybuntu@××××××××××.com>
3305 +Date: Mon, 23 Jul 2012 23:58:46 +0200
3306 +Subject: fix to remove cctbx.python interpreter
3307 +
3308 +---
3309 + cctbx_sources/rstbx/bpcx/uc1_2.py | 2 +-
3310 + cctbx_sources/rstbx/bpcx/uc1_2_reeke.py | 2 +-
3311 + 2 files changed, 2 insertions(+), 2 deletions(-)
3312 +
3313 +diff --git a/cctbx_sources/rstbx/bpcx/uc1_2.py b/cctbx_sources/rstbx/bpcx/uc1_2.py
3314 +index 95ee9cd..1abf8e1 100644
3315 +--- a/cctbx_sources/rstbx/bpcx/uc1_2.py
3316 ++++ b/cctbx_sources/rstbx/bpcx/uc1_2.py
3317 +@@ -1,4 +1,4 @@
3318 +-#!/usr/bin/env cctbx.python
3319 ++#!/usr/bin/env python
3320 + #
3321 + # Biostruct-X Data Reduction Use Case 1.2:
3322 + #
3323 +diff --git a/cctbx_sources/rstbx/bpcx/uc1_2_reeke.py b/cctbx_sources/rstbx/bpcx/uc1_2_reeke.py
3324 +index c07c015..8eebd49 100644
3325 +--- a/cctbx_sources/rstbx/bpcx/uc1_2_reeke.py
3326 ++++ b/cctbx_sources/rstbx/bpcx/uc1_2_reeke.py
3327 +@@ -1,4 +1,4 @@
3328 +-#!/usr/bin/env cctbx.python
3329 ++#!/usr/bin/env python
3330 + #
3331 + # Biostruct-X Data Reduction Use Case 1.2:
3332 + #
3333
3334 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch b/sci-libs/cctbx/files/2012.05.08.2305/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch
3335 new file mode 100644
3336 index 0000000..8243d93
3337 --- /dev/null
3338 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch
3339 @@ -0,0 +1,90 @@
3340 +From: Radostan Riedel <raybuntu@××××××××××.com>
3341 +Date: Tue, 24 Jul 2012 17:12:30 +0200
3342 +Subject: fix to support LDFLAGS in use_enviroment_flags
3343 +
3344 +---
3345 + cctbx_sources/libtbx/SConscript | 11 ++++++++++-
3346 + cctbx_sources/libtbx/env_config.py | 7 ++++++-
3347 + 2 files changed, 16 insertions(+), 2 deletions(-)
3348 +
3349 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
3350 +index 53e1512..7d51d4a 100644
3351 +--- a/cctbx_sources/libtbx/SConscript
3352 ++++ b/cctbx_sources/libtbx/SConscript
3353 +@@ -777,11 +777,15 @@ else:
3354 + # user options for any compiler from the environment variables
3355 + # at the time of configure
3356 + opts = libtbx.env.build_options
3357 ++ env_etc.ldflags_base = []
3358 + if( opts.use_environment_flags ):
3359 + print "libtbx.scons: using flags from initial environment: "
3360 + print " CXXFLAGS = ", opts.env_cxxflags
3361 + print " CFLAGS = ", opts.env_cflags
3362 + print " CPPFLAGS = ", opts.env_cppflags
3363 ++ print " LDFLAGS = ", opts.env_ldflags
3364 ++ flg = opts.env_ldflags.split(" ")
3365 ++ env_etc.ldflags_base = flg
3366 + flg = opts.env_cxxflags.split(" ")
3367 + if( hasattr(env_etc, "cxxflags_base") ):
3368 + env_etc.cxxflags_base.extend(flg)
3369 +@@ -853,6 +857,9 @@ def env_base_sync_with_env_etc():
3370 + SHCFLAGS=env_etc.cflags_base,
3371 + SHCCFLAGS=env_etc.ccflags_base,
3372 + SHCXXFLAGS=env_etc.cxxflags_base)
3373 ++ env_base.Prepend(LINKFLAGS=env_etc.ldflags_base)
3374 ++ env_etc.shlinkflags.extend(env_etc.ldflags_base)
3375 ++ env_etc.shlinkflags_bpl.extend(env_etc.ldflags_base)
3376 + env_base_sync_with_env_etc()
3377 +
3378 + if (static_exe):
3379 +@@ -1070,8 +1077,10 @@ def set_libtool(env):
3380 + # for reference. Otherwise it will be set to 0:0:0
3381 + env_etc.shobjsuffix_save = env['SHOBJSUFFIX']
3382 + env_etc.SharedLibBuilder_save = env['BUILDERS']['SharedLibrary']
3383 ++ sh_flg = list(env_etc.ldflags_base)
3384 ++ sh_flg.extend(['-rpath', env_etc.rpath])
3385 + env.Replace(
3386 +- SHLINKFLAGS='-rpath ' + env_etc.rpath,
3387 ++ SHLINKFLAGS=sh_flg,
3388 + SHOBJSUFFIX='.lo',
3389 + SHLIBSUFFIX='.la',
3390 + )
3391 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
3392 +index 3d9133e..d8fb063 100644
3393 +--- a/cctbx_sources/libtbx/env_config.py
3394 ++++ b/cctbx_sources/libtbx/env_config.py
3395 +@@ -1803,6 +1803,7 @@ class build_options:
3396 + self.env_cxxflags = ""
3397 + self.env_cflags = ""
3398 + self.env_cppflags = ""
3399 ++ self.env_ldflags = ""
3400 + flg = os.environ.get("CXXFLAGS")
3401 + if flg is not None:
3402 + self.env_cxxflags = flg
3403 +@@ -1812,6 +1813,9 @@ class build_options:
3404 + flg = os.environ.get("CPPFLAGS")
3405 + if flg is not None:
3406 + self.env_cppflags = flg
3407 ++ flg = os.environ.get("LDFLAGS")
3408 ++ if flg is not None:
3409 ++ self.env_ldflags = flg
3410 +
3411 + def report(self, f=None):
3412 + if (f is None): f = sys.stdout
3413 +@@ -1843,6 +1847,7 @@ class build_options:
3414 + print >>f, " CXXFLAGS = ", self.env_cxxflags
3415 + print >>f, " CFLAGS = ", self.env_cflags
3416 + print >>f, " CPPFLAGS = ", self.env_cppflags
3417 ++ print >>f, " LDFLAGS = ", self.env_ldflags
3418 +
3419 + class include_registry:
3420 +
3421 +@@ -2000,7 +2005,7 @@ class pre_process_args:
3422 + action="store_true",
3423 + default=False,
3424 + help="add compiler flags from environment variables: CXXFLAGS, CFLAGS,"
3425 +- " CPPFLAGS")
3426 ++ " CPPFLAGS, LDFLAGS")
3427 + parser.option(None, "--force_32bit",
3428 + action="store_true",
3429 + default=False,
3430
3431 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch b/sci-libs/cctbx/files/2012.05.08.2305/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch
3432 new file mode 100644
3433 index 0000000..c3e357e
3434 --- /dev/null
3435 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch
3436 @@ -0,0 +1,21 @@
3437 +From: Radostan Riedel <raybuntu@××××××××××.com>
3438 +Date: Wed, 25 Jul 2012 01:44:36 +0200
3439 +Subject: Fix to append CPPFLAGS to CXXFLAGS.
3440 +
3441 +---
3442 + cctbx_sources/libtbx/SConscript | 2 ++
3443 + 1 file changed, 2 insertions(+)
3444 +
3445 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
3446 +index 7d51d4a..11a7810 100644
3447 +--- a/cctbx_sources/libtbx/SConscript
3448 ++++ b/cctbx_sources/libtbx/SConscript
3449 +@@ -798,6 +798,8 @@ else:
3450 + env_etc.ccflags_base = flg
3451 + flg = opts.env_cppflags.split(" ")
3452 + env_etc.ccflags_base.extend(flg)
3453 ++ # Need to append CPPFLAGS to cxxflags_base too!
3454 ++ env_etc.cxxflags_base.extend(flg)
3455 +
3456 + """ ************************ Custom Builders and Emitters ********************************* """
3457 +
3458
3459 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0016-autogenerate-pkgconfig-files.patch b/sci-libs/cctbx/files/2012.05.08.2305/0016-autogenerate-pkgconfig-files.patch
3460 new file mode 100644
3461 index 0000000..5646197
3462 --- /dev/null
3463 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0016-autogenerate-pkgconfig-files.patch
3464 @@ -0,0 +1,305 @@
3465 +From: Radostan Riedel <raybuntu@××××××××××.com>
3466 +Date: Mon, 6 Aug 2012 13:50:30 +0200
3467 +Subject: autogenerate pkgconfig files
3468 +
3469 +---
3470 + cctbx_sources/cctbx/SConscript | 7 ++--
3471 + .../cctbx/sgtbx/direct_space_asu/proto/SConscript | 5 ++-
3472 + cctbx_sources/iotbx/mtz/SConscript | 6 +++-
3473 + cctbx_sources/iotbx/pdb/SConscript | 5 ++-
3474 + cctbx_sources/libtbx/SConscript | 37 +++++++++++++++++++-
3475 + cctbx_sources/mmtbx/masks/SConscript | 5 ++-
3476 + cctbx_sources/omptbx/SConscript | 5 ++-
3477 + cctbx_sources/rstbx/SConscript | 5 ++-
3478 + cctbx_sources/scitbx/boost_python/SConscript | 5 ++-
3479 + cctbx_sources/scitbx/minpack/SConscript | 5 ++-
3480 + cctbx_sources/scitbx/slatec/SConscript | 5 ++-
3481 + .../smtbx/refinement/constraints/SConscript | 5 ++-
3482 + cctbx_sources/spotfinder/SConscript | 5 ++-
3483 + 13 files changed, 86 insertions(+), 14 deletions(-)
3484 +
3485 +diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
3486 +index 6ce770c..378cb36 100644
3487 +--- a/cctbx_sources/cctbx/SConscript
3488 ++++ b/cctbx_sources/cctbx/SConscript
3489 +@@ -96,9 +96,12 @@ lib_cctbx_sources = [
3490 + ]
3491 + if (env_etc.static_libraries): builder = envlm.StaticLibrary
3492 + else: builder = envlm.SharedLibrary
3493 ++name='cctbx'
3494 + builder(
3495 +- target="#lib/cctbx",
3496 +- source=lib_cctbx_sources)
3497 ++ target="#lib/"+name,
3498 ++ source=lib_cctbx_sources)
3499 ++desc='Library for general crystallographic applications'
3500 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3501 +
3502 + SConscript("examples/SConscript")
3503 +
3504 +diff --git a/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript b/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
3505 +index 5a5cfbd..4328794 100644
3506 +--- a/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
3507 ++++ b/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
3508 +@@ -16,9 +16,12 @@ lib_asu_sources = [
3509 + if (env_etc.static_libraries): builder = env.StaticLibrary
3510 + else: builder = env.SharedLibrary
3511 +
3512 ++name='cctbx_sgtbx_asu'
3513 + builder(
3514 +- target="#lib/cctbx_sgtbx_asu",
3515 ++ target="#lib/"+name,
3516 + source=lib_asu_sources)
3517 ++desc='Direct space asymmetric unit class library'
3518 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3519 +
3520 + env = env.Clone()
3521 + env.Prepend(LIBS=["cctbx_sgtbx_asu"])
3522 +diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
3523 +index cd539e6..f7d22b8 100644
3524 +--- a/cctbx_sources/iotbx/mtz/SConscript
3525 ++++ b/cctbx_sources/iotbx/mtz/SConscript
3526 +@@ -9,13 +9,17 @@ env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
3527 + env_etc.enable_more_warnings(env=env)
3528 + if (env_etc.static_libraries): builder = env.StaticLibrary
3529 + else: builder = env.SharedLibrary
3530 ++name='iotbx_mtz'
3531 + builder(
3532 +- target="#lib/iotbx_mtz",
3533 ++ target="#lib/"+name,
3534 + source=[
3535 + "object.cpp",
3536 + "crystal.cpp",
3537 + "dataset.cpp",
3538 + "column.cpp"])
3539 ++desc='Wrapper Library to work with CCP4 MTZ files'
3540 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3541 ++
3542 +
3543 + if (not env_etc.no_boost_python):
3544 + Import("env_iotbx_boost_python_ext")
3545 +diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
3546 +index 9b89fe1..8a83058 100644
3547 +--- a/cctbx_sources/iotbx/pdb/SConscript
3548 ++++ b/cctbx_sources/iotbx/pdb/SConscript
3549 +@@ -9,8 +9,9 @@ env_etc.include_registry.append(
3550 + paths=env_etc.iotbx_common_includes)
3551 + if (env_etc.static_libraries): builder = env.StaticLibrary
3552 + else: builder = env.SharedLibrary
3553 ++name='iotbx_pdb'
3554 + builder(
3555 +- target="#lib/iotbx_pdb",
3556 ++ target="#lib/"+name,
3557 + source=[
3558 + "hybrid_36_c.c",
3559 + "hybrid_36_cpp.cpp",
3560 +@@ -25,6 +26,8 @@ builder(
3561 + "atom_selection.cpp",
3562 + "input.cpp",
3563 + "input_write.cpp"])
3564 ++desc='Fast comprehensive PDB handling library'
3565 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3566 +
3567 + env = env.Clone()
3568 + env_etc.include_registry.append(env=env, paths=[env_etc.fable_include])
3569 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
3570 +index 11a7810..1e91202 100644
3571 +--- a/cctbx_sources/libtbx/SConscript
3572 ++++ b/cctbx_sources/libtbx/SConscript
3573 +@@ -1070,8 +1070,34 @@ env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
3574 + env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
3575 + env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
3576 + env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
3577 ++env_etc.pkgpath = os.path.join(env_etc.install_path, 'lib/pkgconfig')
3578 + env_etc.rpath = os.path.abspath(env_etc.prefix + '/' + env_etc.libdir)
3579 +
3580 ++def create_pc_file(name, version, desc, requires=None, requires_private=None,
3581 ++ conflicts=None, libs_private=None):
3582 ++ """ Create pkg-config file. """
3583 ++ fpath = '%s/%s.pc'%(abs(libtbx.env.lib_path), name)
3584 ++ pc = open(fpath, 'w')
3585 ++ pc.write('prefix=%s\n'%env_etc.prefix)
3586 ++ pc.write('exec_prefix=${PREFIX}\n')
3587 ++ pc.write('libdir=${PREFIX}/%s\n'%env_etc.libdir)
3588 ++ pc.write('includedir=${PREFIX}/include\n\n')
3589 ++ pc.write('Name: %s\n'%name)
3590 ++ pc.write('Description: %s\n'%desc)
3591 ++ pc.write('Version: %s\n'%version)
3592 ++ if requires != None:
3593 ++ pc.write('Requires: %s\n'%requires)
3594 ++ if requires_private != None:
3595 ++ pc.write('Requires.private: %s\n'%requires_private)
3596 ++ if conflicts != None:
3597 ++ pc.write('Conflicts: %s\n'%conflicts)
3598 ++ pc.write('Libs: -L${libdir} -l%s\n'%name)
3599 ++ if libs_private != None:
3600 ++ pc.write('Libs.private: %s\n'%libs_private)
3601 ++ pc.write('Cflags: -I${includedir}')
3602 ++ pc.close()
3603 ++env_etc.create_pc_file = create_pc_file
3604 ++
3605 + def set_libtool(env):
3606 + # Versioning can be provided by appending "-version-info 3:12:1" to SHLINKFLAGS
3607 + # Please see:
3608 +@@ -1197,6 +1223,11 @@ def create_install_targets():
3609 + src = os.path.join(src_dir, root, filename)
3610 + env_base.Install(dest, src)
3611 + env_base.Alias("install-header", dest)
3612 ++ if re.match('^.*\.pc$', filename, flags=re.IGNORECASE):
3613 ++ dest = os.path.join(env_etc.pkgpath, root)
3614 ++ src = os.path.join(src_dir, root, filename)
3615 ++ env_base.Install(dest, src)
3616 ++ env_base.Alias("install-pkgconfig", dest)
3617 + if src_dir == lib_dir:
3618 + break
3619 +
3620 +@@ -1204,7 +1235,11 @@ def create_install_targets():
3621 + dest = env_etc.binpath
3622 + env_base.Install(dest, Glob('%s/*'%(exe_dev)))
3623 + env_base.Alias("install-bin", dest)
3624 +- Alias('install', ['install-header', 'install-shlib', 'install-bin'])
3625 ++ Alias('install', ['install-header',
3626 ++ 'install-shlib',
3627 ++ 'install-bin',
3628 ++ 'install-pkgconfig',
3629 ++ ])
3630 + os.chdir(cwd)
3631 +
3632 + if 'install' in COMMAND_LINE_TARGETS:
3633 +diff --git a/cctbx_sources/mmtbx/masks/SConscript b/cctbx_sources/mmtbx/masks/SConscript
3634 +index ef93088..a6187cc 100644
3635 +--- a/cctbx_sources/mmtbx/masks/SConscript
3636 ++++ b/cctbx_sources/mmtbx/masks/SConscript
3637 +@@ -13,9 +13,12 @@ lib_sources = [
3638 + if (env_etc.static_libraries): builder = env.StaticLibrary
3639 + else: builder = env.SharedLibrary
3640 +
3641 ++name='mmtbx_masks'
3642 + builder(
3643 +- target="#lib/mmtbx_masks",
3644 ++ target="#lib/"+name,
3645 + source=lib_sources)
3646 ++desc='Masks for bulk solvent modelling'
3647 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3648 +
3649 + env = env.Clone()
3650 + env.Prepend(LIBS=["mmtbx_masks", "iotbx_pdb"])
3651 +diff --git a/cctbx_sources/omptbx/SConscript b/cctbx_sources/omptbx/SConscript
3652 +index 43aac91..76bb923 100644
3653 +--- a/cctbx_sources/omptbx/SConscript
3654 ++++ b/cctbx_sources/omptbx/SConscript
3655 +@@ -12,9 +12,12 @@ env_etc.include_registry.append(
3656 + paths=[env_etc.omptbx_include])
3657 + if (env_etc.static_libraries): builder = env.StaticLibrary
3658 + else: builder = env.SharedLibrary
3659 ++name='omptbx'
3660 + builder(
3661 +- target="#lib/omptbx",
3662 ++ target="#lib/"+name,
3663 + source=["stubs.cpp"])
3664 ++desc='OpenMP interface for CCTBX'
3665 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3666 +
3667 + if (not env_etc.no_boost_python):
3668 + Import("env_boost_python_ext")
3669 +diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
3670 +index e2958a1..6d66476 100644
3671 +--- a/cctbx_sources/rstbx/SConscript
3672 ++++ b/cctbx_sources/rstbx/SConscript
3673 +@@ -26,14 +26,17 @@ env_etc.include_registry.append(
3674 + paths=env_etc.rstbx_common_includes)
3675 + if (env_etc.static_libraries): builder = env.StaticLibrary
3676 + else: builder = env.SharedLibrary
3677 ++name='rstbx'
3678 + builder(
3679 +- target="#lib/rstbx",
3680 ++ target="#lib/"+name,
3681 + source=["dps_core/dps_core.cpp",
3682 + "dps_core/directional_fft.cpp",
3683 + "dps_core/direction.cpp",
3684 + "diffraction/ewald_sphere.cpp",
3685 + "diffraction/partial_spot_position_partial_H.cpp"
3686 + ])
3687 ++desc='Library for calculations in reciprocal space'
3688 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3689 +
3690 + if (not env_etc.no_boost_python):
3691 + Import("env_boost_python_ext")
3692 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
3693 +index b906eb3..0b81d9a 100644
3694 +--- a/cctbx_sources/scitbx/boost_python/SConscript
3695 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
3696 +@@ -19,6 +19,9 @@ lib_scitbx_boost_python_sources = [
3697 + ]
3698 + if (env_etc.static_libraries): builder = env.StaticLibrary
3699 + else: builder = env.SharedLibrary
3700 ++name=env_etc.scitbx_boost_python
3701 + builder(
3702 +- target="#lib/%s"%env_etc.scitbx_boost_python,
3703 ++ target="#lib/"+name,
3704 + source=lib_scitbx_boost_python_sources)
3705 ++desc='#TODO'
3706 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3707 +diff --git a/cctbx_sources/scitbx/minpack/SConscript b/cctbx_sources/scitbx/minpack/SConscript
3708 +index 7c325cb..ee7509e 100644
3709 +--- a/cctbx_sources/scitbx/minpack/SConscript
3710 ++++ b/cctbx_sources/scitbx/minpack/SConscript
3711 +@@ -9,7 +9,10 @@ env_etc.include_registry.append(
3712 + env.Append(LIBS=env_etc.libm)
3713 + if (env_etc.static_libraries): builder = env.StaticLibrary
3714 + else: builder = env.SharedLibrary
3715 +-builder(target='#lib/scitbx_minpack', source=["raw.cpp"])
3716 ++name='scitbx_minpack'
3717 ++builder(target='#lib/'+name, source=["raw.cpp"])
3718 ++desc='C++ port of files in MINPACK'
3719 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3720 +
3721 + if (not env_etc.no_boost_python):
3722 + Import("env_scitbx_boost_python_ext")
3723 +diff --git a/cctbx_sources/scitbx/slatec/SConscript b/cctbx_sources/scitbx/slatec/SConscript
3724 +index ca9b6da..39e38e1 100644
3725 +--- a/cctbx_sources/scitbx/slatec/SConscript
3726 ++++ b/cctbx_sources/scitbx/slatec/SConscript
3727 +@@ -6,4 +6,7 @@ env_etc.enable_more_warnings(env=env)
3728 + env.Append(LIBS=env_etc.libm)
3729 + if (env_etc.static_libraries): builder = env.StaticLibrary
3730 + else: builder = env.SharedLibrary
3731 +-builder(target='#lib/scitbx_slatec', source=["lib_c.c"])
3732 ++name='scitbx_slatec'
3733 ++builder(target='#lib/'+name, source=["lib_c.c"])
3734 ++desc='C port of files in SLATEC'
3735 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3736 +diff --git a/cctbx_sources/smtbx/refinement/constraints/SConscript b/cctbx_sources/smtbx/refinement/constraints/SConscript
3737 +index 67d99dc..306d1a4 100644
3738 +--- a/cctbx_sources/smtbx/refinement/constraints/SConscript
3739 ++++ b/cctbx_sources/smtbx/refinement/constraints/SConscript
3740 +@@ -4,7 +4,10 @@ env_etc.include_registry.append(env=env,
3741 + paths=["."] + env_etc.smtbx_common_includes)
3742 + if (env_etc.static_libraries): builder = env.StaticLibrary
3743 + else: builder = env.SharedLibrary
3744 +-builder(target="#lib/smtbx_refinement_constraints", source=Glob("*.cpp"))
3745 ++name='smtbx_refinement_constraints'
3746 ++builder(target="#lib/"+name, source=Glob("*.cpp"))
3747 ++desc='Library for small molecule crystallography constraints'
3748 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3749 +
3750 + env_program = env.Clone()
3751 + env_program.Prepend(LIBS=[ "cctbx", "smtbx_refinement_constraints" ])
3752 +diff --git a/cctbx_sources/spotfinder/SConscript b/cctbx_sources/spotfinder/SConscript
3753 +index 1d73677..a63c6d9 100644
3754 +--- a/cctbx_sources/spotfinder/SConscript
3755 ++++ b/cctbx_sources/spotfinder/SConscript
3756 +@@ -46,9 +46,12 @@ lib_spotfinder_sources = [
3757 +
3758 + if (env_etc.static_libraries): builder = envlm.StaticLibrary
3759 + else: builder = envlm.SharedLibrary
3760 ++name='spotfinder'
3761 + builder(
3762 +- target="#lib/spotfinder",
3763 ++ target="#lib/"+name,
3764 + source=lib_spotfinder_sources)
3765 ++desc='Library for locating Bragg-Spots on x-ray diffraction images'
3766 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
3767 +
3768 + if (not env_etc.no_boost_python):
3769 + Import("env_no_includes_boost_python_ext")
3770
3771 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0017-Fix-to-use-systems-include-path.patch b/sci-libs/cctbx/files/2012.05.08.2305/0017-Fix-to-use-systems-include-path.patch
3772 new file mode 100644
3773 index 0000000..4affc54
3774 --- /dev/null
3775 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0017-Fix-to-use-systems-include-path.patch
3776 @@ -0,0 +1,128 @@
3777 +From: Radostan Riedel <raybuntu@××××××××××.com>
3778 +Date: Tue, 7 Aug 2012 18:15:43 +0200
3779 +Subject: Fix to use systems include path
3780 +
3781 +---
3782 + .../cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h | 4 ++--
3783 + .../cbflib_adaptbx/detectors/boost_python/general_cbf_write.h | 4 ++--
3784 + cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h | 4 ++--
3785 + .../cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp | 6 +++---
3786 + cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp | 4 ++--
3787 + cctbx_sources/ccp4io_adaptbx/ext.cpp | 2 +-
3788 + cctbx_sources/iotbx/mtz/ext.cpp | 2 +-
3789 + cctbx_sources/iotbx/mtz/object.h | 6 +++---
3790 + 8 files changed, 16 insertions(+), 16 deletions(-)
3791 +
3792 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
3793 +index 66677bd..516b319 100644
3794 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
3795 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
3796 +@@ -3,8 +3,8 @@
3797 + #include <cbflib_adaptbx/detectors/cbf_adaptor.h>
3798 + #include <cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h>
3799 + #include <cbflib_adaptbx/detectors/buffer_based_service.h>
3800 +-#include <include/cbf_binary.h>
3801 +-#include <include/cbf_compress.h>
3802 ++#include <cbf/cbf_binary.h>
3803 ++#include <cbf/cbf_compress.h>
3804 +
3805 + namespace iotbx {
3806 + namespace detectors {
3807 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
3808 +index c6c1afb..f45b4d1 100644
3809 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
3810 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
3811 +@@ -1,8 +1,8 @@
3812 + #ifndef GENERAL_CBF_WRITE_H
3813 + #define GENERAL_CBF_WRITE_H
3814 + #include <cbflib_adaptbx/detectors/cbf_adaptor.h>
3815 +-#include "cbf_binary.h"
3816 +-#include "cbf_compress.h"
3817 ++#include "cbf/cbf_binary.h"
3818 ++#include "cbf/cbf_compress.h"
3819 +
3820 + namespace iotbx {
3821 + namespace detectors {
3822 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h b/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
3823 +index b5cc407..3787c7b 100644
3824 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
3825 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
3826 +@@ -8,8 +8,8 @@
3827 + #include <exception>
3828 + #include <scitbx/array_family/flex_types.h>
3829 + #include <scitbx/array_family/versa_matrix.h>
3830 +-#include <include/cbf.h>
3831 +-#include <include/cbf_simple.h>
3832 ++#include <cbf/cbf.h>
3833 ++#include <cbf/cbf_simple.h>
3834 + #include <cbflib_adaptbx/detectors/basic.h>
3835 +
3836 + #undef cbf_failnez
3837 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
3838 +index 2edbfb5..526556f 100644
3839 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
3840 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
3841 +@@ -244,9 +244,9 @@ extern "C" {
3842 + #include <limits.h>
3843 + #include <ctype.h>
3844 +
3845 +-#include "cbf.h"
3846 +-#include "cbf_file.h"
3847 +-#include "cbf_byte_offset.h"
3848 ++#include "cbf/cbf.h"
3849 ++#include "cbf/cbf_file.h"
3850 ++#include "cbf/cbf_byte_offset.h"
3851 + #include <cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h>
3852 +
3853 + /* Changes made in the byte-offset algorithm
3854 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp b/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
3855 +index 5f5d9b1..d121530 100644
3856 +--- a/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
3857 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
3858 +@@ -1,5 +1,5 @@
3859 +-#include <include/cbf.h>
3860 +-#include <include/cbf_simple.h>
3861 ++#include <cbf/cbf.h>
3862 ++#include <cbf/cbf_simple.h>
3863 + #include <cstdio>
3864 + #include <string>
3865 + #include <exception>
3866 +diff --git a/cctbx_sources/ccp4io_adaptbx/ext.cpp b/cctbx_sources/ccp4io_adaptbx/ext.cpp
3867 +index ce21568..e507515 100644
3868 +--- a/cctbx_sources/ccp4io_adaptbx/ext.cpp
3869 ++++ b/cctbx_sources/ccp4io_adaptbx/ext.cpp
3870 +@@ -1,5 +1,5 @@
3871 + #include <boost/python.hpp>
3872 +-#include <mmdb_manager.h>
3873 ++#include <mmdb/mmdb_manager.h>
3874 + #include <ssm_align.h>
3875 +
3876 + namespace ccp4io_adaptbx { namespace boost_python {
3877 +diff --git a/cctbx_sources/iotbx/mtz/ext.cpp b/cctbx_sources/iotbx/mtz/ext.cpp
3878 +index b1a0db7..6aa416a 100644
3879 +--- a/cctbx_sources/iotbx/mtz/ext.cpp
3880 ++++ b/cctbx_sources/iotbx/mtz/ext.cpp
3881 +@@ -1,5 +1,5 @@
3882 + #include <boost/python/module.hpp>
3883 +-#include <ccp4_errno.h>
3884 ++#include <ccp4/ccp4_errno.h>
3885 +
3886 + namespace iotbx { namespace mtz { namespace boost_python {
3887 +
3888 +diff --git a/cctbx_sources/iotbx/mtz/object.h b/cctbx_sources/iotbx/mtz/object.h
3889 +index da35fcf..b593534 100644
3890 +--- a/cctbx_sources/iotbx/mtz/object.h
3891 ++++ b/cctbx_sources/iotbx/mtz/object.h
3892 +@@ -6,9 +6,9 @@
3893 + # include <math.h>
3894 + #endif
3895 +
3896 +-#include <cmtzlib.h>
3897 +-#include <ccp4_array.h>
3898 +-#include <ccp4_errno.h>
3899 ++#include <ccp4/cmtzlib.h>
3900 ++#include <ccp4/ccp4_array.h>
3901 ++#include <ccp4/ccp4_errno.h>
3902 + #include <cctbx/sgtbx/space_group.h>
3903 + #include <cctbx/hendrickson_lattman.h>
3904 + #include <boost/shared_ptr.hpp>
3905
3906 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0018-Fix-to-skip-build-of-clipper-examples.patch b/sci-libs/cctbx/files/2012.05.08.2305/0018-Fix-to-skip-build-of-clipper-examples.patch
3907 new file mode 100644
3908 index 0000000..ffd4ebb
3909 --- /dev/null
3910 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0018-Fix-to-skip-build-of-clipper-examples.patch
3911 @@ -0,0 +1,52 @@
3912 +From: Radostan Riedel <raybuntu@××××××××××.com>
3913 +Date: Tue, 7 Aug 2012 18:19:02 +0200
3914 +Subject: Fix to skip build of clipper examples
3915 +
3916 +---
3917 + cctbx_sources/clipper_adaptbx/SConscript | 33 +++++++++++++++---------------
3918 + 1 file changed, 17 insertions(+), 16 deletions(-)
3919 +
3920 +diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
3921 +index c39047f..b0699ad 100644
3922 +--- a/cctbx_sources/clipper_adaptbx/SConscript
3923 ++++ b/cctbx_sources/clipper_adaptbx/SConscript
3924 +@@ -61,22 +61,23 @@ else:
3925 + env_exe = env.Clone()
3926 + env_exe.Prepend(LIBS=[env_etc.clipper_libs[0]])
3927 +
3928 +-exe = env_exe.Program(
3929 +- target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
3930 +- +env["PROGSUFFIX"],
3931 +- source = ["../clipper/examples/symtest.cpp",
3932 +- ])
3933 +-libtbx.env.write_dispatcher_in_bin(
3934 +- source_file=exe[0].get_abspath(),
3935 +- target_file="clipper.symtest")
3936 +-exe = env_exe.Program(
3937 +- target='#exe_dev/'+env["PROGPREFIX"]+'clipper.sanity_check'
3938 +- +env["PROGSUFFIX"],
3939 +- source = ["sanity_check.cpp",
3940 +- ])
3941 +-libtbx.env.write_dispatcher_in_bin(
3942 +- source_file=exe[0].get_abspath(),
3943 +- target_file="clipper.sanity_check")
3944 ++# Skip building clipper examples in Debian
3945 ++#exe = env_exe.Program(
3946 ++# target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
3947 ++# +env["PROGSUFFIX"],
3948 ++# source = ["../clipper/examples/symtest.cpp",
3949 ++# ])
3950 ++#libtbx.env.write_dispatcher_in_bin(
3951 ++# source_file=exe[0].get_abspath(),
3952 ++# target_file="clipper.symtest")
3953 ++#exe = env_exe.Program(
3954 ++# target='#exe_dev/'+env["PROGPREFIX"]+'clipper.sanity_check'
3955 ++# +env["PROGSUFFIX"],
3956 ++# source = ["sanity_check.cpp",
3957 ++# ])
3958 ++#libtbx.env.write_dispatcher_in_bin(
3959 ++# source_file=exe[0].get_abspath(),
3960 ++# target_file="clipper.sanity_check")
3961 +
3962 + if (hasattr(env_etc, "cctbx_include")):
3963 + if (not env_etc.no_boost_python):
3964
3965 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0101-system-cbf.patch b/sci-libs/cctbx/files/2012.05.08.2305/0101-system-cbf.patch
3966 new file mode 100644
3967 index 0000000..1688026
3968 --- /dev/null
3969 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0101-system-cbf.patch
3970 @@ -0,0 +1,16 @@
3971 + cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h | 2 +-
3972 + 1 file changed, 1 insertion(+), 1 deletion(-)
3973 +
3974 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
3975 +index 0089325..02234d1 100644
3976 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
3977 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
3978 +@@ -5,7 +5,7 @@
3979 + extern "C" {
3980 + #endif
3981 + #include <stdio.h>
3982 +-#include <include/cbf_file.h>
3983 ++#include <cbf/cbf_file.h>
3984 +
3985 + /* Decompress an array with the byte-offset algorithm */
3986 +
3987
3988 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0101-system-clipper.patch b/sci-libs/cctbx/files/2012.05.08.2305/0101-system-clipper.patch
3989 new file mode 100644
3990 index 0000000..6f50e5f
3991 --- /dev/null
3992 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0101-system-clipper.patch
3993 @@ -0,0 +1,185 @@
3994 + cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h | 2 +-
3995 + cctbx_sources/clipper/clipper/contrib/Makefile.dep | 14 +++++++-------
3996 + cctbx_sources/clipper/clipper/contrib/edcalc.cpp | 2 +-
3997 + cctbx_sources/clipper/clipper/contrib/fffear.cpp | 2 +-
3998 + .../clipper/clipper/contrib/function_object_bases.h | 6 +++---
3999 + cctbx_sources/clipper/clipper/contrib/sfcalc.cpp | 2 +-
4000 + cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp | 4 ++--
4001 + cctbx_sources/clipper/clipper/contrib/sfweight.cpp | 4 ++--
4002 + cctbx_sources/clipper/clipper/contrib/skeleton.cpp | 2 +-
4003 + cctbx_sources/clipper_adaptbx/clipper/SConscript | 1 -
4004 + 10 files changed, 19 insertions(+), 20 deletions(-)
4005 +
4006 +diff --git a/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h b/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
4007 +index bd9f7d2..079958d 100644
4008 +--- a/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
4009 ++++ b/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
4010 +@@ -47,7 +47,7 @@
4011 + #define CLIPPER_CCTBX
4012 +
4013 +
4014 +-#include "../core/hkl_datatypes.h"
4015 ++#include "clipper/core/hkl_datatypes.h"
4016 +
4017 + #include <cctbx/sgtbx/space_group.h>
4018 + #include <cctbx/hendrickson_lattman.h>
4019 +diff --git a/cctbx_sources/clipper/clipper/contrib/Makefile.dep b/cctbx_sources/clipper/clipper/contrib/Makefile.dep
4020 +index 98251b1..0fe7bb3 100644
4021 +--- a/cctbx_sources/clipper/clipper/contrib/Makefile.dep
4022 ++++ b/cctbx_sources/clipper/clipper/contrib/Makefile.dep
4023 +@@ -1,27 +1,27 @@
4024 +
4025 +-function_object_bases.h: ../core/hkl_datatypes.h ../core/xmap.h ../core/nxmap_operator.h
4026 ++function_object_bases.h: clipper/core/hkl_datatypes.h clipper/core/xmap.h clipper/core/nxmap_operator.h
4027 +
4028 + function_object_bases.o: function_object_bases.cpp function_object_bases.h
4029 +
4030 + sfcalc.h: function_object_bases.h
4031 +
4032 +-sfcalc.o: sfcalc.cpp sfcalc.h ../core/atomsf.h
4033 ++sfcalc.o: sfcalc.cpp sfcalc.h clipper/core/atomsf.h
4034 +
4035 + edcalc.h: function_object_bases.h
4036 +
4037 +-edcalc.o: edcalc.cpp edcalc.h ../core/atomsf.h
4038 ++edcalc.o: edcalc.cpp edcalc.h clipper/core/atomsf.h
4039 +
4040 + sfcalc_obs.h: function_object_bases.h
4041 +
4042 +-sfcalc_obs.o: sfcalc_obs.cpp sfcalc_obs.h edcalc.h ../core/hkl_compute.h ../core/resol_targetfn.h
4043 ++sfcalc_obs.o: sfcalc_obs.cpp sfcalc_obs.h edcalc.h clipper/core/hkl_compute.h clipper/core/resol_targetfn.h
4044 +
4045 + sfweight.h: function_object_bases.h
4046 +
4047 +-sfweight.o: sfweight.cpp sfweight.h ../core/hkl_operators.h ../core/resol_targetfn.h
4048 ++sfweight.o: sfweight.cpp sfweight.h clipper/core/hkl_operators.h clipper/core/resol_targetfn.h
4049 +
4050 + fffear.h: function_object_bases.h
4051 +
4052 +-fffear.o: fffear.cpp fffear.h ../core/map_interp.h
4053 ++fffear.o: fffear.cpp fffear.h clipper/core/map_interp.h
4054 +
4055 + mapfilter.h: function_object_bases.h
4056 +
4057 +@@ -29,7 +29,7 @@ mapfilter.o: mapfilter.cpp mapfilter.h
4058 +
4059 + skeleton.h: function_object_bases.h
4060 +
4061 +-skeleton.o: skeleton.cpp skeleton.h ../core/map_utils.h
4062 ++skeleton.o: skeleton.cpp skeleton.h clipper/core/map_utils.h
4063 +
4064 + originmatch.h: function_object_bases.h
4065 +
4066 +diff --git a/cctbx_sources/clipper/clipper/contrib/edcalc.cpp b/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
4067 +index f5df7b2..cc031bc 100644
4068 +--- a/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
4069 ++++ b/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
4070 +@@ -43,7 +43,7 @@
4071 +
4072 + #include "edcalc.h"
4073 +
4074 +-#include "../core/atomsf.h"
4075 ++#include "clipper/core/atomsf.h"
4076 +
4077 +
4078 + namespace clipper {
4079 +diff --git a/cctbx_sources/clipper/clipper/contrib/fffear.cpp b/cctbx_sources/clipper/clipper/contrib/fffear.cpp
4080 +index 9a728f7..189855a 100644
4081 +--- a/cctbx_sources/clipper/clipper/contrib/fffear.cpp
4082 ++++ b/cctbx_sources/clipper/clipper/contrib/fffear.cpp
4083 +@@ -42,7 +42,7 @@
4084 +
4085 + #include "fffear.h"
4086 +
4087 +-#include "../core/map_interp.h"
4088 ++#include "clipper/core/map_interp.h"
4089 +
4090 +
4091 + namespace clipper {
4092 +diff --git a/cctbx_sources/clipper/clipper/contrib/function_object_bases.h b/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
4093 +index e6c98c7..4a40c73 100644
4094 +--- a/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
4095 ++++ b/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
4096 +@@ -48,9 +48,9 @@
4097 + #define CLIPPER_FUNCTION_OBJECT_BASES
4098 +
4099 +
4100 +-#include "../core/hkl_datatypes.h"
4101 +-#include "../core/xmap.h"
4102 +-#include "../core/nxmap_operator.h"
4103 ++#include "clipper/core/hkl_datatypes.h"
4104 ++#include "clipper/core/xmap.h"
4105 ++#include "clipper/core/nxmap_operator.h"
4106 +
4107 +
4108 + namespace clipper {
4109 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp b/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
4110 +index 48c0d9c..a3c63f0 100644
4111 +--- a/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
4112 ++++ b/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
4113 +@@ -43,7 +43,7 @@
4114 +
4115 + #include "sfcalc.h"
4116 +
4117 +-#include "../core/atomsf.h"
4118 ++#include "clipper/core/atomsf.h"
4119 +
4120 +
4121 + namespace clipper {
4122 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp b/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
4123 +old mode 100755
4124 +new mode 100644
4125 +index de47e09..0f67585
4126 +--- a/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
4127 ++++ b/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
4128 +@@ -43,8 +43,8 @@
4129 +
4130 + #include "sfcalc_obs.h"
4131 + #include "edcalc.h"
4132 +-#include "../core/hkl_compute.h"
4133 +-#include "../core/resol_targetfn.h"
4134 ++#include "clipper/core/hkl_compute.h"
4135 ++#include "clipper/core/resol_targetfn.h"
4136 +
4137 +
4138 + namespace clipper {
4139 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfweight.cpp b/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
4140 +old mode 100755
4141 +new mode 100644
4142 +index 1b2d4dc..6ec98c2
4143 +--- a/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
4144 ++++ b/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
4145 +@@ -42,8 +42,8 @@
4146 +
4147 +
4148 + #include "sfweight.h"
4149 +-#include "../core/hkl_operators.h"
4150 +-#include "../core/resol_targetfn.h"
4151 ++#include "clipper/core/hkl_operators.h"
4152 ++#include "clipper/core/resol_targetfn.h"
4153 +
4154 +
4155 + namespace clipper {
4156 +diff --git a/cctbx_sources/clipper/clipper/contrib/skeleton.cpp b/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
4157 +index bff1049..14ebf55 100644
4158 +--- a/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
4159 ++++ b/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
4160 +@@ -42,7 +42,7 @@
4161 +
4162 + #include "skeleton.h"
4163 +
4164 +-#include "../core/map_utils.h"
4165 ++#include "clipper/core/map_utils.h"
4166 +
4167 +
4168 + namespace clipper {
4169 +diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
4170 +index 1911eb1..df03808 100644
4171 +--- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
4172 ++++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
4173 +@@ -11,5 +11,4 @@ env.SharedLibrary(
4174 + "clipper_ext.cpp",
4175 + "hendrickson_lattman_bpl.cpp",
4176 + "sigmaa_bpl.cpp",
4177 +- "../../clipper/clipper/contrib/sfweight.cpp",
4178 + "../../clipper/clipper/cctbx/clipper_cctbx.cpp"]+clipper_contrib_files)
4179
4180 diff --git a/sci-libs/cctbx/files/2012.05.08.2305/0102-dontstrip.patch b/sci-libs/cctbx/files/2012.05.08.2305/0102-dontstrip.patch
4181 new file mode 100644
4182 index 0000000..08118f4
4183 --- /dev/null
4184 +++ b/sci-libs/cctbx/files/2012.05.08.2305/0102-dontstrip.patch
4185 @@ -0,0 +1,25 @@
4186 + cctbx_sources/libtbx/SConscript | 4 ++--
4187 + 1 file changed, 2 insertions(+), 2 deletions(-)
4188 +
4189 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
4190 +index debf569..46ab8d8 100644
4191 +--- a/cctbx_sources/libtbx/SConscript
4192 ++++ b/cctbx_sources/libtbx/SConscript
4193 +@@ -471,7 +471,7 @@ libtbx.scons: Warning: compiling with /MDd:
4194 + elif libtbx.env.build_options.debug_symbols:
4195 + lkfl = ["-rdynamic"]
4196 + else:
4197 +- lkfl = ["-s"]
4198 ++ lkfl = []
4199 + env_etc.shlinkflags = ["-shared"]
4200 + if (libtbx.env.build_options.mode == "profile"):
4201 + env_base.Prepend(LINKFLAGS=["-pg"])
4202 +@@ -589,7 +589,7 @@ else:
4203 + lkfl = ["-rdynamic"]
4204 +
4205 + else:
4206 +- lkfl = ["-s"]
4207 ++ lkfl = []
4208 + env_etc.shlinkflags = ["-shared"]
4209 + if (libtbx.env.build_options.mode == "profile"):
4210 + env_base.Prepend(LINKFLAGS=["-pg"])
4211
4212 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0001-remove-hardcoded-libtbx_build-env.patch b/sci-libs/cctbx/files/2013.02.27.0005/0001-remove-hardcoded-libtbx_build-env.patch
4213 new file mode 100644
4214 index 0000000..14d3f09
4215 --- /dev/null
4216 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0001-remove-hardcoded-libtbx_build-env.patch
4217 @@ -0,0 +1,24 @@
4218 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
4219 +Date: Sat, 30 Jun 2012 15:50:22 +0200
4220 +Subject: remove-hardcoded-libtbx_build-env
4221 +
4222 +---
4223 + cctbx_sources/libtbx/env_config.py | 5 ++++-
4224 + 1 file changed, 4 insertions(+), 1 deletion(-)
4225 +
4226 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
4227 +index 9c01e0f..8a62446 100644
4228 +--- a/cctbx_sources/libtbx/env_config.py
4229 ++++ b/cctbx_sources/libtbx/env_config.py
4230 +@@ -2147,7 +2147,10 @@ def cold_start(args):
4231 + env.refresh()
4232 +
4233 + def unpickle():
4234 +- build_path = os.environ["LIBTBX_BUILD"]
4235 ++ if os.environ.has_key("LIBTBX_BUILD"):
4236 ++ build_path = os.environ["LIBTBX_BUILD"]
4237 ++ else:
4238 ++ build_path = "/usr/share/cctbx/python%d.%d"%(sys.version_info[:2])
4239 + set_preferred_sys_prefix_and_sys_executable(build_path=build_path)
4240 + libtbx_env = open(op.join(build_path, "libtbx_env"), "rb")
4241 + env = pickle.load(libtbx_env)
4242
4243 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0002-fix-opengl-header-missing-gltbx.patch b/sci-libs/cctbx/files/2013.02.27.0005/0002-fix-opengl-header-missing-gltbx.patch
4244 new file mode 100644
4245 index 0000000..d3684a5
4246 --- /dev/null
4247 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0002-fix-opengl-header-missing-gltbx.patch
4248 @@ -0,0 +1,51 @@
4249 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
4250 +Date: Sat, 30 Jun 2012 15:51:06 +0200
4251 +Subject: fix-opengl-header-missing-gltbx
4252 +
4253 +---
4254 + cctbx_sources/gltbx/SConscript | 32 ++++++++++++++++----------------
4255 + 1 file changed, 16 insertions(+), 16 deletions(-)
4256 +
4257 +diff --git a/cctbx_sources/gltbx/SConscript b/cctbx_sources/gltbx/SConscript
4258 +index d02e7a5..4b2213d 100644
4259 +--- a/cctbx_sources/gltbx/SConscript
4260 ++++ b/cctbx_sources/gltbx/SConscript
4261 +@@ -45,22 +45,22 @@ if (not env_etc.no_boost_python):
4262 + env=env,
4263 + paths=env_etc.gltbx_common_includes + [env_etc.python_include])
4264 + #
4265 +- env_etc.gltbx_has_usable_opengl = False
4266 +- conf = trial_env.Configure()
4267 +- flag, output = conf.TryRun("""
4268 +-#include <gltbx/include_opengl.h>
4269 +-#include <iostream>
4270 +-int main() { std::cout << GL_POINT << std::endl; return 0; }
4271 +-""", extension=".cpp")
4272 +- conf.Finish()
4273 +- if (flag and len(output.strip()) != 0):
4274 +- conf = env.Configure()
4275 +- if (conf.TryCompile("""
4276 +-#include <gltbx/include_opengl.h>
4277 +-""", extension=".cpp")):
4278 +- env_etc.gltbx_has_usable_opengl = True
4279 +- conf.Finish()
4280 +- #
4281 ++ env_etc.gltbx_has_usable_opengl = True
4282 ++# conf = trial_env.Configure()
4283 ++# flag, output = conf.TryRun("""
4284 ++##include <gltbx/include_opengl.h>
4285 ++##include <iostream>
4286 ++#int main() { std::cout << GL_POINT << std::endl; return 0; }
4287 ++#""", extension=".cpp")
4288 ++# conf.Finish()
4289 ++# if (flag and len(output.strip()) != 0):
4290 ++# conf = env.Configure()
4291 ++# if (conf.TryCompile("""
4292 ++##include <gltbx/include_opengl.h>
4293 ++#""", extension=".cpp")):
4294 ++# env_etc.gltbx_has_usable_opengl = True
4295 ++# conf.Finish()
4296 ++# #
4297 + if (not env_etc.gltbx_has_usable_opengl):
4298 + print "gltbx: OpenGL headers and/or libraries not available."
4299 + print "gltbx: Compilation skipped."
4300
4301 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0003-correct-paths-in-dispatcher-creation.patch b/sci-libs/cctbx/files/2013.02.27.0005/0003-correct-paths-in-dispatcher-creation.patch
4302 new file mode 100644
4303 index 0000000..8d3a3c2
4304 --- /dev/null
4305 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0003-correct-paths-in-dispatcher-creation.patch
4306 @@ -0,0 +1,86 @@
4307 +From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@××××××.org>
4308 +Date: Sat, 30 Jun 2012 16:01:20 +0200
4309 +Subject: correct-paths-in-dispatcher-creation
4310 +
4311 +---
4312 + cctbx_sources/libtbx/env_config.py | 48 +++++++++++++++++++-------------------
4313 + 1 file changed, 24 insertions(+), 24 deletions(-)
4314 +
4315 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
4316 +index 8a62446..c3e1c7d 100644
4317 +--- a/cctbx_sources/libtbx/env_config.py
4318 ++++ b/cctbx_sources/libtbx/env_config.py
4319 +@@ -932,27 +932,27 @@ Wait for the command to finish, then try again.""" % vars())
4320 + print >> f, '# command at the end.'
4321 + print >> f, '#'
4322 + write_do_not_edit(f=f)
4323 +- print >> f, '# To customize this auto-generated script create'
4324 ++ #print >> f, '# To customize this auto-generated script create'
4325 + print >> f, '#'
4326 +- print >> f, '# dispatcher_include*.sh'
4327 ++ #print >> f, '# dispatcher_include*.sh'
4328 + print >> f, '#'
4329 +- print >> f, '# files in %s and run' % show_string(abs(self.build_path))
4330 ++ #print >> f, '# files in %s and run' % show_string(abs(self.build_path))
4331 + print >> f, '#'
4332 +- print >> f, '# libtbx.refresh'
4333 ++ #print >> f, '# libtbx.refresh'
4334 + print >> f, '#'
4335 + print >> f, '# to re-generate the dispatchers (libtbx.refresh is a subset'
4336 + print >> f, '# of the functionality of the libtbx/configure.py command).'
4337 + print >> f, '#'
4338 +- print >> f, '# See also:'
4339 +- print >> f, '# %s' \
4340 +- % show_string(self.under_build("dispatcher_include_template.sh"))
4341 ++ #print >> f, '# See also:'
4342 ++ #print >> f, '# %s' \
4343 ++ # % show_string(self.under_build("dispatcher_include_template.sh"))
4344 + print >> f, '#'
4345 + print >> f, _SHELLREALPATH_CODE
4346 + print >> f, 'unset PYTHONHOME'
4347 + print >> f, 'LC_ALL=C'
4348 + print >> f, 'export LC_ALL'
4349 +- print >> f, 'LIBTBX_BUILD="$(shellrealpath "$0" && cd "$(dirname "$RESULT")/.." && pwd)"'
4350 +- print >> f, 'export LIBTBX_BUILD'
4351 ++ #print >> f, 'LIBTBX_BUILD="$(shellrealpath "$0" && cd "$(dirname "$RESULT")/.." && pwd)"'
4352 ++ #print >> f, 'export LIBTBX_BUILD'
4353 + print >> f, 'LIBTBX_PYEXE_BASENAME="%s"' % self.python_exe.basename()
4354 + print >> f, 'export LIBTBX_PYEXE_BASENAME'
4355 + source_is_py = False
4356 +@@ -969,21 +969,21 @@ Wait for the command to finish, then try again.""" % vars())
4357 + source_is_py = True
4358 + for line in self.dispatcher_include(where="at_start"):
4359 + print >> f, line
4360 +- essentials = [("PYTHONPATH", self.pythonpath)]
4361 +- essentials.append((
4362 +- ld_library_path_var_name(),
4363 +- self.ld_library_path_additions()))
4364 +- essentials.append(("PATH", [self.bin_path]))
4365 +- for n,v in essentials:
4366 +- if (len(v) == 0): continue
4367 +- v = ":".join([p.sh_value() for p in v])
4368 +- print >> f, 'if [ -n "$%s" ]; then' % n
4369 +- print >> f, ' %s="%s:$%s"' % (n, v, n)
4370 +- print >> f, ' export %s' % n
4371 +- print >> f, 'else'
4372 +- print >> f, ' %s="%s"' % (n, v)
4373 +- print >> f, ' export %s' % n
4374 +- print >> f, 'fi'
4375 ++ # essentials = [("PYTHONPATH", self.pythonpath)]
4376 ++ # essentials.append((
4377 ++ # ld_library_path_var_name(),
4378 ++ # self.ld_library_path_additions()))
4379 ++ # essentials.append(("PATH", [self.bin_path]))
4380 ++ # for n,v in essentials:
4381 ++ # if (len(v) == 0): continue
4382 ++ # v = ":".join([p.sh_value() for p in v])
4383 ++ # print >> f, 'if [ -n "$%s" ]; then' % n
4384 ++ # print >> f, ' %s="%s:$%s"' % (n, v, n)
4385 ++ # print >> f, ' export %s' % n
4386 ++ # print >> f, 'else'
4387 ++ # print >> f, ' %s="%s"' % (n, v)
4388 ++ # print >> f, ' export %s' % n
4389 ++ # print >> f, 'fi'
4390 + precall_commands = self.dispatcher_precall_commands()
4391 + if (precall_commands is not None):
4392 + for line in precall_commands:
4393
4394 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0006-options-for-system-libs-installtarget-and-prefix.patch b/sci-libs/cctbx/files/2013.02.27.0005/0006-options-for-system-libs-installtarget-and-prefix.patch
4395 new file mode 100644
4396 index 0000000..861d6bc
4397 --- /dev/null
4398 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0006-options-for-system-libs-installtarget-and-prefix.patch
4399 @@ -0,0 +1,1099 @@
4400 + cctbx_sources/boost_adaptbx/SConscript | 19 +-
4401 + cctbx_sources/cbflib_adaptbx/SConscript | 89 +++---
4402 + .../detectors/boost_python/SConscript | 4 +-
4403 + cctbx_sources/ccp4io_adaptbx/SConscript | 303 +++++++++++----------
4404 + cctbx_sources/cctbx/SConscript | 2 +-
4405 + cctbx_sources/clipper_adaptbx/SConscript | 94 ++++---
4406 + cctbx_sources/clipper_adaptbx/clipper/SConscript | 10 +-
4407 + cctbx_sources/gltbx/SConscript | 20 +-
4408 + cctbx_sources/iotbx/cif/boost_python/SConscript | 13 +-
4409 + cctbx_sources/iotbx/mtz/SConscript | 3 +-
4410 + cctbx_sources/iotbx/pdb/SConscript | 2 +-
4411 + cctbx_sources/libtbx/SConscript | 84 ++++++
4412 + cctbx_sources/libtbx/env_config.py | 34 +++
4413 + cctbx_sources/mmtbx/cablam/SConscript | 2 +-
4414 + cctbx_sources/mmtbx/den/SConscript | 2 +-
4415 + cctbx_sources/mmtbx/geometry_restraints/SConscript | 2 +-
4416 + cctbx_sources/mmtbx/secondary_structure/SConscript | 2 +-
4417 + cctbx_sources/rstbx/SConscript | 2 +-
4418 + cctbx_sources/scitbx/SConscript | 2 +-
4419 + cctbx_sources/scitbx/boost_python/SConscript | 4 +-
4420 + .../smtbx/refinement/boost_python/SConscript | 4 +-
4421 + .../refinement/constraints/boost_python/SConscript | 4 +-
4422 + cctbx_sources/spotfinder/SConscript | 2 +-
4423 + cctbx_sources/xfel/SConscript | 2 +-
4424 + 24 files changed, 443 insertions(+), 262 deletions(-)
4425 +
4426 +diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
4427 +index e4d5994..7f96c04 100644
4428 +--- a/cctbx_sources/boost_adaptbx/SConscript
4429 ++++ b/cctbx_sources/boost_adaptbx/SConscript
4430 +@@ -9,7 +9,13 @@ import sys, os
4431 + op = os.path
4432 + Import("env_base", "env_etc")
4433 + env_etc.boost_dist = libtbx.env.dist_path("boost")
4434 +-env_etc.boost_include = env_etc.boost_dist
4435 ++if not env_etc.check_syslib(env_etc.boost_python, extra_libs=env_etc.py_lib)\
4436 ++ or not env_etc.check_syslib('boost_thread'):
4437 ++ env_etc.boost_include = env_etc.boost_dist
4438 ++else:
4439 ++ # This way the compiler looks in the standard location for includes
4440 ++ # should work on all platforms.
4441 ++ env_etc.boost_include = ''
4442 + env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
4443 + env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
4444 +
4445 +@@ -28,7 +34,7 @@ if (not env_etc.no_boost_python):
4446 + env_no_includes_boost_python_ext = env_base.Clone(
4447 + SHLINKFLAGS=env_etc.shlinkflags_bpl,
4448 + SHLIBPREFIX="",
4449 +- LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
4450 ++ LIBS=[env_etc.boost_python] + env_etc.libs_python + env_etc.libm)
4451 + env_no_includes_boost_python_ext.Append(
4452 + LIBPATH=env_etc.libpath_python)
4453 + env_no_includes_boost_python_ext.Append(
4454 +@@ -215,10 +221,11 @@ object/function_doc_signature.cpp
4455 + bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
4456 + #
4457 + env.Repository(os.path.dirname(env_etc.boost_dist))
4458 +- if (env_etc.static_bpl):
4459 +- env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
4460 +- else:
4461 +- env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
4462 ++ if not env_etc.check_syslib(env_etc.boost_python, extra_libs=env_etc.py_lib):
4463 ++ if (env_etc.static_bpl):
4464 ++ env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
4465 ++ else:
4466 ++ env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
4467 + if (bool(int(ARGUMENTS.get("boost_python_tests", "0")))):
4468 + warn_if_unexpected_md5_hexdigest(
4469 + path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
4470 +diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
4471 +index 4ac6717..334cfc2 100644
4472 +--- a/cctbx_sources/cbflib_adaptbx/SConscript
4473 ++++ b/cctbx_sources/cbflib_adaptbx/SConscript
4474 +@@ -3,9 +3,14 @@ import os
4475 + Import("env_base","env_etc")
4476 +
4477 + env_etc.cbflib_dist = libtbx.env.dist_path("cbflib")
4478 +-env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
4479 +- env_etc.norm_join(env_etc.cbflib_dist,"include"),
4480 +- ]
4481 ++if not env_etc.check_syslib('cbf'):
4482 ++ env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
4483 ++ env_etc.norm_join(env_etc.cbflib_dist,"include"),
4484 ++ ]
4485 ++else:
4486 ++ env_etc.cbflib_include = [env_etc.norm_join(env_etc.cbflib_dist,"examples"),
4487 ++ "",
4488 ++ ]
4489 + env_etc.cbflib_adaptbx_dist = libtbx.env.dist_path("cbflib_adaptbx")
4490 +
4491 + env_etc.cbflib_common_includes = [
4492 +@@ -34,39 +39,47 @@ cbflib_092_forward = []
4493 + if os.path.isfile( os.path.join(env_etc.cbflib_dist,"src","cbf_ws.c") ):
4494 + cbflib_092_forward.append("src/cbf_ws.c")
4495 +
4496 +-env.StaticLibrary(target='#lib/cbf',
4497 +- source = [prefix+"/"+s for s in [
4498 +- "examples/img.c",
4499 +- "src/cbf.c",
4500 +- "src/cbf_alloc.c",
4501 +- "src/cbf_ascii.c",
4502 +- "src/cbf_binary.c",
4503 +- "src/cbf_byte_offset.c",
4504 +- "src/cbf_canonical.c",
4505 +- "src/cbf_codes.c",
4506 +- "src/cbf_compress.c",
4507 +- "src/cbf_context.c",
4508 +- "src/cbf_file.c",
4509 +- "src/cbf_lex.c",
4510 +- "src/cbf_packed.c",
4511 +- "src/cbf_predictor.c",
4512 +- "src/cbf_read_binary.c",
4513 +- "src/cbf_read_mime.c",
4514 +- "src/cbf_simple.c",
4515 +- "src/cbf_string.c",
4516 +- "src/cbf_stx.c",
4517 +- "src/cbf_tree.c",
4518 +- "src/cbf_uncompressed.c",
4519 +- "src/cbf_write.c",
4520 +- "src/cbf_write_binary.c",
4521 +- "src/md5c.c",
4522 +- ] + cbflib_092_forward ] + [
4523 +- "detectors/mar_adaptor.cpp",
4524 +- "detectors/cbf_adaptor.cpp",
4525 +- "detectors/cbf_byte_offset_optimized.cpp",
4526 +- "detectors/buffer_based_service.cpp",
4527 +- ],
4528 +- CPPPATH=env_etc.cbflib_common_includes )
4529 ++cbflib_src = ["src/cbf.c",
4530 ++ "src/cbf_alloc.c",
4531 ++ "src/cbf_ascii.c",
4532 ++ "src/cbf_binary.c",
4533 ++ "src/cbf_byte_offset.c",
4534 ++ "src/cbf_canonical.c",
4535 ++ "src/cbf_codes.c",
4536 ++ "src/cbf_compress.c",
4537 ++ "src/cbf_context.c",
4538 ++ "src/cbf_file.c",
4539 ++ "src/cbf_lex.c",
4540 ++ "src/cbf_packed.c",
4541 ++ "src/cbf_predictor.c",
4542 ++ "src/cbf_read_binary.c",
4543 ++ "src/cbf_read_mime.c",
4544 ++ "src/cbf_simple.c",
4545 ++ "src/cbf_string.c",
4546 ++ "src/cbf_stx.c",
4547 ++ "src/cbf_tree.c",
4548 ++ "src/cbf_uncompressed.c",
4549 ++ "src/cbf_write.c",
4550 ++ "src/cbf_write_binary.c",
4551 ++ "src/md5c.c",
4552 ++ ]
4553 ++adaptor_src = ["detectors/mar_adaptor.cpp",
4554 ++ "detectors/cbf_adaptor.cpp",
4555 ++ "detectors/cbf_byte_offset_optimized.cpp",
4556 ++ "detectors/buffer_based_service.cpp",
4557 ++ ]
4558 ++if not env_etc.check_syslib('cbf'):
4559 ++ env.StaticLibrary(target='#lib/cbf',
4560 ++ source = [prefix+"/"+s for s in [
4561 ++ "examples/img.c"] + cbflib_src + cbflib_092_forward] + adaptor_src,
4562 ++ CPPPATH=env_etc.cbflib_common_includes )
4563 ++ env_etc.cbf_lib = ['cbf',]
4564 ++else:
4565 ++ env.StaticLibrary(target='#lib/cbf_adaptor',
4566 ++ source = [prefix+"/"+s for s in [
4567 ++ "examples/img.c"]] + adaptor_src,
4568 ++ CPPPATH=env_etc.cbflib_common_includes )
4569 ++ env_etc.cbf_lib = ['cbf','cbf_adaptor']
4570 +
4571 + if (not env_etc.no_boost_python):
4572 + Import("env_no_includes_boost_python_ext")
4573 +@@ -80,7 +93,7 @@ if (not env_etc.no_boost_python):
4574 + env_cbflib_boost_python_ext.SharedLibrary(
4575 + target='#lib/_pycbf',
4576 + source=[prefix+"/pycbf/pycbf_wrap.c"],
4577 +- LIBS=["cbf"]+env_etc.libs_python+env_etc.libm)
4578 ++ LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
4579 +
4580 + Export("env_cbflib_boost_python_ext")
4581 +
4582 +@@ -89,7 +102,7 @@ if (not env_etc.no_boost_python):
4583 + env_standalone = env.Clone(
4584 + LIBS = [env_etc.libm,],CPPPATH=env_etc.cbflib_common_includes
4585 + )
4586 +-env_standalone.Prepend(LIBS=["cbf",])
4587 ++env_standalone.Prepend(LIBS=env_etc.cbf_lib)
4588 +
4589 + for source in ["detectors/tst_memory",]:
4590 + target = "cbflib."+os.path.basename(source)
4591 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
4592 +index 2027439..8e987cc 100644
4593 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
4594 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/SConscript
4595 +@@ -1,6 +1,6 @@
4596 +-Import("env_cbflib_boost_python_ext")
4597 ++Import("env_cbflib_boost_python_ext", "env_etc")
4598 + env = env_cbflib_boost_python_ext.Clone()
4599 +-env.Prepend(LIBS=["cbf",])
4600 ++env.Prepend(LIBS=env_etc.cbf_lib)
4601 + env.SharedLibrary(
4602 + target="#lib/cbflib_ext",
4603 + source=["cbflib_ext.cpp",])
4604 +diff --git a/cctbx_sources/ccp4io_adaptbx/SConscript b/cctbx_sources/ccp4io_adaptbx/SConscript
4605 +index 0356403..856115a 100644
4606 +--- a/cctbx_sources/ccp4io_adaptbx/SConscript
4607 ++++ b/cctbx_sources/ccp4io_adaptbx/SConscript
4608 +@@ -43,122 +43,167 @@ else:
4609 + # clean out after completely removing support for
4610 + # old CCP4 directory structure above
4611 +
4612 +-build_ccp4io_adaptbx = libtbx.env.under_build("ccp4io_adaptbx")
4613 +-if (not op.isdir(build_ccp4io_adaptbx)):
4614 +- os.mkdir(build_ccp4io_adaptbx)
4615 +- assert op.isdir(build_ccp4io_adaptbx)
4616 +-
4617 +-def replace_printf(file_name):
4618 +- full_path = op.join(path_lib_src, file_name)
4619 +- if (not op.isfile(full_path)):
4620 +- full_path = op.join(op.dirname(path_lib_src), "fortran", file_name)
4621 +- result = ["#include <ccp4io_adaptbx/printf_wrappers.h>"]
4622 +- for line in open(full_path).read().splitlines():
4623 +- for key in ["printf", "fprintf"]:
4624 +- matches = list(re.finditer(
4625 +- pattern="[^A-Za-z0-9_]%s[^A-Za-z0-9_]" % key, string=line))
4626 +- if (len(matches) != 0):
4627 +- for m in reversed(matches):
4628 +- s,e = m.start(), m.end()
4629 +- line = line[:s] \
4630 +- + line[s:e].replace(key, "ccp4io_%s" % key) \
4631 +- + line[e:]
4632 +- result.append(line)
4633 +- return "\n".join(result)
4634 +-
4635 +-env = env_base.Clone(
4636 +- SHLINKFLAGS=env_etc.shlinkflags)
4637 +-env.Append(CCFLAGS=env_etc.ccp4io_defines)
4638 +-env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
4639 +-env_etc.include_registry.append(
4640 +- env=env,
4641 +- paths=[
4642 +- "#",
4643 +- op.dirname(env_etc.ccp4io_include),
4644 +- env_etc.ccp4io_include,
4645 +- op.join(env_etc.ccp4io_dist, "lib", mmdb_src),
4646 +- op.join(env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb")])
4647 +-env.Append(LIBS=env_etc.libm)
4648 +-# XXX 2012-06-16: is this actually necessary here, or just in code that links to
4649 +-# ccp4io.lib?
4650 +-if (os.name == "nt") :
4651 +- env.Prepend(LIBS=["Advapi32"])
4652 +-if ( op.normcase(op.dirname(env_etc.ccp4io_dist))
4653 +- != op.normcase("ccp4io")):
4654 +- env.Repository(op.dirname(env_etc.ccp4io_dist))
4655 + source = []
4656 +-
4657 + c_files = []
4658 +-c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
4659 +-library_err.c
4660 +-library_file.c
4661 +-library_utils.c
4662 +-ccp4_array.c
4663 +-ccp4_parser.c
4664 +-ccp4_unitcell.c
4665 +-cvecmat.c
4666 +-cmtzlib.c
4667 +-""".splitlines()])
4668 +-open(op.join(build_ccp4io_adaptbx, "csymlib.c"), "w").write(
4669 +- open(op.join(path_lib_src, "csymlib.c")).read()
4670 +- .replace(
4671 +- "static int reported_syminfo = 0",
4672 +- "static int reported_syminfo = 1"))
4673 +-source.append(op.join("#ccp4io_adaptbx", "csymlib.c"))
4674 ++if not env_etc.check_syslib('ccp4c')\
4675 ++ or not env_etc.check_syslib('mmdb'):
4676 ++ build_ccp4io_adaptbx = libtbx.env.under_build("ccp4io_adaptbx")
4677 ++ if (not op.isdir(build_ccp4io_adaptbx)):
4678 ++ os.mkdir(build_ccp4io_adaptbx)
4679 ++ assert op.isdir(build_ccp4io_adaptbx)
4680 ++
4681 ++ def replace_printf(file_name):
4682 ++ full_path = op.join(path_lib_src, file_name)
4683 ++ if (not op.isfile(full_path)):
4684 ++ full_path = op.join(op.dirname(path_lib_src), "fortran", file_name)
4685 ++ result = ["#include <ccp4io_adaptbx/printf_wrappers.h>"]
4686 ++ for line in open(full_path).read().splitlines():
4687 ++ for key in ["printf", "fprintf"]:
4688 ++ matches = list(re.finditer(
4689 ++ pattern="[^A-Za-z0-9_]%s[^A-Za-z0-9_]" % key, string=line))
4690 ++ if (len(matches) != 0):
4691 ++ for m in reversed(matches):
4692 ++ s,e = m.start(), m.end()
4693 ++ line = line[:s] \
4694 ++ + line[s:e].replace(key, "ccp4io_%s" % key) \
4695 ++ + line[e:]
4696 ++ result.append(line)
4697 ++ return "\n".join(result)
4698 ++ env = env_base.Clone(
4699 ++ SHLINKFLAGS=env_etc.shlinkflags)
4700 ++ env.Append(CCFLAGS=env_etc.ccp4io_defines)
4701 ++ env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
4702 ++ env_etc.include_registry.append(
4703 ++ env=env,
4704 ++ paths=[
4705 ++ "#",
4706 ++ op.dirname(env_etc.ccp4io_include),
4707 ++ env_etc.ccp4io_include,
4708 ++ op.join(env_etc.ccp4io_dist, "lib", mmdb_src),
4709 ++ op.join(env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb")])
4710 ++
4711 ++ env.Append(LIBS=env_etc.libm)
4712 ++ # XXX 2012-06-16: is this actually necessary here, or just in code that links to
4713 ++ # ccp4io.lib?
4714 ++ if (os.name == "nt") :
4715 ++ env.Prepend(LIBS=["Advapi32"])
4716 ++ if ( op.normcase(op.dirname(env_etc.ccp4io_dist))
4717 ++ != op.normcase("ccp4io")):
4718 ++ env.Repository(op.dirname(env_etc.ccp4io_dist))
4719 +
4720 +-probe_file_name = op.join(path_lib_src, "cmaplib.h")
4721 +-env_etc.ccp4io_has_cmaplib = op.isfile(probe_file_name)
4722 +-if (env_etc.ccp4io_has_cmaplib):
4723 + c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
4724 +-cmap_accessor.c
4725 +-cmap_close.c
4726 +-cmap_data.c
4727 +-cmap_header.c
4728 +-cmap_labels.c
4729 +-cmap_open.c
4730 +-cmap_skew.c
4731 +-cmap_stats.c
4732 +-cmap_symop.c
4733 +-""".splitlines()])
4734 ++ library_err.c
4735 ++ library_file.c
4736 ++ library_utils.c
4737 ++ ccp4_array.c
4738 ++ ccp4_parser.c
4739 ++ ccp4_unitcell.c
4740 ++ cvecmat.c
4741 ++ cmtzlib.c
4742 ++ """.splitlines()])
4743 ++ open(op.join(build_ccp4io_adaptbx, "csymlib.c"), "w").write(
4744 ++ open(op.join(path_lib_src, "csymlib.c")).read()
4745 ++ .replace(
4746 ++ "static int reported_syminfo = 0",
4747 ++ "static int reported_syminfo = 1"))
4748 ++ source.append(op.join("#ccp4io_adaptbx", "csymlib.c"))
4749 +
4750 +-c_files.extend(["%s/mmdb/%s.cpp" % ( mmdb_src, bn ) for bn in """\
4751 +-bfgs_min
4752 +-file_
4753 +-hybrid_36
4754 +-linalg_
4755 +-machine_
4756 +-math_
4757 +-mattype_
4758 +-mmdb_align
4759 +-mmdb_atom
4760 +-mmdb_bondmngr
4761 +-mmdb_chain
4762 +-mmdb_cifdefs
4763 +-mmdb_coormngr
4764 +-mmdb_cryst
4765 +-mmdb_ficif
4766 +-mmdb_file
4767 +-mmdb_graph
4768 +-mmdb_manager
4769 +-mmdb_mask
4770 +-mmdb_mmcif
4771 +-mmdb_model
4772 +-mmdb_rwbrook
4773 +-mmdb_sbase
4774 +-mmdb_sbase0
4775 +-mmdb_selmngr
4776 +-mmdb_symop
4777 +-mmdb_tables
4778 +-mmdb_title
4779 +-mmdb_uddata
4780 +-mmdb_utils
4781 +-mmdb_xml
4782 +-random_n
4783 +-stream_
4784 +-""".splitlines()])
4785 +-prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib")
4786 +-for file_name in c_files:
4787 +- source.append(op.join(prefix, file_name))
4788 ++ probe_file_name = op.join(path_lib_src, "cmaplib.h")
4789 ++ env_etc.ccp4io_has_cmaplib = op.isfile(probe_file_name)
4790 ++ if (env_etc.ccp4io_has_cmaplib):
4791 ++ c_files.extend(["%s/%s" % (ccp4_src, bn ) for bn in """\
4792 ++ cmap_accessor.c
4793 ++ cmap_close.c
4794 ++ cmap_data.c
4795 ++ cmap_header.c
4796 ++ cmap_labels.c
4797 ++ cmap_open.c
4798 ++ cmap_skew.c
4799 ++ cmap_stats.c
4800 ++ cmap_symop.c
4801 ++ """.splitlines()])
4802 ++
4803 ++ c_files.extend(["%s/mmdb/%s.cpp" % ( mmdb_src, bn ) for bn in """\
4804 ++ bfgs_min
4805 ++ file_
4806 ++ hybrid_36
4807 ++ linalg_
4808 ++ machine_
4809 ++ math_
4810 ++ mattype_
4811 ++ mmdb_align
4812 ++ mmdb_atom
4813 ++ mmdb_bondmngr
4814 ++ mmdb_chain
4815 ++ mmdb_cifdefs
4816 ++ mmdb_coormngr
4817 ++ mmdb_cryst
4818 ++ mmdb_ficif
4819 ++ mmdb_file
4820 ++ mmdb_graph
4821 ++ mmdb_manager
4822 ++ mmdb_mask
4823 ++ mmdb_mmcif
4824 ++ mmdb_model
4825 ++ mmdb_rwbrook
4826 ++ mmdb_sbase
4827 ++ mmdb_sbase0
4828 ++ mmdb_selmngr
4829 ++ mmdb_symop
4830 ++ mmdb_tables
4831 ++ mmdb_title
4832 ++ mmdb_uddata
4833 ++ mmdb_utils
4834 ++ mmdb_xml
4835 ++ random_n
4836 ++ stream_
4837 ++ """.splitlines()])
4838 ++ prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib")
4839 ++ for file_name in c_files:
4840 ++ source.append(op.join(prefix, file_name))
4841 ++
4842 ++ ssm_prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib", "ssm")
4843 ++ ssm_sources = """\
4844 ++ ss_csia.cpp
4845 ++ ss_graph.cpp
4846 ++ ss_vxedge.cpp
4847 ++ ssm_align.cpp
4848 ++ ssm_superpose.cpp
4849 ++ """.splitlines()
4850 ++ source.extend( [ op.join( ssm_prefix, f ) for f in ssm_sources ] )
4851 ++
4852 ++ need_f_c = (
4853 ++ libtbx.env.has_module("solve_resolve")
4854 ++ or libtbx.env.find_in_repositories(relative_path="mosflm_fable"))
4855 ++ if (need_f_c or os.name != "nt"):
4856 ++ source.append(op.join("#ccp4io_adaptbx", "fortran_call_stubs.c"))
4857 ++ for file_name in """\
4858 ++ ccp4_diskio_f.c
4859 ++ ccp4_general.c
4860 ++ ccp4_general_f.c
4861 ++ ccp4_parser_f.c
4862 ++ ccp4_program.c
4863 ++ ccp4_unitcell_f.c
4864 ++ cmaplib_f.c
4865 ++ cmtzlib_f.c
4866 ++ csymlib_f.c
4867 ++ library_f.c
4868 ++ """.splitlines():
4869 ++ open(op.join(build_ccp4io_adaptbx, file_name), "w").write(
4870 ++ replace_printf(file_name=file_name))
4871 ++ source.append(op.join("#ccp4io_adaptbx", file_name))
4872 ++ source.append(op.join("#ccp4io_adaptbx", "printf_wrappers.c"))
4873 ++ env_etc.ccp4io_lib = "ccp4io"
4874 ++ mmdb_path= [ os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src ),
4875 ++ os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb" ),
4876 ++ ]
4877 ++else:
4878 ++ env = env_base.Clone(
4879 ++ SHLINKFLAGS=env_etc.shlinkflags)
4880 ++ env.Append(CCFLAGS=env_etc.ccp4io_defines)
4881 ++ env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
4882 ++ env_etc.ccp4io_lib = ["ccp4io", "mmdb", "ccp4c"]
4883 ++ mmdb_path= []
4884 +
4885 + ssm_prefix = "#"+op.join(op.basename(env_etc.ccp4io_dist), "lib", "ssm")
4886 + ssm_sources = """\
4887 +@@ -170,46 +215,20 @@ ssm_superpose.cpp
4888 + """.splitlines()
4889 + source.extend( [ op.join( ssm_prefix, f ) for f in ssm_sources ] )
4890 +
4891 +-need_f_c = (
4892 +- libtbx.env.has_module("solve_resolve")
4893 +- or libtbx.env.find_in_repositories(relative_path="mosflm_fable"))
4894 +-if (need_f_c or os.name != "nt"):
4895 +- source.append(op.join("#ccp4io_adaptbx", "fortran_call_stubs.c"))
4896 +- for file_name in """\
4897 +-ccp4_diskio_f.c
4898 +-ccp4_general.c
4899 +-ccp4_general_f.c
4900 +-ccp4_parser_f.c
4901 +-ccp4_program.c
4902 +-ccp4_unitcell_f.c
4903 +-cmaplib_f.c
4904 +-cmtzlib_f.c
4905 +-csymlib_f.c
4906 +-library_f.c
4907 +-""".splitlines():
4908 +- open(op.join(build_ccp4io_adaptbx, file_name), "w").write(
4909 +- replace_printf(file_name=file_name))
4910 +- source.append(op.join("#ccp4io_adaptbx", file_name))
4911 +- source.append(op.join("#ccp4io_adaptbx", "printf_wrappers.c"))
4912 +-
4913 + # static library for solve_resolve
4914 + env.StaticLibrary(target='#lib/ccp4io', source=source)
4915 +-env_etc.ccp4io_lib = "ccp4io"
4916 +
4917 + if ( libtbx.env.has_module("boost")
4918 + and not env_etc.no_boost_python):
4919 + Import( "env_no_includes_boost_python_ext" )
4920 + sources = [ "#ccp4io_adaptbx/ext.cpp" ]
4921 + env_ext = env_no_includes_boost_python_ext.Clone()
4922 +- env_ext.Prepend( LIBS = "ccp4io" )
4923 ++ env_ext.Prepend( LIBS = env_etc.ccp4io_lib )
4924 + env_etc.include_registry.append(
4925 + env = env_ext,
4926 +- paths = [
4927 +- os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src ),
4928 +- os.path.join( env_etc.ccp4io_dist, "lib", mmdb_src, "mmdb" ),
4929 +- os.path.join( env_etc.ccp4io_dist, "lib", "ssm"),
4930 +- env_etc.boost_include,
4931 +- env_etc.python_include,
4932 +- ]
4933 ++ paths = mmdb_path + [ os.path.join( env_etc.ccp4io_dist, "lib", "ssm"),
4934 ++ env_etc.boost_include,
4935 ++ env_etc.python_include,
4936 ++ ]
4937 + )
4938 + env_ext.SharedLibrary( target = "#lib/ccp4io_adaptbx_ext", source = sources )
4939 +diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
4940 +index 162f019..1321069 100644
4941 +--- a/cctbx_sources/cctbx/SConscript
4942 ++++ b/cctbx_sources/cctbx/SConscript
4943 +@@ -108,7 +108,7 @@ if (not env_etc.no_boost_python):
4944 + Import("env_no_includes_boost_python_ext")
4945 +
4946 + env_cctbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
4947 +- env_cctbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
4948 ++ env_cctbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
4949 + env_etc.include_registry.append(
4950 + env=env_cctbx_boost_python_ext,
4951 + paths=env_etc.cctbx_common_includes + [env_etc.python_include])
4952 +diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
4953 +index 9cce49e..c39047f 100644
4954 +--- a/cctbx_sources/clipper_adaptbx/SConscript
4955 ++++ b/cctbx_sources/clipper_adaptbx/SConscript
4956 +@@ -3,54 +3,63 @@ Import("env_base", "env_etc")
4957 +
4958 + env_etc.clipper_dist = libtbx.env.dist_path("clipper")
4959 + env_etc.clipper_include = env_etc.clipper_dist
4960 ++# This way the compiler looks in the standard location for includes
4961 ++# should work on all platforms
4962 ++env_etc.clipper_sysinclude = ''
4963 +
4964 + env = env_base.Clone(
4965 + SHLINKFLAGS=env_etc.shlinkflags,
4966 + LIBS=env_etc.libm)
4967 +-env.Prepend(CPPPATH=[env_etc.clipper_include])
4968 +-
4969 +-if (env_etc.static_libraries): builder = env.StaticLibrary
4970 +-else: builder = env.SharedLibrary
4971 +-builder(target='#lib/clipper',
4972 +- source = ["../clipper/clipper/core/"+file_name for file_name in """
4973 +- atomsf.cpp
4974 +- cell.cpp
4975 +- clipper_memory.cpp
4976 +- clipper_message.cpp
4977 +- clipper_stats.cpp
4978 +- clipper_types.cpp
4979 +- clipper_util.cpp
4980 +- container.cpp
4981 +- container_hkl.cpp
4982 +- container_map.cpp
4983 +- container_types.cpp
4984 +- coords.cpp
4985 +- derivs.cpp
4986 +- hkl_compute.cpp
4987 +- hkl_data.cpp
4988 +- hkl_datatypes.cpp
4989 +- hkl_info.cpp
4990 +- hkl_lookup.cpp
4991 +- hkl_operators.cpp
4992 +- map_interp.cpp
4993 +- map_utils.cpp
4994 +- nxmap.cpp
4995 +- nxmap_operator.cpp
4996 +- ramachandran.cpp
4997 +- resol_basisfn.cpp
4998 +- resol_fn.cpp
4999 +- resol_targetfn.cpp
5000 +- rotation.cpp
5001 +- spacegroup.cpp
5002 +- spacegroup_data.cpp
5003 +- symop.cpp
5004 +- xmap.cpp
5005 +-""".split()])
5006 +-# fftmap_sparse.cpp
5007 +-# fftmap.cpp
5008 ++if env_etc.check_syslib('clipper-core') and \
5009 ++ env_etc.check_syslib('clipper-contrib'):
5010 ++ env.Prepend(CPPPATH=[env_etc.clipper_sysinclude])
5011 ++ env_etc.clipper_libs=['clipper-core', 'clipper-contrib']
5012 ++ env_etc.has_clipper_contrib = True
5013 ++else:
5014 ++ env.Prepend(CPPPATH=[env_etc.clipper_include])
5015 ++ env_etc.clipper_libs=['clipper',]
5016 ++ if (env_etc.static_libraries): builder = env.StaticLibrary
5017 ++ else: builder = env.SharedLibrary
5018 ++ builder(target='#lib/'+env_etc.clipper_libs[0],
5019 ++ source = ["../clipper/clipper/core/"+file_name for file_name in """
5020 ++ atomsf.cpp
5021 ++ cell.cpp
5022 ++ clipper_memory.cpp
5023 ++ clipper_message.cpp
5024 ++ clipper_stats.cpp
5025 ++ clipper_types.cpp
5026 ++ clipper_util.cpp
5027 ++ container.cpp
5028 ++ container_hkl.cpp
5029 ++ container_map.cpp
5030 ++ container_types.cpp
5031 ++ coords.cpp
5032 ++ derivs.cpp
5033 ++ hkl_compute.cpp
5034 ++ hkl_data.cpp
5035 ++ hkl_datatypes.cpp
5036 ++ hkl_info.cpp
5037 ++ hkl_lookup.cpp
5038 ++ hkl_operators.cpp
5039 ++ map_interp.cpp
5040 ++ map_utils.cpp
5041 ++ nxmap.cpp
5042 ++ nxmap_operator.cpp
5043 ++ ramachandran.cpp
5044 ++ resol_basisfn.cpp
5045 ++ resol_fn.cpp
5046 ++ resol_targetfn.cpp
5047 ++ rotation.cpp
5048 ++ spacegroup.cpp
5049 ++ spacegroup_data.cpp
5050 ++ symop.cpp
5051 ++ xmap.cpp
5052 ++ """.split()])
5053 ++ # fftmap_sparse.cpp
5054 ++ # fftmap.cpp
5055 +
5056 + env_exe = env.Clone()
5057 +-env_exe.Prepend(LIBS=["clipper"])
5058 ++env_exe.Prepend(LIBS=[env_etc.clipper_libs[0]])
5059 +
5060 + exe = env_exe.Program(
5061 + target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
5062 +@@ -77,6 +86,7 @@ if (hasattr(env_etc, "cctbx_include")):
5063 + env=env_clipper_boost_python_ext,
5064 + paths=[
5065 + env_etc.clipper_include,
5066 ++ env_etc.clipper_sysinclude,
5067 + env_etc.libtbx_include,
5068 + env_etc.cctbx_include,
5069 + env_etc.scitbx_include,
5070 +diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
5071 +index 9f79f83..1911eb1 100644
5072 +--- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
5073 ++++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
5074 +@@ -1,6 +1,10 @@
5075 +-Import("env_clipper_boost_python_ext")
5076 ++Import("env_clipper_boost_python_ext", "env_etc")
5077 + env = env_clipper_boost_python_ext.Clone()
5078 +-env.Prepend(LIBS=["clipper", "cctbx"])
5079 ++env.Prepend(LIBS=env_etc.clipper_libs+["cctbx"])
5080 ++if (env_etc.has_clipper_contrib):
5081 ++ clipper_contrib_files = []
5082 ++else:
5083 ++ clipper_contrib_files = ["../../clipper/clipper/contrib/sfweight.cpp",]
5084 + env.SharedLibrary(
5085 + target="#lib/clipper_ext",
5086 + source=[
5087 +@@ -8,4 +12,4 @@ env.SharedLibrary(
5088 + "hendrickson_lattman_bpl.cpp",
5089 + "sigmaa_bpl.cpp",
5090 + "../../clipper/clipper/contrib/sfweight.cpp",
5091 +- "../../clipper/clipper/cctbx/clipper_cctbx.cpp"])
5092 ++ "../../clipper/clipper/cctbx/clipper_cctbx.cpp"]+clipper_contrib_files)
5093 +diff --git a/cctbx_sources/gltbx/SConscript b/cctbx_sources/gltbx/SConscript
5094 +index d02e7a5..e90f6c3 100644
5095 +--- a/cctbx_sources/gltbx/SConscript
5096 ++++ b/cctbx_sources/gltbx/SConscript
5097 +@@ -12,14 +12,15 @@ env_etc.gltbx_common_includes = [
5098 + env_etc.scitbx_include,
5099 + env_etc.boost_include,
5100 + ]
5101 +-if (gl2ps_path is not None):
5102 +- env_etc.gltbx_common_includes.append(gl2ps_path)
5103 ++if not env_etc.check_syslib('gl2ps', extra_libs='GL'):
5104 ++ if (gl2ps_path is not None):
5105 ++ env_etc.gltbx_common_includes.append(gl2ps_path)
5106 +
5107 + if (not env_etc.no_boost_python):
5108 + Import("env_base", "env_no_includes_boost_python_ext")
5109 + trial_env = env_base.Clone()
5110 + env = env_no_includes_boost_python_ext.Clone()
5111 +- env.Prepend(LIBS=["scitbx_boost_python"])
5112 ++ env.Prepend(LIBS=[env_etc.scitbx_boost_python])
5113 + if (env_etc.compiler == "win32_cl"):
5114 + for e in [trial_env, env]:
5115 + e.Append(LIBS=["glu32", "opengl32"])
5116 +@@ -79,10 +80,15 @@ int main() { std::cout << GL_POINT << std::endl; return 0; }
5117 + source=source)
5118 + env_util = env
5119 + source = ["util_ext.cpp"]
5120 +- if (gl2ps_path is not None):
5121 +- source.append("#gui_resources/gl2ps/gl2ps.c")
5122 +- env_util = env.Clone()
5123 +- env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
5124 ++ if not env_etc.check_syslib('gl2ps', extra_libs='GL'):
5125 ++ if (gl2ps_path is not None):
5126 ++ source.append("#gui_resources/gl2ps/gl2ps.c")
5127 ++ env_util = env.Clone()
5128 ++ env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
5129 ++ else:
5130 ++ env_util = env.Clone()
5131 ++ env_util.Append(SHCXXFLAGS=["-DGLTBX_HAVE_GL2PS"])
5132 ++ env_util.Append(LIBS=["gl2ps"])
5133 + env_util.SharedLibrary(
5134 + target="#lib/gltbx_util_ext",
5135 + source=source)
5136 +diff --git a/cctbx_sources/iotbx/cif/boost_python/SConscript b/cctbx_sources/iotbx/cif/boost_python/SConscript
5137 +index 49837af..2833ff1 100644
5138 +--- a/cctbx_sources/iotbx/cif/boost_python/SConscript
5139 ++++ b/cctbx_sources/iotbx/cif/boost_python/SConscript
5140 +@@ -34,15 +34,18 @@ antlr3_src_files = [
5141 + ]
5142 +
5143 + prefix = "#ucif/antlr3/src"
5144 +-source = [os.path.join(prefix, file_name) for file_name in antlr3_src_files]
5145 ++if not env_etc.check_syslib('antlr3c'):
5146 ++ source = [os.path.join(prefix, file_name) for file_name in antlr3_src_files]
5147 ++ env_etc.include_registry.append(
5148 ++ env=env,
5149 ++ paths=[antlr3_include, antlr3_dist])
5150 ++else:
5151 ++ source = []
5152 ++ env.Append(LIBS=['antlr3c'])
5153 + source.extend([
5154 + "cif_ext.cpp",
5155 + "#ucif/cifParser.cpp",
5156 + "#ucif/cifLexer.cpp",
5157 + ])
5158 +
5159 +-env_etc.include_registry.append(
5160 +- env=env,
5161 +- paths=[antlr3_include, antlr3_dist])
5162 +-
5163 + env.SharedLibrary(target="#lib/iotbx_cif_ext", source=source)
5164 +diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
5165 +index 76fb87c..4019731 100644
5166 +--- a/cctbx_sources/iotbx/mtz/SConscript
5167 ++++ b/cctbx_sources/iotbx/mtz/SConscript
5168 +@@ -23,7 +23,8 @@ if (not env_etc.no_boost_python):
5169 + env = env_iotbx_boost_python_ext.Clone()
5170 + env.Append(CXXFLAGS=env_etc.ccp4io_defines)
5171 + env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
5172 +- env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib, "scitbx_boost_python"])
5173 ++ env.Prepend(LIBS=["iotbx_mtz", "cctbx", ccp4io_lib,
5174 ++ env_etc.scitbx_boost_python])
5175 + if (os.name == "nt") :
5176 + env.Prepend(LIBS=["Advapi32"])
5177 + env_etc.enable_more_warnings(env=env)
5178 +diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
5179 +index 6af2664..9b89fe1 100644
5180 +--- a/cctbx_sources/iotbx/pdb/SConscript
5181 ++++ b/cctbx_sources/iotbx/pdb/SConscript
5182 +@@ -33,7 +33,7 @@ env.Program(target="hybrid_36_fem", source=["hybrid_36_fem.cpp"])
5183 + if (not env_etc.no_boost_python):
5184 + Import("env_iotbx_boost_python_ext")
5185 + env = env_iotbx_boost_python_ext.Clone()
5186 +- env.Prepend(LIBS=["iotbx_pdb", "cctbx", "scitbx_boost_python"])
5187 ++ env.Prepend(LIBS=["iotbx_pdb", "cctbx", env_etc.scitbx_boost_python])
5188 + env_etc.enable_more_warnings(env=env)
5189 + env.SharedLibrary(
5190 + target="#lib/iotbx_pdb_ext",
5191 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
5192 +index c273536..5aced44 100644
5193 +--- a/cctbx_sources/libtbx/SConscript
5194 ++++ b/cctbx_sources/libtbx/SConscript
5195 +@@ -1071,4 +1071,88 @@ def enable_cuda_if_possible():
5196 + enable_openmp_if_possible()
5197 + enable_cuda_if_possible()
5198 +
5199 ++env_etc.use_system_libs = False
5200 ++def check_syslib(lib, extra_libs=None):
5201 ++ """ Check if a system library is available """
5202 ++ if not env_etc.use_system_libs:
5203 ++ return False
5204 ++ env_syslib = env_base.Clone(LIBS=extra_libs)
5205 ++ conf = env_syslib.Configure()
5206 ++ if not conf.CheckLib(library=lib):
5207 ++ print 'Could not find %s library!'%(lib)
5208 ++ conf.Finish()
5209 ++ return False
5210 ++ else:
5211 ++ conf.Finish()
5212 ++ return True
5213 ++env_etc.check_syslib = check_syslib
5214 ++
5215 ++env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
5216 ++
5217 ++if (libtbx.env.build_options.use_system_libs):
5218 ++ env_etc.use_system_libs = True
5219 ++
5220 ++deb_py_str = '-py%s%s'%(sys.version[0], sys.version[2])
5221 ++gentoo_py_str = '-%s.%s'%(sys.version[0], sys.version[2])
5222 ++# This list can be extended by other distro's
5223 ++py_str_lst = [deb_py_str, gentoo_py_str]
5224 ++
5225 ++for py_str in py_str_lst:
5226 ++ if env_etc.check_syslib('boost_python%s'%py_str,
5227 ++ extra_libs=env_etc.py_lib):
5228 ++ env_etc.boost_python = 'boost_python%s'%py_str
5229 ++ env_etc.scitbx_boost_python = 'scitbx_boost_python%s'%py_str
5230 ++ break
5231 ++ else:
5232 ++ env_etc.boost_python = 'boost_python'
5233 ++ env_etc.scitbx_boost_python = 'scitbx_boost_python'
5234 ++
5235 ++env_etc.prefix = libtbx.env.build_options.install_prefix
5236 ++env_etc.destdir = libtbx.env.build_options.install_destdir
5237 ++env_etc.libdir = libtbx.env.build_options.libdir
5238 ++env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
5239 ++env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
5240 ++env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
5241 ++env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
5242 ++env_etc.rpath = os.path.join(env_etc.prefix, 'lib')
5243 ++
5244 ++def create_install_targets():
5245 ++ cwd = os.getcwd()
5246 ++ rp = libtbx.env.repository_paths
5247 ++ lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
5248 ++ exe_dev = libtbx.env.under_build("exe_dev")
5249 ++ include_path = libtbx.env.include_path
5250 ++ if not os.path.exists(lib_dir):
5251 ++ os.makedirs(lib_dir)
5252 ++ rp = list(rp)
5253 ++ rp.append(lib_dir)
5254 ++ rp.append(include_path)
5255 ++ for p in rp:
5256 ++ if isinstance(p, str):
5257 ++ src_dir = p
5258 ++ else:
5259 ++ src_dir = abs(p)
5260 ++ os.chdir(src_dir)
5261 ++ dest = None
5262 ++ for root, dirnames, filenames in os.walk('.'):
5263 ++ for filename in filenames:
5264 ++ if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
5265 ++ dest = os.path.join(env_etc.libpath, root)
5266 ++ src = os.path.join(src_dir, root, filename)
5267 ++ env_base.Install(dest, src)
5268 ++ env_base.Alias("install-shlib", dest)
5269 ++ if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
5270 ++ dest = os.path.join(env_etc.inclpath, root)
5271 ++ src = os.path.join(src_dir, root, filename)
5272 ++ env_base.Install(dest, src)
5273 ++ env_base.Alias("install-header", dest)
5274 ++ dest = env_etc.binpath
5275 ++ env_base.Install(dest, Glob('%s/*'%(exe_dev)))
5276 ++ env_base.Alias("install-bin", dest)
5277 ++ Alias('install', ['install-header', 'install-shlib', 'install-bin'])
5278 ++ os.chdir(cwd)
5279 ++
5280 ++if 'install' in COMMAND_LINE_TARGETS:
5281 ++ create_install_targets()
5282 ++
5283 + Export("env_base", "env_etc")
5284 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
5285 +index 41b6f91..ddf2848 100644
5286 +--- a/cctbx_sources/libtbx/env_config.py
5287 ++++ b/cctbx_sources/libtbx/env_config.py
5288 +@@ -740,6 +740,10 @@ Wait for the command to finish, then try again.""" % vars())
5289 + precompile_headers=command_line.options.precompile_headers,
5290 + static_libraries=command_line.options.static_libraries,
5291 + static_exe=command_line.options.static_exe,
5292 ++ use_system_libs=command_line.options.use_system_libs,
5293 ++ install_prefix=command_line.options.install_prefix,
5294 ++ libdir=command_line.options.libdir,
5295 ++ install_destdir=command_line.options.install_destdir,
5296 + scan_boost=command_line.options.scan_boost,
5297 + write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
5298 + boost_python_no_py_signatures
5299 +@@ -1799,6 +1803,10 @@ class build_options:
5300 + warning_level,
5301 + static_libraries,
5302 + static_exe,
5303 ++ use_system_libs,
5304 ++ install_prefix,
5305 ++ libdir,
5306 ++ install_destdir,
5307 + scan_boost,
5308 + write_full_flex_fwd_h=default_write_full_flex_fwd_h,
5309 + build_boost_python_extensions=default_build_boost_python_extensions,
5310 +@@ -1860,6 +1868,10 @@ class build_options:
5311 + self.boost_python_bool_int_strict
5312 + print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
5313 + print >> f, "Enable CUDA:", self.enable_cuda
5314 ++ print >> f, "Use System Libraries:", self.use_system_libs
5315 ++ print >> f, "Install Prefix:", self.install_prefix
5316 ++ print >> f, "Libdir:", self.libdir
5317 ++ print >> f, "Install Destdir:", self.install_destdir
5318 + print >> f, "Use opt_resources if available:", self.opt_resources
5319 + print >> f, "Use environment flags:", self.use_environment_flags
5320 + if( self.use_environment_flags ):
5321 +@@ -1983,6 +1995,28 @@ class pre_process_args:
5322 + action="store_true",
5323 + default=False,
5324 + help="link all executables statically (implies --static_libraries)")
5325 ++ parser.option(None, "--use_system_libs",
5326 ++ action="store_true",
5327 ++ default=False,
5328 ++ help="Use system Libraries to build.")
5329 ++ parser.option(None, "--install_destdir",
5330 ++ type="string",
5331 ++ action="store",
5332 ++ default="",
5333 ++ help="sets the destdir for the install targets.",
5334 ++ metavar="DIRECTORY")
5335 ++ parser.option(None, "--libdir",
5336 ++ type="string",
5337 ++ action="store",
5338 ++ default="lib",
5339 ++ help="sets the libdir relative to the PREFIX for the install targets. Default: lib",
5340 ++ metavar="DIRECTORY")
5341 ++ parser.option(None, "--install_prefix",
5342 ++ type="string",
5343 ++ action="store",
5344 ++ default="/usr/local",
5345 ++ help="sets the prefix for the install targets. Default: /usr/local",
5346 ++ metavar="DIRECTORY")
5347 + parser.option(None, "--scan_boost",
5348 + action="store_true",
5349 + default=False,
5350 +diff --git a/cctbx_sources/mmtbx/cablam/SConscript b/cctbx_sources/mmtbx/cablam/SConscript
5351 +index 67b1edb..36a11bc 100644
5352 +--- a/cctbx_sources/mmtbx/cablam/SConscript
5353 ++++ b/cctbx_sources/mmtbx/cablam/SConscript
5354 +@@ -3,7 +3,7 @@ Import("env_etc")
5355 + if (not env_etc.no_boost_python):
5356 + Import("env_iotbx_boost_python_ext")
5357 + env = env_iotbx_boost_python_ext.Clone()
5358 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
5359 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
5360 + env_etc.enable_more_warnings(env=env)
5361 + env.SharedLibrary(
5362 + target="#lib/mmtbx_cablam_align_utils_ext",
5363 +diff --git a/cctbx_sources/mmtbx/den/SConscript b/cctbx_sources/mmtbx/den/SConscript
5364 +index 2d3ce36..1a2b171 100644
5365 +--- a/cctbx_sources/mmtbx/den/SConscript
5366 ++++ b/cctbx_sources/mmtbx/den/SConscript
5367 +@@ -3,7 +3,7 @@ Import("env_etc")
5368 + if (not env_etc.no_boost_python):
5369 + Import("env_iotbx_boost_python_ext")
5370 + env = env_iotbx_boost_python_ext.Clone()
5371 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
5372 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
5373 + env_etc.enable_more_warnings(env=env)
5374 + env.SharedLibrary(
5375 + target="#lib/mmtbx_den_restraints_ext",
5376 +diff --git a/cctbx_sources/mmtbx/geometry_restraints/SConscript b/cctbx_sources/mmtbx/geometry_restraints/SConscript
5377 +index b9ee02c..72af551 100644
5378 +--- a/cctbx_sources/mmtbx/geometry_restraints/SConscript
5379 ++++ b/cctbx_sources/mmtbx/geometry_restraints/SConscript
5380 +@@ -3,7 +3,7 @@ Import("env_etc")
5381 + if (not env_etc.no_boost_python):
5382 + Import("env_iotbx_boost_python_ext")
5383 + env = env_iotbx_boost_python_ext.Clone()
5384 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
5385 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
5386 + env_etc.enable_more_warnings(env=env)
5387 + env.SharedLibrary(
5388 + target="#lib/mmtbx_hbond_restraints_ext",
5389 +diff --git a/cctbx_sources/mmtbx/secondary_structure/SConscript b/cctbx_sources/mmtbx/secondary_structure/SConscript
5390 +index 7e82b43..5698af5 100644
5391 +--- a/cctbx_sources/mmtbx/secondary_structure/SConscript
5392 ++++ b/cctbx_sources/mmtbx/secondary_structure/SConscript
5393 +@@ -3,7 +3,7 @@ Import("env_etc")
5394 + if (not env_etc.no_boost_python):
5395 + Import("env_iotbx_boost_python_ext")
5396 + env = env_iotbx_boost_python_ext.Clone()
5397 +- env.Prepend(LIBS=["cctbx", "scitbx_boost_python"])
5398 ++ env.Prepend(LIBS=["cctbx", env_etc.scitbx_boost_python])
5399 + env_etc.enable_more_warnings(env=env)
5400 + env.SharedLibrary(
5401 + target="#lib/mmtbx_secondary_structure_ext",
5402 +diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
5403 +index d79b762..a049b88 100644
5404 +--- a/cctbx_sources/rstbx/SConscript
5405 ++++ b/cctbx_sources/rstbx/SConscript
5406 +@@ -39,7 +39,7 @@ if (not env_etc.no_boost_python):
5407 + Import("env_boost_python_ext")
5408 + env_rstbx_boost_python_ext = env_boost_python_ext.Clone()
5409 + env_rstbx_boost_python_ext.Prepend(
5410 +- LIBS=["rstbx", "cctbx", "scitbx_boost_python"])
5411 ++ LIBS=["rstbx", "cctbx", env_etc.scitbx_boost_python])
5412 + env_rstbx_boost_python_ext.SharedLibrary(
5413 + target="#lib/rstbx_ext", source="ext.cpp")
5414 + env_rstbx_boost_python_ext.SharedLibrary(
5415 +diff --git a/cctbx_sources/scitbx/SConscript b/cctbx_sources/scitbx/SConscript
5416 +index 9199ae0..6045fbc 100644
5417 +--- a/cctbx_sources/scitbx/SConscript
5418 ++++ b/cctbx_sources/scitbx/SConscript
5419 +@@ -28,7 +28,7 @@ SConscript("sparse/tests/SConscript")
5420 + if (not env_etc.no_boost_python):
5421 + Import("env_no_includes_boost_python_ext")
5422 + env_scitbx_boost_python_ext = env_no_includes_boost_python_ext.Clone()
5423 +- env_scitbx_boost_python_ext.Prepend(LIBS=["scitbx_boost_python"])
5424 ++ env_scitbx_boost_python_ext.Prepend(LIBS=[env_etc.scitbx_boost_python])
5425 + env_etc.include_registry.append(
5426 + env=env_scitbx_boost_python_ext,
5427 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
5428 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
5429 +index eda7b03..1f396e5 100644
5430 +--- a/cctbx_sources/scitbx/boost_python/SConscript
5431 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
5432 +@@ -7,7 +7,7 @@ env_etc.enable_more_warnings(env=env)
5433 + env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
5434 + env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
5435 + env.Append(LIBPATH=env_etc.libpath_python)
5436 +-env.Append(LIBS=["boost_python"] + env_etc.libs_python)
5437 ++env.Append(LIBS=[env_etc.boost_python] + env_etc.libs_python)
5438 + env_etc.include_registry.append(
5439 + env=env,
5440 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
5441 +@@ -20,5 +20,5 @@ lib_scitbx_boost_python_sources = [
5442 + if (env_etc.static_libraries): builder = env.StaticLibrary
5443 + else: builder = env.SharedLibrary
5444 + builder(
5445 +- target="#lib/scitbx_boost_python",
5446 ++ target="#lib/%s"%env_etc.scitbx_boost_python,
5447 + source=lib_scitbx_boost_python_sources)
5448 +diff --git a/cctbx_sources/smtbx/refinement/boost_python/SConscript b/cctbx_sources/smtbx/refinement/boost_python/SConscript
5449 +index 0387e1d..5144996 100644
5450 +--- a/cctbx_sources/smtbx/refinement/boost_python/SConscript
5451 ++++ b/cctbx_sources/smtbx/refinement/boost_python/SConscript
5452 +@@ -1,6 +1,6 @@
5453 +-Import("env_smtbx_boost_python_ext")
5454 ++Import("env_smtbx_boost_python_ext", "env_etc")
5455 + env = env_smtbx_boost_python_ext.Clone()
5456 +-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
5457 ++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
5458 + env.SharedLibrary(target="#lib/smtbx_refinement_least_squares_ext", source=[
5459 + "least_squares_ext.cpp",
5460 + "weighting_schemes.cpp",
5461 +diff --git a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
5462 +index 009d288..1eb176b 100644
5463 +--- a/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
5464 ++++ b/cctbx_sources/smtbx/refinement/constraints/boost_python/SConscript
5465 +@@ -1,5 +1,5 @@
5466 +-Import("env_smtbx_boost_python_ext")
5467 ++Import("env_smtbx_boost_python_ext", "env_etc")
5468 + env = env_smtbx_boost_python_ext.Clone()
5469 +-env.Prepend(LIBS=["smtbx_refinement_constraints", "scitbx_boost_python"])
5470 ++env.Prepend(LIBS=["smtbx_refinement_constraints", env_etc.scitbx_boost_python])
5471 + env.SharedLibrary(target="#lib/smtbx_refinement_constraints_ext",
5472 + source=Glob("*.cpp"))
5473 +diff --git a/cctbx_sources/spotfinder/SConscript b/cctbx_sources/spotfinder/SConscript
5474 +index 1d280d4..1d73677 100644
5475 +--- a/cctbx_sources/spotfinder/SConscript
5476 ++++ b/cctbx_sources/spotfinder/SConscript
5477 +@@ -54,7 +54,7 @@ if (not env_etc.no_boost_python):
5478 + Import("env_no_includes_boost_python_ext")
5479 +
5480 + env_spotfinder_boost_python_ext = env_no_includes_boost_python_ext.Clone()
5481 +- env_spotfinder_boost_python_ext.Prepend(LIBS=[ "scitbx_boost_python"])
5482 ++ env_spotfinder_boost_python_ext.Prepend(LIBS=[ env_etc.scitbx_boost_python ])
5483 + env_etc.include_registry.append(
5484 + env=env_spotfinder_boost_python_ext,
5485 + paths=env_etc.spotfinder_common_includes + [env_etc.python_include])
5486 +diff --git a/cctbx_sources/xfel/SConscript b/cctbx_sources/xfel/SConscript
5487 +index e680f73..3397762 100644
5488 +--- a/cctbx_sources/xfel/SConscript
5489 ++++ b/cctbx_sources/xfel/SConscript
5490 +@@ -31,7 +31,7 @@ if (not env_etc.no_boost_python):
5491 + Import("env_boost_python_ext")
5492 + env_xfel_boost_python_ext = env_boost_python_ext.Clone()
5493 + env_xfel_boost_python_ext.Prepend(
5494 +- LIBS=["cctbx", "scitbx_boost_python"])
5495 ++ LIBS=["cctbx", env_etc.scitbx_boost_python])
5496 + env_xfel_boost_python_ext.SharedLibrary(
5497 + target="#lib/xfel_ext", source="ext.cpp")
5498 + env_xfel_boost_python_ext.SharedLibrary(
5499
5500 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0007-adding-shlib-versioning.patch b/sci-libs/cctbx/files/2013.02.27.0005/0007-adding-shlib-versioning.patch
5501 new file mode 100644
5502 index 0000000..fd1888e
5503 --- /dev/null
5504 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0007-adding-shlib-versioning.patch
5505 @@ -0,0 +1,208 @@
5506 +From: Radostan Riedel <raybuntu@××××××××××.com>
5507 +Date: Mon, 23 Jul 2012 18:33:07 +0200
5508 +Subject: adding-shlib-versioning
5509 +
5510 +---
5511 + cctbx_sources/boost_adaptbx/SConscript | 3 +
5512 + cctbx_sources/libtbx/SConscript | 115 +++++++++++++++++++++++++++++---
5513 + cctbx_sources/libtbx/env_config.py | 7 ++
5514 + 3 files changed, 116 insertions(+), 9 deletions(-)
5515 +
5516 +diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
5517 +index 68cac89..dedbb05 100644
5518 +--- a/cctbx_sources/boost_adaptbx/SConscript
5519 ++++ b/cctbx_sources/boost_adaptbx/SConscript
5520 +@@ -58,6 +58,9 @@ if (not env_etc.no_boost_python):
5521 + SHLINKFLAGS=env_etc.shlinkflags_bpl,
5522 + SHLIBPREFIX="",
5523 + LIBS=[env_etc.boost_python] + env_etc.libs_python + env_etc.libm)
5524 ++ if (libtbx.env.build_options.libtoolize):
5525 ++ # Need to unset libtool since it does not support linking python-ext
5526 ++ env_etc.unset_libtool(env_no_includes_boost_python_ext)
5527 + env_no_includes_boost_python_ext.Append(
5528 + LIBPATH=env_etc.libpath_python)
5529 + env_no_includes_boost_python_ext.Append(
5530 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
5531 +index 429c44b..58bdd30 100644
5532 +--- a/cctbx_sources/libtbx/SConscript
5533 ++++ b/cctbx_sources/libtbx/SConscript
5534 +@@ -1061,16 +1061,99 @@ env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
5535 + env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
5536 + env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
5537 + env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
5538 +-env_etc.rpath = os.path.join(env_etc.prefix, 'lib')
5539 ++env_etc.rpath = os.path.abspath(env_etc.prefix + '/' + env_etc.libdir)
5540 ++
5541 ++def set_libtool(env):
5542 ++ # Versioning can be provided by appending "-version-info 3:12:1" to SHLINKFLAGS
5543 ++ # Please see:
5544 ++ # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
5545 ++ # for reference. Otherwise it will be set to 0:0:0
5546 ++ env_etc.shobjsuffix_save = env['SHOBJSUFFIX']
5547 ++ env_etc.SharedLibBuilder_save = env['BUILDERS']['SharedLibrary']
5548 ++ env.Replace(
5549 ++ SHLINKFLAGS='-rpath ' + env_etc.rpath,
5550 ++ SHOBJSUFFIX='.lo',
5551 ++ SHLIBSUFFIX='.la',
5552 ++ )
5553 ++ LIBTOOLCOM = 'libtool --mode=compile --tag='
5554 ++ LIBTOOLCCOM = LIBTOOLCOM + 'CC '
5555 ++ LIBTOOLCXXCOM = LIBTOOLCOM + 'CXX '
5556 ++ LIBTOOLLINK = 'libtool --mode=link --tag=CXX '
5557 ++ ShCAction = SCons.Action.Action(LIBTOOLCCOM + "$SHCCCOM", "$SHCCCOMSTR")
5558 ++ ShCXXAction = SCons.Action.Action(LIBTOOLCXXCOM + "$SHCXXCOM", "$SHCXXCOMSTR")
5559 ++ ShLinkAction = SCons.Action.Action(LIBTOOLLINK + "$SHLINKCOM", "$SHLINKCOMSTR")
5560 ++ libtool_install = 'libtool --mode=install install -D ${TARGET.abspath} %s%s/${TARGET.file}'%(abs(libtbx.env.lib_path), env_etc.rpath)
5561 ++
5562 ++ action_list = [ SCons.Defaults.SharedCheck,
5563 ++ ShLinkAction,
5564 ++ libtool_install,
5565 ++ ]
5566 ++ CSuffixes = SCons.Tool.cc.CSuffixes
5567 ++ # Can't import SCons.Tool.c++.CSuffixes because of that 'c++'
5568 ++ CXXSuffixes = ['.cpp', '.cc', '.cxx', '.c++', '.C++', '.mm']
5569 ++ shared_obj = SCons.Builder.Builder(action = {},
5570 ++ emitter = {},
5571 ++ prefix = '$SHOBJPREFIX',
5572 ++ suffix = '$SHOBJSUFFIX',
5573 ++ src_builder = ['CFile', 'CXXFile'],
5574 ++ source_scanner = SourceFileScanner,
5575 ++ single_source = 1)
5576 ++ for suffix in CXXSuffixes:
5577 ++ shared_obj.add_action(suffix, ShCXXAction)
5578 ++ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
5579 ++ for suffix in CSuffixes:
5580 ++ shared_obj.add_action(suffix, ShCAction)
5581 ++ shared_obj.add_emitter(suffix, SCons.Defaults.SharedObjectEmitter)
5582 ++
5583 ++ LibtoolBuilder = SCons.Builder.Builder(action = action_list,
5584 ++ emitter = "$SHLIBEMITTER",
5585 ++ prefix = '$SHLIBPREFIX',
5586 ++ suffix = '$SHLIBSUFFIX',
5587 ++ target_scanner = ProgramScanner,
5588 ++ src_suffix = '$SHOBJSUFFIX',
5589 ++ src_builder = shared_obj)
5590 ++
5591 ++ from SCons.Tool.install import add_targets_to_INSTALLED_FILES
5592 ++ LibtoolInstall = SCons.Builder.Builder(
5593 ++ action = 'libtool --mode=install install -D ${SOURCE.abspath} ${TARGET.abspath}',
5594 ++ target_factory = env.fs.Entry,
5595 ++ source_factory = env.fs.Entry,
5596 ++ multi = 1,
5597 ++ emitter = [ add_targets_to_INSTALLED_FILES, ],
5598 ++ name = 'LibtoolInstall')
5599 ++
5600 ++ env['BUILDERS']['LibtoolInstall'] = LibtoolInstall
5601 ++
5602 ++ lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
5603 ++ if not os.path.exists(lib_dir):
5604 ++ os.makedirs(lib_dir)
5605 ++ libtool_install_path = '#lib' + env_etc.rpath
5606 ++ env.Append(LIBPATH=libtool_install_path)
5607 ++ env['BUILDERS']['SharedLibrary'] = LibtoolBuilder
5608 ++env_etc.set_libtool = set_libtool
5609 ++
5610 ++def unset_libtool(env):
5611 ++ env['BUILDERS']['SharedLibrary'] = env_etc.SharedLibBuilder_save
5612 ++ env.Replace(
5613 ++ SHOBJSUFFIX=env_etc.shobjsuffix_save,
5614 ++ )
5615 ++env_etc.unset_libtool = unset_libtool
5616 ++
5617 ++if (libtbx.env.build_options.libtoolize):
5618 ++ env_etc.shlibsuffix = ".la"
5619 ++ env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
5620 ++ rpath_link = ['-rpath', env_etc.rpath]
5621 ++ env_etc.shlinkflags.extend(rpath_link)
5622 ++ if '-shared' in env_etc.shlinkflags:
5623 ++ env_etc.shlinkflags.remove('-shared')
5624 ++ env_etc.set_libtool(env_base)
5625 +
5626 + def create_install_targets():
5627 + cwd = os.getcwd()
5628 + rp = libtbx.env.repository_paths
5629 +- lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
5630 ++ lib_dir = abs(libtbx.env.lib_path)
5631 + exe_dev = libtbx.env.under_build("exe_dev")
5632 + include_path = libtbx.env.include_path
5633 +- if not os.path.exists(lib_dir):
5634 +- os.makedirs(lib_dir)
5635 + rp = list(rp)
5636 + rp.append(lib_dir)
5637 + rp.append(include_path)
5638 +@@ -1082,17 +1165,31 @@ def create_install_targets():
5639 + os.chdir(src_dir)
5640 + dest = None
5641 + for root, dirnames, filenames in os.walk('.'):
5642 ++ # exclude .libs dir
5643 ++ if '.libs' in dirnames:
5644 ++ dirnames.remove('.libs')
5645 + for filename in filenames:
5646 +- if re.match('^lib.*\.(so.*|dylib.*|la|a)$', filename, flags=re.IGNORECASE):
5647 +- dest = os.path.join(env_etc.libpath, root)
5648 +- src = os.path.join(src_dir, root, filename)
5649 +- env_base.Install(dest, src)
5650 +- env_base.Alias("install-shlib", dest)
5651 ++ if not (libtbx.env.build_options.libtoolize):
5652 ++ if re.match('^lib.*\.(so|dylib|a)$', filename, flags=re.IGNORECASE):
5653 ++ dest = os.path.join(env_etc.libpath, root)
5654 ++ src = os.path.join(src_dir, root, filename)
5655 ++ env_base.Install(dest, src)
5656 ++ env_base.Alias("install-shlib", dest)
5657 ++ else:
5658 ++ if re.match('^lib.*\.la$', filename, flags=re.IGNORECASE):
5659 ++ dest = os.path.join(env_etc.libpath, root, filename)
5660 ++ src = os.path.join(src_dir, root, filename)
5661 ++ env_base.LibtoolInstall(dest, src)
5662 ++ env_base.Alias("install-shlib", dest)
5663 + if re.match('^.*\.(h|hpp)$', filename, flags=re.IGNORECASE):
5664 + dest = os.path.join(env_etc.inclpath, root)
5665 + src = os.path.join(src_dir, root, filename)
5666 + env_base.Install(dest, src)
5667 + env_base.Alias("install-header", dest)
5668 ++ if src_dir == lib_dir:
5669 ++ break
5670 ++
5671 ++ env_base.Alias("install-shlib", dest)
5672 + dest = env_etc.binpath
5673 + env_base.Install(dest, Glob('%s/*'%(exe_dev)))
5674 + env_base.Alias("install-bin", dest)
5675 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
5676 +index 0885527..3d9133e 100644
5677 +--- a/cctbx_sources/libtbx/env_config.py
5678 ++++ b/cctbx_sources/libtbx/env_config.py
5679 +@@ -705,6 +705,7 @@ Wait for the command to finish, then try again.""" % vars())
5680 + install_prefix=command_line.options.install_prefix,
5681 + libdir=command_line.options.libdir,
5682 + install_destdir=command_line.options.install_destdir,
5683 ++ libtoolize=command_line.options.libtoolize,
5684 + scan_boost=command_line.options.scan_boost,
5685 + write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
5686 + boost_python_no_py_signatures
5687 +@@ -1767,6 +1768,7 @@ class build_options:
5688 + install_prefix,
5689 + libdir,
5690 + install_destdir,
5691 ++ libtoolize,
5692 + scan_boost,
5693 + write_full_flex_fwd_h=default_write_full_flex_fwd_h,
5694 + build_boost_python_extensions=default_build_boost_python_extensions,
5695 +@@ -1830,6 +1832,7 @@ class build_options:
5696 + print >> f, "Boost threads enabled:", self.enable_boost_threads
5697 + print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
5698 + print >> f, "Enable CUDA:", self.enable_cuda
5699 ++ print >> f, "Libtoolize:", self.libtoolize
5700 + print >> f, "Use System Libraries:", self.use_system_libs
5701 + print >> f, "Install Prefix:", self.install_prefix
5702 + print >> f, "Libdir:", self.libdir
5703 +@@ -1974,6 +1977,10 @@ class pre_process_args:
5704 + default="/usr/local",
5705 + help="sets the prefix for the install targets. Default: /usr/local",
5706 + metavar="DIRECTORY")
5707 ++ parser.option(None, "--libtoolize",
5708 ++ action="store_true",
5709 ++ default=False,
5710 ++ help="build all shared libraries with libtool.")
5711 + parser.option(None, "--scan_boost",
5712 + action="store_true",
5713 + default=False,
5714
5715 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0008-Fix-to-skip-pycbf-build.patch b/sci-libs/cctbx/files/2013.02.27.0005/0008-Fix-to-skip-pycbf-build.patch
5716 new file mode 100644
5717 index 0000000..7aa3a39
5718 --- /dev/null
5719 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0008-Fix-to-skip-pycbf-build.patch
5720 @@ -0,0 +1,52 @@
5721 +From: Radostan Riedel <raybuntu@××××××××××.com>
5722 +Date: Tue, 7 Aug 2012 18:08:30 +0200
5723 +Subject: Fix to skip pycbf build
5724 +
5725 +---
5726 + cctbx_sources/cbflib_adaptbx/SConscript | 8 ++++----
5727 + cctbx_sources/cbflib_adaptbx/libtbx_refresh.py | 16 ++++++++--------
5728 + 2 files changed, 12 insertions(+), 12 deletions(-)
5729 +
5730 +diff --git a/cctbx_sources/cbflib_adaptbx/SConscript b/cctbx_sources/cbflib_adaptbx/SConscript
5731 +index 334cfc2..42ab9c3 100644
5732 +--- a/cctbx_sources/cbflib_adaptbx/SConscript
5733 ++++ b/cctbx_sources/cbflib_adaptbx/SConscript
5734 +@@ -90,10 +90,10 @@ if (not env_etc.no_boost_python):
5735 + env=env_cbflib_boost_python_ext,
5736 + paths=env_etc.cbflib_common_includes + [env_etc.python_include])
5737 +
5738 +- env_cbflib_boost_python_ext.SharedLibrary(
5739 +- target='#lib/_pycbf',
5740 +- source=[prefix+"/pycbf/pycbf_wrap.c"],
5741 +- LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
5742 ++ #env_cbflib_boost_python_ext.SharedLibrary(
5743 ++ # target='#lib/_pycbf',
5744 ++ # source=[prefix+"/pycbf/pycbf_wrap.c"],
5745 ++ # LIBS=env_etc.cbf_lib+env_etc.libs_python+env_etc.libm)
5746 +
5747 + Export("env_cbflib_boost_python_ext")
5748 +
5749 +diff --git a/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py b/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
5750 +index 51b3e42..dd1b8e9 100644
5751 +--- a/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
5752 ++++ b/cctbx_sources/cbflib_adaptbx/libtbx_refresh.py
5753 +@@ -1,11 +1,11 @@
5754 + from libtbx.str_utils import show_string
5755 + import os
5756 + op = os.path
5757 +-pycbf_py = self.env.under_dist(module_name="cbflib", path="pycbf/pycbf.py")
5758 +-if (not op.isfile(pycbf_py)):
5759 +- raise RuntimeError("Missing file: %s" % show_string(pycbf_py))
5760 +-target_dir = self.env.under_build(path="lib")
5761 +-if (not op.isdir(target_dir)):
5762 +- os.makedirs(target_dir)
5763 +-print " Copying to lib: %s" % show_string(pycbf_py)
5764 +-open(op.join(target_dir, "pycbf.py"), "w").write(open(pycbf_py).read())
5765 ++#pycbf_py = self.env.under_dist(module_name="cbflib", path="pycbf/pycbf.py")
5766 ++#if (not op.isfile(pycbf_py)):
5767 ++# raise RuntimeError("Missing file: %s" % show_string(pycbf_py))
5768 ++#target_dir = self.env.under_build(path="lib")
5769 ++#if (not op.isdir(target_dir)):
5770 ++# os.makedirs(target_dir)
5771 ++#print " Copying to lib: %s" % show_string(pycbf_py)
5772 ++#open(op.join(target_dir, "pycbf.py"), "w").write(open(pycbf_py).read())
5773
5774 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0009-build-libann-statically.patch b/sci-libs/cctbx/files/2013.02.27.0005/0009-build-libann-statically.patch
5775 new file mode 100644
5776 index 0000000..77ba2b2
5777 --- /dev/null
5778 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0009-build-libann-statically.patch
5779 @@ -0,0 +1,27 @@
5780 +From: Radostan Riedel <raybuntu@××××××××××.com>
5781 +Date: Thu, 19 Jul 2012 11:29:57 +0200
5782 +Subject: build libann statically
5783 +
5784 +---
5785 + cctbx_sources/annlib_adaptbx/SConscript | 8 +++++---
5786 + 1 file changed, 5 insertions(+), 3 deletions(-)
5787 +
5788 +diff --git a/cctbx_sources/annlib_adaptbx/SConscript b/cctbx_sources/annlib_adaptbx/SConscript
5789 +index 31b4da6..f217b3f 100644
5790 +--- a/cctbx_sources/annlib_adaptbx/SConscript
5791 ++++ b/cctbx_sources/annlib_adaptbx/SConscript
5792 +@@ -29,9 +29,11 @@ if (libtbx.manual_date_stamp < 20090819):
5793 + env.Replace(CXXFLAGS=env_etc.cxxflags_base)
5794 + env.Replace(SHCXXFLAGS=env_etc.cxxflags_base)
5795 +
5796 +-if (env_etc.static_libraries): builder = env.StaticLibrary
5797 +-else: builder = env.SharedLibrary
5798 +-builder(target='#lib/ann',
5799 ++#if (env_etc.static_libraries): builder = env.StaticLibrary
5800 ++#else: builder = env.SharedLibrary
5801 ++# Create a static library since the changes are incompatiple
5802 ++# with debian's libann
5803 ++env.StaticLibrary(target='#lib/ann',
5804 + source = ["../annlib/src/ANN.cpp",
5805 + "../annlib/src/bd_fix_rad_search.cpp",
5806 + "../annlib/src/bd_pr_search.cpp",
5807
5808 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0010-adding-setup_py.patch b/sci-libs/cctbx/files/2013.02.27.0005/0010-adding-setup_py.patch
5809 new file mode 100644
5810 index 0000000..7599d82
5811 --- /dev/null
5812 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0010-adding-setup_py.patch
5813 @@ -0,0 +1,662 @@
5814 +From: Baptiste Carvello <devel@×××××××××××××××××.net>
5815 +Date: Tue, 21 Aug 2012 16:10:19 +0200
5816 +Subject: adding-setup_py
5817 +
5818 +---
5819 + cctbx_sources/stdlib.py | 4 +
5820 + sconsutils.py | 485 +++++++++++++++++++++++++++++++++++++++++++++++
5821 + setup.py | 136 +++++++++++++
5822 + 3 files changed, 625 insertions(+)
5823 + create mode 100755 cctbx_sources/stdlib.py
5824 + create mode 100644 sconsutils.py
5825 + create mode 100755 setup.py
5826 +
5827 +diff --git a/cctbx_sources/stdlib.py b/cctbx_sources/stdlib.py
5828 +new file mode 100755
5829 +index 0000000..759f689
5830 +--- /dev/null
5831 ++++ b/cctbx_sources/stdlib.py
5832 +@@ -0,0 +1,4 @@
5833 ++from libtbx.forward_compatibility import stdlib_import
5834 ++
5835 ++math = stdlib_import("math")
5836 ++random = stdlib_import("random")
5837 +diff --git a/sconsutils.py b/sconsutils.py
5838 +new file mode 100644
5839 +index 0000000..322585b
5840 +--- /dev/null
5841 ++++ b/sconsutils.py
5842 +@@ -0,0 +1,485 @@
5843 ++from distutils.sysconfig import get_python_lib, get_config_var
5844 ++from distutils.command.build_ext import build_ext as _build_ext
5845 ++from distutils.command.build_py import build_py as _build_py
5846 ++from distutils.command.install_lib import install_lib as _install_lib
5847 ++from distutils.command.install_data import install_data as _install_data
5848 ++from distutils.command.clean import clean as _clean
5849 ++from distutils.cmd import Command as _Command
5850 ++from distutils.dir_util import remove_tree
5851 ++from distutils.util import change_root, convert_path
5852 ++from distutils.errors import DistutilsExecError
5853 ++from distutils import log
5854 ++import sys, os
5855 ++import SCons.Script
5856 ++import libtbx
5857 ++import libtbx.env_config
5858 ++from libtbx.path import relocatable_path, absolute_path
5859 ++from libtbx.path import relpath # don't use relpath from os.path, introduced in 2.6
5860 ++from libtbx.utils import import_python_object
5861 ++import threading
5862 ++import pickle
5863 ++
5864 ++opj = os.path.join
5865 ++configure_list = []
5866 ++scons_buildargv = []
5867 ++scons_installargv = []
5868 ++SRCDIR=''
5869 ++
5870 ++class Command(_Command):
5871 ++ def run_scons(self, argv):
5872 ++ cwd = os.getcwd()
5873 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build') # build_temp must be set by subclass
5874 ++ if not os.path.exists(builddir):
5875 ++ if not os.path.exists(os.path.abspath(self.build_temp)):
5876 ++ os.mkdir(os.path.abspath(self.build_temp))
5877 ++ os.mkdir(builddir)
5878 ++ elif not os.path.isdir(builddir):
5879 ++ raise RuntimeError(("Build directory '%s' cannot be created "
5880 ++ "because of existing file") % builddir)
5881 ++ os.chdir(builddir)
5882 ++ if '%PREFIX%' in configure_list:
5883 ++ idx=configure_list.index('%PREFIX%')
5884 ++ configure_list[idx] = self.prefix # prefix must be set by subclass
5885 ++ libtbx.env_config.cold_start(configure_list)
5886 ++ os.environ["LIBTBX_BUILD"] = builddir
5887 ++ os.environ['PYTHONPATH'] = ':'.join(sys.path)
5888 ++ self.spawn(argv)
5889 ++ os.chdir(cwd)
5890 ++
5891 ++class build_ext(_build_ext, Command):
5892 ++ user_options = _build_ext.user_options + [
5893 ++ ('prefix=', None, "installation prefix (default: python installation prefix")
5894 ++ ]
5895 ++ def initialize_options(self):
5896 ++ _build_ext.initialize_options(self)
5897 ++ self.prefix = None
5898 ++ def finalize_options(self):
5899 ++ _build_ext.finalize_options(self)
5900 ++ if not self.prefix:
5901 ++ self.prefix = get_config_var('prefix') # on Debian: 'usr'
5902 ++ def run(self):
5903 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build') # build_temp set by _build_ext
5904 ++ self.run_scons(scons_buildargv)
5905 ++ for ext in self.extensions:
5906 ++ if len(ext.sources) != 1 or ext.sources[0] != '%SCONSLIB%':
5907 ++ log.warn("Don't know how to build extension '%s' -- skipping",
5908 ++ ext.name)
5909 ++ continue
5910 ++ dst = self.get_ext_fullpath(ext.name)
5911 ++ bld = opj(builddir, 'lib', os.path.basename(dst))
5912 ++ if os.path.isfile(bld):
5913 ++ self.copy_file(bld, dst)
5914 ++
5915 ++class build_py(_build_py):
5916 ++ def build_module (self, module, module_file, package):
5917 ++ if type(package) is str:
5918 ++ package = package.split('.')
5919 ++ elif type(package) not in (list, tuple):
5920 ++ raise TypeError, \
5921 ++ "'package' must be a string (dot-separated), list, or tuple"
5922 ++
5923 ++ # Now put the module source file into the "build" area -- this is
5924 ++ # easy, we just copy it somewhere under self.build_lib (the build
5925 ++ # directory for Python source).
5926 ++ outfile = self.get_module_outfile(self.build_lib, package, module)
5927 ++ dir = os.path.dirname(outfile)
5928 ++ self.mkpath(dir)
5929 ++ # If the module contains non-blank, non-comment/docstring lines, and doesn't have
5930 ++ # the __future__ import, add it before the first non-comment/docstring line
5931 ++ empty = True
5932 ++ found = False
5933 ++ docstring = None
5934 ++ file_obj = open(module_file)
5935 ++ for line in file_obj:
5936 ++ if docstring:
5937 ++ if (line.count(docstring) % 2) == 1:
5938 ++ # FIXME this logic will fail with lines such as """ + ''',
5939 ++ # but nobody with a sane mind would do that, would they ?
5940 ++ docstring = None
5941 ++ continue
5942 ++ if line == "from __future__ import division\n":
5943 ++ found = True
5944 ++ break
5945 ++ if line.isspace() or line.startswith('#'):
5946 ++ continue
5947 ++ if line.startswith('"""') and (line.count('"""') % 2) == 1:
5948 ++ docstring = '"""'
5949 ++ continue
5950 ++ if line.startswith('"'):
5951 ++ continue
5952 ++ if line.startswith("'''") and (line.count("'''") % 2) == 1:
5953 ++ docstring = "'''"
5954 ++ continue
5955 ++ if line.startswith("'"):
5956 ++ continue
5957 ++ empty = False
5958 ++ break
5959 ++ file_obj.close()
5960 ++ if empty or found:
5961 ++ return self.copy_file(module_file, outfile, preserve_mode=0)
5962 ++ elif self.dry_run:
5963 ++ if os.path.isdir(outfile):
5964 ++ outfile = opj(outfile, os.path.basename(module_file))
5965 ++ log.info("copying with modification %s -> %s", module_file, outfile)
5966 ++ return outfile, True
5967 ++ else:
5968 ++ if os.path.isdir(outfile):
5969 ++ outfile = opj(outfile, os.path.basename(module_file))
5970 ++ log.info("copying with modification %s -> %s", module_file, outfile)
5971 ++ file_obj = open(module_file)
5972 ++ outfile_obj = open(outfile, 'w')
5973 ++ written = False
5974 ++ docstring = None
5975 ++ for line in file_obj:
5976 ++ if not written:
5977 ++ if docstring:
5978 ++ if (line.count(docstring) % 2) == 1:
5979 ++ docstring = None
5980 ++ outfile_obj.write(line)
5981 ++ continue
5982 ++ if line.isspace() or line.startswith('#'):
5983 ++ outfile_obj.write(line)
5984 ++ continue
5985 ++ if line.startswith('"""') and (line.count('"""') % 2) == 1:
5986 ++ docstring = '"""'
5987 ++ outfile_obj.write(line)
5988 ++ continue
5989 ++ if line.startswith('"'):
5990 ++ outfile_obj.write(line)
5991 ++ continue
5992 ++ if line.startswith("'''") and (line.count("'''") % 2) == 1:
5993 ++ docstring = "'''"
5994 ++ outfile_obj.write(line)
5995 ++ continue
5996 ++ if line.startswith("'"):
5997 ++ outfile_obj.write(line)
5998 ++ continue
5999 ++ outfile_obj.write("from __future__ import division\n")
6000 ++ written = True
6001 ++ outfile_obj.write(line)
6002 ++ outfile_obj.close()
6003 ++ file_obj.close()
6004 ++ return outfile, True
6005 ++
6006 ++class test(_Command):
6007 ++ description = "runs the tests in the distutils build directory"
6008 ++ user_options = [
6009 ++ ('build-lib=', None,
6010 ++ "distutils build directory (default: 'build.build-lib')"),
6011 ++ ('build-temp=', 't',
6012 ++ "directory for temporary files (default: 'build.build-temp')")
6013 ++ ]
6014 ++ def initialize_options(self):
6015 ++ self.build_lib = None
6016 ++ self.build_temp = None
6017 ++ def finalize_options(self):
6018 ++ self.set_undefined_options('build',
6019 ++ ('build_lib', 'build_lib'),
6020 ++ ('build_temp', 'build_temp'))
6021 ++ def run(self):
6022 ++ libdir = os.path.abspath(os.path.abspath(self.build_lib))
6023 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
6024 ++ testdir = opj(os.path.abspath(self.build_temp), 'cctbx-test')
6025 ++ self.setup_test_env(builddir, libdir, testdir)
6026 ++ os.environ["LIBTBX_BUILD"] = testdir
6027 ++ env = libtbx.env_config.unpickle()
6028 ++ os.environ['PYTHONPATH'] = ':'.join([libdir] + sys.path[5:])
6029 ++ llp = os.environ.get('LD_LIBRARY_PATH')
6030 ++ if llp is not None:
6031 ++ os.environ['LD_LIBRARY_PATH'] = ':'.join([opj(builddir, 'lib', '.libs'), llp])
6032 ++ else:
6033 ++ os.environ['LD_LIBRARY_PATH'] = opj(builddir, 'lib', '.libs')
6034 ++ os.chdir(testdir)
6035 ++ failed = []
6036 ++ for m in env.module_list:
6037 ++ for (module_name,dist_path) in m.name_and_dist_path_pairs():
6038 ++ try:
6039 ++# tst_list = import_python_object(
6040 ++# import_path="%s.run_tests.tst_list" % module_name, Does not work yet
6041 ++# error_prefix="",
6042 ++# target_must_be="",
6043 ++# where_str="").object
6044 ++ run_func = import_python_object(
6045 ++ import_path="%s.run_tests.run" % module_name,
6046 ++ error_prefix="",
6047 ++ target_must_be="",
6048 ++ where_str="").object
6049 ++ tst_mod = file(opj(abs(dist_path), "run_tests.py")) # Ugly, temporary
6050 ++ tst_lines = [l.strip() for l in tst_mod]
6051 ++ tst_mod.close()
6052 ++ tst_code = " ".join(["("] +
6053 ++ tst_lines[(tst_lines.index("tst_list = (")+1)
6054 ++ :(tst_lines.index(")")+1)]
6055 ++ )
6056 ++ tst_list = eval(tst_code)
6057 ++
6058 ++ except Exception:
6059 ++ continue
6060 ++ for tst in tst_list: # adapted from libtbx.test_utils.iter_tests_cmd
6061 ++ cmd_args = []
6062 ++ if (type(tst) == type([])):
6063 ++# cmd_args = tst[1:] FIXME why only in quick mode?
6064 ++ tst = tst[0]
6065 ++ if (tst.startswith("$B")):
6066 ++ tst_path = tst.replace("$B", builddir)
6067 ++ else:
6068 ++ tst_path = tst.replace("$D", abs(dist_path))
6069 ++ if "$" in tst_path or '"' in tst_path:
6070 ++ log.warn("Could not run test '%s':\n%s", tst, "Unexpected '$' in test path")
6071 ++ failed.append([module_name,tst,AssertionError("Unexpected '$' in test path")])
6072 ++ continue
6073 ++ if '"' in tst_path:
6074 ++ log.warn("Could not run test '%s':\n%s", tst, "Unexpected '\"' in test path")
6075 ++ failed.append([module_name,tst,AssertionError("Unexpected '\"' in test path")])
6076 ++ continue
6077 ++ tst_path = os.path.normpath(tst_path)
6078 ++ if (tst_path.endswith(".py")):
6079 ++ cmd = [sys.executable, tst_path] + cmd_args
6080 ++ else:
6081 ++ cmd = [tst_path] + cmd_args
6082 ++ try:
6083 ++ self.spawn(cmd)
6084 ++ except DistutilsExecError, e:
6085 ++ log.warn("Failure in test '%s':\n%s", tst, str(e))
6086 ++ failed.append([module_name,tst,e])
6087 ++ except Exception, e:
6088 ++ log.warn("Exception in test '%s':\n%s", tst, str(e))
6089 ++ failed.append([module_name,tst,e])
6090 ++ if failed:
6091 ++ log.warn("Some tests failed:")
6092 ++ for n,t,e in failed:
6093 ++ log.warn(" module %s, test %s" % (n,t))
6094 ++ raise RuntimeError("Test failures")
6095 ++
6096 ++ def setup_test_env(self, builddir, libdir, testdir):
6097 ++ """ Create the test directory and the temporary libtbx_env pickle object """
6098 ++ if not os.path.exists(testdir):
6099 ++ if not os.path.exists(os.path.abspath(self.build_temp)):
6100 ++ os.mkdir(os.path.abspath(self.build_temp))
6101 ++ os.mkdir(testdir)
6102 ++ elif not os.path.isdir(testdir):
6103 ++ raise RuntimeError(("Test directory '%s' cannot be created "
6104 ++ "because of existing file") % testdir)
6105 ++ os.environ["LIBTBX_BUILD"] = builddir
6106 ++ env = libtbx.env_config.unpickle()
6107 ++ module_dist_paths = {}
6108 ++ for key, value in env.module_dist_paths.items():
6109 ++ head, module = os.path.split(abs(value))
6110 ++ module_dist_paths[key] = relocatable_path(absolute_path(libdir), module)
6111 ++ env.module_dist_paths = module_dist_paths
6112 ++ for module in env.module_list:
6113 ++ paths = []
6114 ++ for path in module.dist_paths:
6115 ++ if path != None:
6116 ++ head, tail = os.path.split(abs(path))
6117 ++ rp = relocatable_path(absolute_path(libdir), tail)
6118 ++ paths.append(rp)
6119 ++ else:
6120 ++ paths.append(None)
6121 ++ module.dist_paths = paths
6122 ++ file_obj = open(opj(testdir,'libtbx_env'), 'wb')
6123 ++ pickle.dump(env, file_obj, 0)
6124 ++ file_obj.close()
6125 ++
6126 ++class install_lib(_install_lib, Command):
6127 ++ user_options = _install_lib.user_options + [
6128 ++ ('build-temp=', 't',
6129 ++ "directory for temporary files (default: 'build.build-temp')"),
6130 ++ ('prefix=', None, "installation prefix (default: 'install.prefix')"),
6131 ++ ('root=', None,
6132 ++ "install everything relative to this alternate root directory (default: 'install.root')")
6133 ++ ]
6134 ++ def initialize_options(self):
6135 ++ _install_lib.initialize_options(self)
6136 ++ self.build_temp = None
6137 ++ self.prefix = None
6138 ++ self.root = None
6139 ++ def finalize_options(self):
6140 ++ _install_lib.finalize_options(self)
6141 ++ self.set_undefined_options('build',
6142 ++ ('build_temp', 'build_temp'))
6143 ++ self.set_undefined_options('install',
6144 ++ ('prefix', 'prefix'),
6145 ++ ('root', 'root'))
6146 ++ def run(self):
6147 ++ _install_lib.run(self)
6148 ++ if self.root != None:
6149 ++ ip = '--install_destdir'
6150 ++ if ip not in configure_list:
6151 ++ configure_list.extend([ip, self.root])
6152 ++ self.run_scons(scons_installargv)
6153 ++
6154 ++class install_data(_install_data, Command):
6155 ++ user_options = _install_data.user_options + [
6156 ++ ('build-temp=', 't',
6157 ++ "directory for temporary files (default: 'build.build-temp')"),
6158 ++ ('prefix=', None, "installation prefix (default: 'install.prefix')")
6159 ++ ]
6160 ++ def initialize_options(self):
6161 ++ _install_data.initialize_options(self)
6162 ++ self.build_temp = None
6163 ++ self.prefix = None
6164 ++ def finalize_options(self):
6165 ++ _install_data.finalize_options(self)
6166 ++ self.set_undefined_options('build',
6167 ++ ('build_temp', 'build_temp'))
6168 ++ self.set_undefined_options('install',
6169 ++ ('prefix', 'prefix'))
6170 ++ def run(self):
6171 ++ # filter the list
6172 ++ newdf = []
6173 ++ libtbx_env_path = None
6174 ++ for f in self.data_files:
6175 ++ if type(f) is str:
6176 ++ newdf.append(f)
6177 ++ continue
6178 ++ if '%LIBTBXENV%' in f[1]:
6179 ++ f = (f[0], [p for p in f[1] if p != '%LIBTBXENV%'])
6180 ++ libtbx_env_path = opj(convert_path(f[0]), 'libtbx_env')
6181 ++ if not os.path.isabs(libtbx_env_path): # mimic the logic in install_data
6182 ++ libtbx_env_path = opj(self.install_dir, libtbx_env_path)
6183 ++ elif self.root:
6184 ++ libtbx_env_path = change_root(self.root, libtbx_env_path)
6185 ++ # we leave the directory in, so that distutils will create it
6186 ++ newdf.append(f)
6187 ++ self.data_files = newdf
6188 ++ _install_data.run(self)
6189 ++ if libtbx_env_path is not None:
6190 ++ self.install_libtbx_env(libtbx_env_path)
6191 ++ self.outfiles.append(libtbx_env_path)
6192 ++
6193 ++ def install_libtbx_env(self, libtbx_env_path):
6194 ++ """ Modify libtbx_env pickle object to set the correct paths. """
6195 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
6196 ++ os.environ["LIBTBX_BUILD"] = builddir
6197 ++ env = libtbx.env_config.unpickle()
6198 ++ env.build_path = absolute_path(self.prefix)
6199 ++ build_path = env.build_path
6200 ++ python_lib = get_python_lib()
6201 ++ rel_path = opj(python_lib, 'cctbx')
6202 ++ env.bin_path = relocatable_path(build_path, 'bin')
6203 ++ env.lib_path = relocatable_path(build_path, 'lib')
6204 ++ env.include_path = relocatable_path(build_path, 'include')
6205 ++ env.repository_paths = relocatable_path(build_path, rel_path)
6206 ++ env.scons_dist_path = None
6207 ++ env.pythonpath = None
6208 ++ env.exe_path = env.bin_path
6209 ++ env.python_exe = relocatable_path(build_path, sys.executable)
6210 ++ env.path_utility = relocatable_path(build_path,
6211 ++ opj(rel_path, 'libtbx', 'command_line', 'path_utility.py'))
6212 ++ module_dist_paths = {}
6213 ++ for key, value in env.module_dist_paths.items():
6214 ++ head, module = os.path.split(abs(value))
6215 ++ module_dist_paths[key] = relocatable_path(build_path,
6216 ++ opj(rel_path, module))
6217 ++ env.module_dist_paths = module_dist_paths
6218 ++ for module in env.module_list:
6219 ++ paths = []
6220 ++ for path in module.dist_paths:
6221 ++ if path != None:
6222 ++ head, tail = os.path.split(abs(path))
6223 ++ rp = relocatable_path(build_path, opj(rel_path, tail))
6224 ++ paths.append(rp)
6225 ++ else:
6226 ++ paths.append(None)
6227 ++ module.dist_paths = paths
6228 ++ _dispatcher_registry={}
6229 ++ for key, value in env._dispatcher_registry.items():
6230 ++ new_key = relocatable_path(anchor=build_path,
6231 ++ relocatable=key.relocatable)
6232 ++ rel = relpath(abs(value), SRCDIR)
6233 ++ new_val = relocatable_path(anchor=absolute_path(rel_path),
6234 ++ relocatable=rel)
6235 ++ _dispatcher_registry[new_key] = new_val
6236 ++ env._dispatcher_registry = _dispatcher_registry
6237 ++ # install the environment file in the data dir
6238 ++ file_obj = open(libtbx_env_path, 'wb')
6239 ++ pickle.dump(env, file_obj, 0)
6240 ++ file_obj.close()
6241 ++
6242 ++class clean(_clean):
6243 ++ def run(self):
6244 ++ # remove the scons build dir
6245 ++ builddir = opj(os.path.abspath(self.build_temp), 'cctbx-build')
6246 ++ if os.path.exists(builddir):
6247 ++ remove_tree(builddir, dry_run=self.dry_run)
6248 ++ else:
6249 ++ log.debug("'%s' does not exist -- can't clean it",
6250 ++ builddir)
6251 ++ # remove the scons test dir
6252 ++ testdir = opj(os.path.abspath(self.build_temp), 'cctbx-test')
6253 ++ if os.path.exists(testdir):
6254 ++ remove_tree(testdir, dry_run=self.dry_run)
6255 ++ else:
6256 ++ log.debug("'%s' does not exist -- can't clean it",
6257 ++ testdir)
6258 ++ # call the base class to remove the distutils dirs
6259 ++ _clean.run(self)
6260 ++
6261 ++# adapted from setuptools
6262 ++# authors: Phillip J. Eby, Tarek Ziade and the distutils SIG
6263 ++# licence: PSF or ZPL
6264 ++
6265 ++from distutils.util import convert_path
6266 ++import re
6267 ++
6268 ++EXTPAT1 = re.compile(r"^from (\S+_ext) import")
6269 ++EXTPAT2 = re.compile(r"^import (\S+_ext)$")
6270 ++EXTPAT3 = re.compile(r"boost.python.import_ext\(['\"](\S+_ext)['\"]\)$")
6271 ++EXTPAT4 = re.compile(r"import_ext\(['\"](\S+_ext)['\"]\)$") # in module boost.python!
6272 ++
6273 ++def find_packages_and_extensions(where='.', exclude=()):
6274 ++ """Return a list all Python packages found within directory 'where'
6275 ++ and a list all extensions that need to be installed inside those packages
6276 ++
6277 ++ 'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
6278 ++ will be converted to the appropriate local path syntax. 'exclude' is a
6279 ++ sequence of package names to exclude; '*' can be used as a wildcard in the
6280 ++ names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
6281 ++ 'foo' itself).
6282 ++ """
6283 ++ out = []
6284 ++ outext = set()
6285 ++ stack=[(convert_path(where), '')]
6286 ++
6287 ++ while stack:
6288 ++
6289 ++ where,prefix = stack.pop(0)
6290 ++ for name in os.listdir(where):
6291 ++
6292 ++ fn = opj(where,name)
6293 ++ if ('.' not in name and os.path.isdir(fn) and
6294 ++ os.path.isfile(opj(fn,'__init__.py'))
6295 ++ ):
6296 ++
6297 ++ out.append(prefix+name); stack.append((fn,prefix+name+'.'))
6298 ++
6299 ++ if name.endswith('.py'):
6300 ++
6301 ++ f = open(opj(where, name))
6302 ++ for l in f:
6303 ++
6304 ++ m = EXTPAT1.match(l)
6305 ++ if m is not None:
6306 ++ outext.add(m.group(1))
6307 ++
6308 ++ m = EXTPAT2.match(l)
6309 ++ if m is not None:
6310 ++ outext.add(m.group(1))
6311 ++
6312 ++ m = EXTPAT3.search(l)
6313 ++ if m is not None:
6314 ++ outext.add(m.group(1))
6315 ++
6316 ++ if name == 'python.py' and prefix.endswith('boost.'):
6317 ++ m = EXTPAT4.search(l)
6318 ++ if m is not None:
6319 ++ outext.add(m.group(1))
6320 ++
6321 ++ f.close()
6322 ++
6323 ++ for pat in list(exclude)+['ez_setup', 'distribute_setup']:
6324 ++ from fnmatch import fnmatchcase
6325 ++ out = [item for item in out if not fnmatchcase(item,pat)]
6326 ++
6327 ++ return out, list(outext)
6328 +diff --git a/setup.py b/setup.py
6329 +new file mode 100755
6330 +index 0000000..033dc9e
6331 +--- /dev/null
6332 ++++ b/setup.py
6333 +@@ -0,0 +1,142 @@
6334 ++from distutils.core import setup, Extension
6335 ++import sys, os, shutil
6336 ++
6337 ++# General settings
6338 ++opj = os.path.join
6339 ++CURDIR = os.getcwd()
6340 ++SRCDIR = opj(CURDIR, 'cctbx_sources')
6341 ++py_vers = sys.version_info
6342 ++py_major = py_vers[0]
6343 ++py_minor = py_vers[1]
6344 ++py_str = 'python%s.%s'%(py_major, py_minor)
6345 ++clipper = opj('clipper_adaptbx','clipper')
6346 ++boost = opj('boost_adaptbx','boost')
6347 ++libtbx_pypath = opj('libtbx','pythonpath')
6348 ++scons_exe = '/usr/bin/scons' # FIXME platform dependent path
6349 ++scons_path = '/usr/lib/scons/'
6350 ++PATHLIST= [ SRCDIR,
6351 ++ opj(SRCDIR, libtbx_pypath),
6352 ++ opj(SRCDIR, clipper),
6353 ++ opj(SRCDIR, boost),
6354 ++ scons_path,
6355 ++ ]
6356 ++for p in PATHLIST:
6357 ++ if p not in sys.path:
6358 ++ # we need to insert at the front, in case cctbx is already installed
6359 ++ sys.path.insert(0,p)
6360 ++
6361 ++import sconsutils
6362 ++from sconsutils import find_packages_and_extensions, build_ext, build_py, test, install_lib, install_data, clean
6363 ++
6364 ++sconsutils.SRCDIR = SRCDIR
6365 ++
6366 ++# Debian Multiarch magic
6367 ++multiarch = os.environ.get('DEB_HOST_MULTIARCH')
6368 ++libdir = os.environ.get('MULTILIBDIR')
6369 ++if multiarch == None:
6370 ++ multiarch = ''
6371 ++else:
6372 ++ libdir = 'lib/' + multiarch
6373 ++
6374 ++if libdir == None:
6375 ++ libdir = 'lib'
6376 ++# Configure settings
6377 ++# We need this directory to get env_config.cold_start to run!
6378 ++# trailing slash is important
6379 ++init_dir = opj(SRCDIR, 'libtbx')+os.sep # the separator is needed for dirname to do the right thing
6380 ++build_opts = [ '--libtoolize',
6381 ++ '--use_system_libs',
6382 ++ '--use-environment-flags',
6383 ++ '--libdir', libdir,
6384 ++ '--install_prefix', '%PREFIX%', # prefix will be replaced at run time
6385 ++ ]
6386 ++conf_modules = [ 'annlib_adaptbx',
6387 ++ 'boost_adaptbx',
6388 ++ 'cbflib_adaptbx',
6389 ++ 'ccp4io_adaptbx',
6390 ++ 'cctbx',
6391 ++ 'chiltbx',
6392 ++ 'clipper_adaptbx',
6393 ++ 'crys3d',
6394 ++ 'fable',
6395 ++ 'fftw3tbx',
6396 ++ 'gltbx',
6397 ++ 'iotbx',
6398 ++ 'libtbx',
6399 ++ 'mmtbx',
6400 ++ 'omptbx',
6401 ++ 'rstbx',
6402 ++ 'scitbx',
6403 ++ 'smtbx',
6404 ++ 'spotfinder',
6405 ++ 'tbxx',
6406 ++ 'tntbx',
6407 ++ 'ucif',
6408 ++ 'wxtbx',
6409 ++ ]
6410 ++sconsutils.configure_list = [init_dir]
6411 ++sconsutils.configure_list.extend(build_opts)
6412 ++sconsutils.configure_list.extend(conf_modules)
6413 ++
6414 ++# Build settings
6415 ++sconsutils.scons_buildargv = [sys.executable, scons_exe]
6416 ++
6417 ++# Install settings
6418 ++sconsutils.scons_installargv = [sys.executable, scons_exe, 'install']
6419 ++
6420 ++# Setup settings
6421 ++
6422 ++NAME = 'cctbx'
6423 ++VERSION = '2012.05.08.2305'
6424 ++DESCRIPTION = 'cctbx'
6425 ++AUTHOR = 'cctbx'
6426 ++AUTHOR_EMAIL = 'cctbx@×××××××.gov'
6427 ++URL = 'http://cctbx.sourceforge.net/'
6428 ++LICENSE = 'CCTBX 2.0'
6429 ++KEYWORDS = 'crystallography'
6430 ++SCRIPTS = []
6431 ++PKG_DATA = {}
6432 ++EXTRA_PATH = 'cctbx'
6433 ++
6434 ++MODS = ['stdlib']
6435 ++
6436 ++PACKDIR = { 'boost' : 'cctbx_sources/boost_adaptbx/boost', # in setup, paths must stay in unix syntax
6437 ++ 'clipper' : 'cctbx_sources/clipper_adaptbx/clipper', # also, let's keep them relative
6438 ++ 'optik' : 'cctbx_sources/libtbx/pythonpath/optik', # FIXME installs incompatible fork to global path
6439 ++ 'tntbx' : 'cctbx_sources/tntbx/tntbx',
6440 ++ '' : 'cctbx_sources',
6441 ++ }
6442 ++
6443 ++PACKS = []
6444 ++EXT_MODULES = []
6445 ++for key, value in PACKDIR.items():
6446 ++ p, e = find_packages_and_extensions(value)
6447 ++ PACKS.extend(p)
6448 ++ EXT_MODULES.extend(e)
6449 ++ if key != '':
6450 ++ PACKS.append(key)
6451 ++
6452 ++EXT_MODULES = [ Extension(e, ['%SCONSLIB%']) for e in EXT_MODULES ] # special treatment from install_lib
6453 ++
6454 ++setup(name=NAME,
6455 ++ version = VERSION,
6456 ++ author = AUTHOR,
6457 ++ author_email = AUTHOR_EMAIL,
6458 ++ url = URL,
6459 ++ description = DESCRIPTION,
6460 ++ license = LICENSE,
6461 ++ keywords = KEYWORDS,
6462 ++ extra_path = EXTRA_PATH,
6463 ++ scripts = SCRIPTS,
6464 ++ py_modules = MODS,
6465 ++ package_dir = PACKDIR,
6466 ++ packages = PACKS,
6467 ++ ext_modules = EXT_MODULES,
6468 ++ data_files = [('share/cctbx/%s'%(py_str), ['%LIBTBXENV%'])], # special treatment from install_data
6469 ++ cmdclass = {'build_ext': build_ext,
6470 ++ 'build_py': build_py,
6471 ++ 'test': test,
6472 ++ 'install_lib': install_lib,
6473 ++ 'install_data': install_data,
6474 ++ 'clean': clean},
6475 ++ )
6476
6477 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0011-fix-missing-python-lib-during-linking.patch b/sci-libs/cctbx/files/2013.02.27.0005/0011-fix-missing-python-lib-during-linking.patch
6478 new file mode 100644
6479 index 0000000..6724c0c
6480 --- /dev/null
6481 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0011-fix-missing-python-lib-during-linking.patch
6482 @@ -0,0 +1,47 @@
6483 +From: Radostan Riedel <raybuntu@××××××××××.com>
6484 +Date: Thu, 19 Jul 2012 23:26:30 +0200
6485 +Subject: fix missing python lib during linking
6486 +
6487 +---
6488 + cctbx_sources/libtbx/SConscript | 4 ++--
6489 + cctbx_sources/scitbx/boost_python/SConscript | 2 +-
6490 + 2 files changed, 3 insertions(+), 3 deletions(-)
6491 +
6492 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
6493 +index 58bdd30..53e1512 100644
6494 +--- a/cctbx_sources/libtbx/SConscript
6495 ++++ b/cctbx_sources/libtbx/SConscript
6496 +@@ -54,9 +54,11 @@ def set_python_include_and_libs(env_etc):
6497 + env_etc.python_include = libtbx.env_config.python_include_path()
6498 + if (sys.platform == "win32"):
6499 + env_etc.libs_python = ["python" + sys.version[0] + sys.version[2]]
6500 ++ env_etc.py_lib = 'python%s%s'%(sys.version[0], sys.version[2])
6501 + env_etc.libpath_python = [sys.prefix + r"\libs"]
6502 + else:
6503 + env_etc.libs_python = []
6504 ++ env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
6505 + env_etc.libpath_python = []
6506 + if (env_etc.compiler.startswith("darwin_")):
6507 + env_etc.python_framework = "/".join(
6508 +@@ -1034,8 +1036,6 @@ def check_syslib(lib, extra_libs=None):
6509 + return True
6510 + env_etc.check_syslib = check_syslib
6511 +
6512 +-env_etc.py_lib = 'python%s.%s'%(sys.version[0], sys.version[2])
6513 +-
6514 + if (libtbx.env.build_options.use_system_libs):
6515 + env_etc.use_system_libs = True
6516 +
6517 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
6518 +index 1f396e5..b906eb3 100644
6519 +--- a/cctbx_sources/scitbx/boost_python/SConscript
6520 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
6521 +@@ -7,7 +7,7 @@ env_etc.enable_more_warnings(env=env)
6522 + env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
6523 + env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
6524 + env.Append(LIBPATH=env_etc.libpath_python)
6525 +-env.Append(LIBS=[env_etc.boost_python] + env_etc.libs_python)
6526 ++env.Append(LIBS=[env_etc.boost_python] + [env_etc.py_lib,] + env_etc.libs_python)
6527 + env_etc.include_registry.append(
6528 + env=env,
6529 + paths=env_etc.scitbx_common_includes + [env_etc.python_include])
6530
6531 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0012-fix-to-remove-cctbx.python-interpreter.patch b/sci-libs/cctbx/files/2013.02.27.0005/0012-fix-to-remove-cctbx.python-interpreter.patch
6532 new file mode 100644
6533 index 0000000..6fad24f
6534 --- /dev/null
6535 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0012-fix-to-remove-cctbx.python-interpreter.patch
6536 @@ -0,0 +1,20 @@
6537 +From: Radostan Riedel <raybuntu@××××××××××.com>
6538 +Date: Mon, 23 Jul 2012 23:58:46 +0200
6539 +Subject: fix to remove cctbx.python interpreter
6540 +
6541 +---
6542 + cctbx_sources/rstbx/bpcx/uc1_2.py | 2 +-
6543 + cctbx_sources/rstbx/bpcx/uc1_2_reeke.py | 2 +-
6544 + 2 files changed, 2 insertions(+), 2 deletions(-)
6545 +
6546 +diff --git a/cctbx_sources/rstbx/bpcx/uc1_2.py b/cctbx_sources/rstbx/bpcx/uc1_2.py
6547 +index 95ee9cd..1abf8e1 100644
6548 +--- a/cctbx_sources/rstbx/bpcx/uc1_2.py
6549 ++++ b/cctbx_sources/rstbx/bpcx/uc1_2.py
6550 +@@ -1,5 +1,5 @@
6551 + from __future__ import division
6552 +-#!/usr/bin/env cctbx.python
6553 ++#!/usr/bin/env python
6554 + #
6555 + # Biostruct-X Data Reduction Use Case 1.2:
6556 + #
6557
6558 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch b/sci-libs/cctbx/files/2013.02.27.0005/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch
6559 new file mode 100644
6560 index 0000000..8243d93
6561 --- /dev/null
6562 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0013-fix-to-support-LDFLAGS-in-use_enviroment_flags.patch
6563 @@ -0,0 +1,90 @@
6564 +From: Radostan Riedel <raybuntu@××××××××××.com>
6565 +Date: Tue, 24 Jul 2012 17:12:30 +0200
6566 +Subject: fix to support LDFLAGS in use_enviroment_flags
6567 +
6568 +---
6569 + cctbx_sources/libtbx/SConscript | 11 ++++++++++-
6570 + cctbx_sources/libtbx/env_config.py | 7 ++++++-
6571 + 2 files changed, 16 insertions(+), 2 deletions(-)
6572 +
6573 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
6574 +index 53e1512..7d51d4a 100644
6575 +--- a/cctbx_sources/libtbx/SConscript
6576 ++++ b/cctbx_sources/libtbx/SConscript
6577 +@@ -777,11 +777,15 @@ else:
6578 + # user options for any compiler from the environment variables
6579 + # at the time of configure
6580 + opts = libtbx.env.build_options
6581 ++ env_etc.ldflags_base = []
6582 + if( opts.use_environment_flags ):
6583 + print "libtbx.scons: using flags from initial environment: "
6584 + print " CXXFLAGS = ", opts.env_cxxflags
6585 + print " CFLAGS = ", opts.env_cflags
6586 + print " CPPFLAGS = ", opts.env_cppflags
6587 ++ print " LDFLAGS = ", opts.env_ldflags
6588 ++ flg = opts.env_ldflags.split(" ")
6589 ++ env_etc.ldflags_base = flg
6590 + flg = opts.env_cxxflags.split(" ")
6591 + if( hasattr(env_etc, "cxxflags_base") ):
6592 + env_etc.cxxflags_base.extend(flg)
6593 +@@ -853,6 +857,9 @@ def env_base_sync_with_env_etc():
6594 + SHCFLAGS=env_etc.cflags_base,
6595 + SHCCFLAGS=env_etc.ccflags_base,
6596 + SHCXXFLAGS=env_etc.cxxflags_base)
6597 ++ env_base.Prepend(LINKFLAGS=env_etc.ldflags_base)
6598 ++ env_etc.shlinkflags.extend(env_etc.ldflags_base)
6599 ++ env_etc.shlinkflags_bpl.extend(env_etc.ldflags_base)
6600 + env_base_sync_with_env_etc()
6601 +
6602 + if (static_exe):
6603 +@@ -1070,8 +1077,10 @@ def set_libtool(env):
6604 + # for reference. Otherwise it will be set to 0:0:0
6605 + env_etc.shobjsuffix_save = env['SHOBJSUFFIX']
6606 + env_etc.SharedLibBuilder_save = env['BUILDERS']['SharedLibrary']
6607 ++ sh_flg = list(env_etc.ldflags_base)
6608 ++ sh_flg.extend(['-rpath', env_etc.rpath])
6609 + env.Replace(
6610 +- SHLINKFLAGS='-rpath ' + env_etc.rpath,
6611 ++ SHLINKFLAGS=sh_flg,
6612 + SHOBJSUFFIX='.lo',
6613 + SHLIBSUFFIX='.la',
6614 + )
6615 +diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
6616 +index 3d9133e..d8fb063 100644
6617 +--- a/cctbx_sources/libtbx/env_config.py
6618 ++++ b/cctbx_sources/libtbx/env_config.py
6619 +@@ -1803,6 +1803,7 @@ class build_options:
6620 + self.env_cxxflags = ""
6621 + self.env_cflags = ""
6622 + self.env_cppflags = ""
6623 ++ self.env_ldflags = ""
6624 + flg = os.environ.get("CXXFLAGS")
6625 + if flg is not None:
6626 + self.env_cxxflags = flg
6627 +@@ -1812,6 +1813,9 @@ class build_options:
6628 + flg = os.environ.get("CPPFLAGS")
6629 + if flg is not None:
6630 + self.env_cppflags = flg
6631 ++ flg = os.environ.get("LDFLAGS")
6632 ++ if flg is not None:
6633 ++ self.env_ldflags = flg
6634 +
6635 + def report(self, f=None):
6636 + if (f is None): f = sys.stdout
6637 +@@ -1843,6 +1847,7 @@ class build_options:
6638 + print >>f, " CXXFLAGS = ", self.env_cxxflags
6639 + print >>f, " CFLAGS = ", self.env_cflags
6640 + print >>f, " CPPFLAGS = ", self.env_cppflags
6641 ++ print >>f, " LDFLAGS = ", self.env_ldflags
6642 +
6643 + class include_registry:
6644 +
6645 +@@ -2000,7 +2005,7 @@ class pre_process_args:
6646 + action="store_true",
6647 + default=False,
6648 + help="add compiler flags from environment variables: CXXFLAGS, CFLAGS,"
6649 +- " CPPFLAGS")
6650 ++ " CPPFLAGS, LDFLAGS")
6651 + parser.option(None, "--force_32bit",
6652 + action="store_true",
6653 + default=False,
6654
6655 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch b/sci-libs/cctbx/files/2013.02.27.0005/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch
6656 new file mode 100644
6657 index 0000000..c3e357e
6658 --- /dev/null
6659 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0014-Fix-to-append-CPPFLAGS-to-CXXFLAGS.patch
6660 @@ -0,0 +1,21 @@
6661 +From: Radostan Riedel <raybuntu@××××××××××.com>
6662 +Date: Wed, 25 Jul 2012 01:44:36 +0200
6663 +Subject: Fix to append CPPFLAGS to CXXFLAGS.
6664 +
6665 +---
6666 + cctbx_sources/libtbx/SConscript | 2 ++
6667 + 1 file changed, 2 insertions(+)
6668 +
6669 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
6670 +index 7d51d4a..11a7810 100644
6671 +--- a/cctbx_sources/libtbx/SConscript
6672 ++++ b/cctbx_sources/libtbx/SConscript
6673 +@@ -798,6 +798,8 @@ else:
6674 + env_etc.ccflags_base = flg
6675 + flg = opts.env_cppflags.split(" ")
6676 + env_etc.ccflags_base.extend(flg)
6677 ++ # Need to append CPPFLAGS to cxxflags_base too!
6678 ++ env_etc.cxxflags_base.extend(flg)
6679 +
6680 + """ ************************ Custom Builders and Emitters ********************************* """
6681 +
6682
6683 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0016-autogenerate-pkgconfig-files.patch b/sci-libs/cctbx/files/2013.02.27.0005/0016-autogenerate-pkgconfig-files.patch
6684 new file mode 100644
6685 index 0000000..e3ba655
6686 --- /dev/null
6687 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0016-autogenerate-pkgconfig-files.patch
6688 @@ -0,0 +1,305 @@
6689 +From: Radostan Riedel <raybuntu@××××××××××.com>
6690 +Date: Mon, 6 Aug 2012 13:50:30 +0200
6691 +Subject: autogenerate pkgconfig files
6692 +
6693 +---
6694 + cctbx_sources/cctbx/SConscript | 7 ++--
6695 + .../cctbx/sgtbx/direct_space_asu/proto/SConscript | 5 ++-
6696 + cctbx_sources/iotbx/mtz/SConscript | 6 +++-
6697 + cctbx_sources/iotbx/pdb/SConscript | 5 ++-
6698 + cctbx_sources/libtbx/SConscript | 37 +++++++++++++++++++-
6699 + cctbx_sources/mmtbx/masks/SConscript | 5 ++-
6700 + cctbx_sources/omptbx/SConscript | 5 ++-
6701 + cctbx_sources/rstbx/SConscript | 5 ++-
6702 + cctbx_sources/scitbx/boost_python/SConscript | 5 ++-
6703 + cctbx_sources/scitbx/minpack/SConscript | 5 ++-
6704 + cctbx_sources/scitbx/slatec/SConscript | 5 ++-
6705 + .../smtbx/refinement/constraints/SConscript | 5 ++-
6706 + cctbx_sources/spotfinder/SConscript | 5 ++-
6707 + 13 files changed, 86 insertions(+), 14 deletions(-)
6708 +
6709 +diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
6710 +index 6ce770c..378cb36 100644
6711 +--- a/cctbx_sources/cctbx/SConscript
6712 ++++ b/cctbx_sources/cctbx/SConscript
6713 +@@ -96,9 +96,12 @@ lib_cctbx_sources = [
6714 + ]
6715 + if (env_etc.static_libraries): builder = envlm.StaticLibrary
6716 + else: builder = envlm.SharedLibrary
6717 ++name='cctbx'
6718 + builder(
6719 +- target="#lib/cctbx",
6720 +- source=lib_cctbx_sources)
6721 ++ target="#lib/"+name,
6722 ++ source=lib_cctbx_sources)
6723 ++desc='Library for general crystallographic applications'
6724 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6725 +
6726 + SConscript("examples/SConscript")
6727 +
6728 +diff --git a/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript b/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
6729 +index 5a5cfbd..4328794 100644
6730 +--- a/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
6731 ++++ b/cctbx_sources/cctbx/sgtbx/direct_space_asu/proto/SConscript
6732 +@@ -16,9 +16,12 @@ lib_asu_sources = [
6733 + if (env_etc.static_libraries): builder = env.StaticLibrary
6734 + else: builder = env.SharedLibrary
6735 +
6736 ++name='cctbx_sgtbx_asu'
6737 + builder(
6738 +- target="#lib/cctbx_sgtbx_asu",
6739 ++ target="#lib/"+name,
6740 + source=lib_asu_sources)
6741 ++desc='Direct space asymmetric unit class library'
6742 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6743 +
6744 + env = env.Clone()
6745 + env.Prepend(LIBS=["cctbx_sgtbx_asu"])
6746 +diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
6747 +index cd539e6..f7d22b8 100644
6748 +--- a/cctbx_sources/iotbx/mtz/SConscript
6749 ++++ b/cctbx_sources/iotbx/mtz/SConscript
6750 +@@ -9,13 +9,17 @@ env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
6751 + env_etc.enable_more_warnings(env=env)
6752 + if (env_etc.static_libraries): builder = env.StaticLibrary
6753 + else: builder = env.SharedLibrary
6754 ++name='iotbx_mtz'
6755 + builder(
6756 +- target="#lib/iotbx_mtz",
6757 ++ target="#lib/"+name,
6758 + source=[
6759 + "object.cpp",
6760 + "crystal.cpp",
6761 + "dataset.cpp",
6762 + "column.cpp"])
6763 ++desc='Wrapper Library to work with CCP4 MTZ files'
6764 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6765 ++
6766 +
6767 + if (not env_etc.no_boost_python):
6768 + Import("env_iotbx_boost_python_ext")
6769 +diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
6770 +index 9b89fe1..8a83058 100644
6771 +--- a/cctbx_sources/iotbx/pdb/SConscript
6772 ++++ b/cctbx_sources/iotbx/pdb/SConscript
6773 +@@ -9,8 +9,9 @@ env_etc.include_registry.append(
6774 + paths=env_etc.iotbx_common_includes)
6775 + if (env_etc.static_libraries): builder = env.StaticLibrary
6776 + else: builder = env.SharedLibrary
6777 ++name='iotbx_pdb'
6778 + builder(
6779 +- target="#lib/iotbx_pdb",
6780 ++ target="#lib/"+name,
6781 + source=[
6782 + "hybrid_36_c.c",
6783 + "hybrid_36_cpp.cpp",
6784 +@@ -25,6 +26,8 @@ builder(
6785 + "atom_selection.cpp",
6786 + "input.cpp",
6787 + "input_write.cpp"])
6788 ++desc='Fast comprehensive PDB handling library'
6789 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6790 +
6791 + env = env.Clone()
6792 + env_etc.include_registry.append(env=env, paths=[env_etc.fable_include])
6793 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
6794 +index 11a7810..1e91202 100644
6795 +--- a/cctbx_sources/libtbx/SConscript
6796 ++++ b/cctbx_sources/libtbx/SConscript
6797 +@@ -1070,8 +1070,34 @@ env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
6798 + env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
6799 + env_etc.libpath = os.path.abspath(env_etc.install_path + '/' + env_etc.libdir)
6800 + env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
6801 ++env_etc.pkgpath = os.path.join(env_etc.install_path, 'lib/pkgconfig')
6802 + env_etc.rpath = os.path.abspath(env_etc.prefix + '/' + env_etc.libdir)
6803 +
6804 ++def create_pc_file(name, version, desc, requires=None, requires_private=None,
6805 ++ conflicts=None, libs_private=None):
6806 ++ """ Create pkg-config file. """
6807 ++ fpath = '%s/%s.pc'%(abs(libtbx.env.lib_path), name)
6808 ++ pc = open(fpath, 'w')
6809 ++ pc.write('prefix=%s\n'%env_etc.prefix)
6810 ++ pc.write('exec_prefix=${prefix}\n')
6811 ++ pc.write('libdir=${prefix}/%s\n'%env_etc.libdir)
6812 ++ pc.write('includedir=${prefix}/include\n\n')
6813 ++ pc.write('Name: %s\n'%name)
6814 ++ pc.write('Description: %s\n'%desc)
6815 ++ pc.write('Version: %s\n'%version)
6816 ++ if requires != None:
6817 ++ pc.write('Requires: %s\n'%requires)
6818 ++ if requires_private != None:
6819 ++ pc.write('Requires.private: %s\n'%requires_private)
6820 ++ if conflicts != None:
6821 ++ pc.write('Conflicts: %s\n'%conflicts)
6822 ++ pc.write('Libs: -L${libdir} -l%s\n'%name)
6823 ++ if libs_private != None:
6824 ++ pc.write('Libs.private: %s\n'%libs_private)
6825 ++ pc.write('Cflags: -I${includedir}')
6826 ++ pc.close()
6827 ++env_etc.create_pc_file = create_pc_file
6828 ++
6829 + def set_libtool(env):
6830 + # Versioning can be provided by appending "-version-info 3:12:1" to SHLINKFLAGS
6831 + # Please see:
6832 +@@ -1197,6 +1223,11 @@ def create_install_targets():
6833 + src = os.path.join(src_dir, root, filename)
6834 + env_base.Install(dest, src)
6835 + env_base.Alias("install-header", dest)
6836 ++ if re.match('^.*\.pc$', filename, flags=re.IGNORECASE):
6837 ++ dest = os.path.join(env_etc.pkgpath, root)
6838 ++ src = os.path.join(src_dir, root, filename)
6839 ++ env_base.Install(dest, src)
6840 ++ env_base.Alias("install-pkgconfig", dest)
6841 + if src_dir == lib_dir:
6842 + break
6843 +
6844 +@@ -1204,7 +1235,11 @@ def create_install_targets():
6845 + dest = env_etc.binpath
6846 + env_base.Install(dest, Glob('%s/*'%(exe_dev)))
6847 + env_base.Alias("install-bin", dest)
6848 +- Alias('install', ['install-header', 'install-shlib', 'install-bin'])
6849 ++ Alias('install', ['install-header',
6850 ++ 'install-shlib',
6851 ++ 'install-bin',
6852 ++ 'install-pkgconfig',
6853 ++ ])
6854 + os.chdir(cwd)
6855 +
6856 + if 'install' in COMMAND_LINE_TARGETS:
6857 +diff --git a/cctbx_sources/mmtbx/masks/SConscript b/cctbx_sources/mmtbx/masks/SConscript
6858 +index ef93088..a6187cc 100644
6859 +--- a/cctbx_sources/mmtbx/masks/SConscript
6860 ++++ b/cctbx_sources/mmtbx/masks/SConscript
6861 +@@ -13,9 +13,12 @@ lib_sources = [
6862 + if (env_etc.static_libraries): builder = env.StaticLibrary
6863 + else: builder = env.SharedLibrary
6864 +
6865 ++name='mmtbx_masks'
6866 + builder(
6867 +- target="#lib/mmtbx_masks",
6868 ++ target="#lib/"+name,
6869 + source=lib_sources)
6870 ++desc='Masks for bulk solvent modelling'
6871 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6872 +
6873 + env = env.Clone()
6874 + env.Prepend(LIBS=["mmtbx_masks", "iotbx_pdb"])
6875 +diff --git a/cctbx_sources/omptbx/SConscript b/cctbx_sources/omptbx/SConscript
6876 +index 43aac91..76bb923 100644
6877 +--- a/cctbx_sources/omptbx/SConscript
6878 ++++ b/cctbx_sources/omptbx/SConscript
6879 +@@ -12,9 +12,12 @@ env_etc.include_registry.append(
6880 + paths=[env_etc.omptbx_include])
6881 + if (env_etc.static_libraries): builder = env.StaticLibrary
6882 + else: builder = env.SharedLibrary
6883 ++name='omptbx'
6884 + builder(
6885 +- target="#lib/omptbx",
6886 ++ target="#lib/"+name,
6887 + source=["stubs.cpp"])
6888 ++desc='OpenMP interface for CCTBX'
6889 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6890 +
6891 + if (not env_etc.no_boost_python):
6892 + Import("env_boost_python_ext")
6893 +diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
6894 +index e2958a1..6d66476 100644
6895 +--- a/cctbx_sources/rstbx/SConscript
6896 ++++ b/cctbx_sources/rstbx/SConscript
6897 +@@ -26,14 +26,17 @@ env_etc.include_registry.append(
6898 + paths=env_etc.rstbx_common_includes)
6899 + if (env_etc.static_libraries): builder = env.StaticLibrary
6900 + else: builder = env.SharedLibrary
6901 ++name='rstbx'
6902 + builder(
6903 +- target="#lib/rstbx",
6904 ++ target="#lib/"+name,
6905 + source=["dps_core/dps_core.cpp",
6906 + "dps_core/directional_fft.cpp",
6907 + "dps_core/direction.cpp",
6908 + "diffraction/ewald_sphere.cpp",
6909 + "diffraction/partial_spot_position_partial_H.cpp"
6910 + ])
6911 ++desc='Library for calculations in reciprocal space'
6912 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6913 +
6914 + if (not env_etc.no_boost_python):
6915 + Import("env_boost_python_ext")
6916 +diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
6917 +index b906eb3..0b81d9a 100644
6918 +--- a/cctbx_sources/scitbx/boost_python/SConscript
6919 ++++ b/cctbx_sources/scitbx/boost_python/SConscript
6920 +@@ -19,6 +19,9 @@ lib_scitbx_boost_python_sources = [
6921 + ]
6922 + if (env_etc.static_libraries): builder = env.StaticLibrary
6923 + else: builder = env.SharedLibrary
6924 ++name=env_etc.scitbx_boost_python
6925 + builder(
6926 +- target="#lib/%s"%env_etc.scitbx_boost_python,
6927 ++ target="#lib/"+name,
6928 + source=lib_scitbx_boost_python_sources)
6929 ++desc='#TODO'
6930 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6931 +diff --git a/cctbx_sources/scitbx/minpack/SConscript b/cctbx_sources/scitbx/minpack/SConscript
6932 +index 7c325cb..ee7509e 100644
6933 +--- a/cctbx_sources/scitbx/minpack/SConscript
6934 ++++ b/cctbx_sources/scitbx/minpack/SConscript
6935 +@@ -9,7 +9,10 @@ env_etc.include_registry.append(
6936 + env.Append(LIBS=env_etc.libm)
6937 + if (env_etc.static_libraries): builder = env.StaticLibrary
6938 + else: builder = env.SharedLibrary
6939 +-builder(target='#lib/scitbx_minpack', source=["raw.cpp"])
6940 ++name='scitbx_minpack'
6941 ++builder(target='#lib/'+name, source=["raw.cpp"])
6942 ++desc='C++ port of files in MINPACK'
6943 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6944 +
6945 + if (not env_etc.no_boost_python):
6946 + Import("env_scitbx_boost_python_ext")
6947 +diff --git a/cctbx_sources/scitbx/slatec/SConscript b/cctbx_sources/scitbx/slatec/SConscript
6948 +index ca9b6da..39e38e1 100644
6949 +--- a/cctbx_sources/scitbx/slatec/SConscript
6950 ++++ b/cctbx_sources/scitbx/slatec/SConscript
6951 +@@ -6,4 +6,7 @@ env_etc.enable_more_warnings(env=env)
6952 + env.Append(LIBS=env_etc.libm)
6953 + if (env_etc.static_libraries): builder = env.StaticLibrary
6954 + else: builder = env.SharedLibrary
6955 +-builder(target='#lib/scitbx_slatec', source=["lib_c.c"])
6956 ++name='scitbx_slatec'
6957 ++builder(target='#lib/'+name, source=["lib_c.c"])
6958 ++desc='C port of files in SLATEC'
6959 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6960 +diff --git a/cctbx_sources/smtbx/refinement/constraints/SConscript b/cctbx_sources/smtbx/refinement/constraints/SConscript
6961 +index 67d99dc..306d1a4 100644
6962 +--- a/cctbx_sources/smtbx/refinement/constraints/SConscript
6963 ++++ b/cctbx_sources/smtbx/refinement/constraints/SConscript
6964 +@@ -4,7 +4,10 @@ env_etc.include_registry.append(env=env,
6965 + paths=["."] + env_etc.smtbx_common_includes)
6966 + if (env_etc.static_libraries): builder = env.StaticLibrary
6967 + else: builder = env.SharedLibrary
6968 +-builder(target="#lib/smtbx_refinement_constraints", source=Glob("*.cpp"))
6969 ++name='smtbx_refinement_constraints'
6970 ++builder(target="#lib/"+name, source=Glob("*.cpp"))
6971 ++desc='Library for small molecule crystallography constraints'
6972 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6973 +
6974 + env_program = env.Clone()
6975 + env_program.Prepend(LIBS=[ "cctbx", "smtbx_refinement_constraints" ])
6976 +diff --git a/cctbx_sources/spotfinder/SConscript b/cctbx_sources/spotfinder/SConscript
6977 +index 1d73677..a63c6d9 100644
6978 +--- a/cctbx_sources/spotfinder/SConscript
6979 ++++ b/cctbx_sources/spotfinder/SConscript
6980 +@@ -46,9 +46,12 @@ lib_spotfinder_sources = [
6981 +
6982 + if (env_etc.static_libraries): builder = envlm.StaticLibrary
6983 + else: builder = envlm.SharedLibrary
6984 ++name='spotfinder'
6985 + builder(
6986 +- target="#lib/spotfinder",
6987 ++ target="#lib/"+name,
6988 + source=lib_spotfinder_sources)
6989 ++desc='Library for locating Bragg-Spots on x-ray diffraction images'
6990 ++env_etc.create_pc_file(name=name, version='0.0.0', desc=desc)
6991 +
6992 + if (not env_etc.no_boost_python):
6993 + Import("env_no_includes_boost_python_ext")
6994
6995 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0017-Fix-to-use-systems-include-path.patch b/sci-libs/cctbx/files/2013.02.27.0005/0017-Fix-to-use-systems-include-path.patch
6996 new file mode 100644
6997 index 0000000..4affc54
6998 --- /dev/null
6999 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0017-Fix-to-use-systems-include-path.patch
7000 @@ -0,0 +1,128 @@
7001 +From: Radostan Riedel <raybuntu@××××××××××.com>
7002 +Date: Tue, 7 Aug 2012 18:15:43 +0200
7003 +Subject: Fix to use systems include path
7004 +
7005 +---
7006 + .../cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h | 4 ++--
7007 + .../cbflib_adaptbx/detectors/boost_python/general_cbf_write.h | 4 ++--
7008 + cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h | 4 ++--
7009 + .../cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp | 6 +++---
7010 + cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp | 4 ++--
7011 + cctbx_sources/ccp4io_adaptbx/ext.cpp | 2 +-
7012 + cctbx_sources/iotbx/mtz/ext.cpp | 2 +-
7013 + cctbx_sources/iotbx/mtz/object.h | 6 +++---
7014 + 8 files changed, 16 insertions(+), 16 deletions(-)
7015 +
7016 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
7017 +index 66677bd..516b319 100644
7018 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
7019 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/cbf_binary_adaptor.h
7020 +@@ -3,8 +3,8 @@
7021 + #include <cbflib_adaptbx/detectors/cbf_adaptor.h>
7022 + #include <cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h>
7023 + #include <cbflib_adaptbx/detectors/buffer_based_service.h>
7024 +-#include <include/cbf_binary.h>
7025 +-#include <include/cbf_compress.h>
7026 ++#include <cbf/cbf_binary.h>
7027 ++#include <cbf/cbf_compress.h>
7028 +
7029 + namespace iotbx {
7030 + namespace detectors {
7031 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
7032 +index c6c1afb..f45b4d1 100644
7033 +--- a/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
7034 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/boost_python/general_cbf_write.h
7035 +@@ -1,8 +1,8 @@
7036 + #ifndef GENERAL_CBF_WRITE_H
7037 + #define GENERAL_CBF_WRITE_H
7038 + #include <cbflib_adaptbx/detectors/cbf_adaptor.h>
7039 +-#include "cbf_binary.h"
7040 +-#include "cbf_compress.h"
7041 ++#include "cbf/cbf_binary.h"
7042 ++#include "cbf/cbf_compress.h"
7043 +
7044 + namespace iotbx {
7045 + namespace detectors {
7046 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h b/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
7047 +index b5cc407..3787c7b 100644
7048 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
7049 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_adaptor.h
7050 +@@ -8,8 +8,8 @@
7051 + #include <exception>
7052 + #include <scitbx/array_family/flex_types.h>
7053 + #include <scitbx/array_family/versa_matrix.h>
7054 +-#include <include/cbf.h>
7055 +-#include <include/cbf_simple.h>
7056 ++#include <cbf/cbf.h>
7057 ++#include <cbf/cbf_simple.h>
7058 + #include <cbflib_adaptbx/detectors/basic.h>
7059 +
7060 + #undef cbf_failnez
7061 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
7062 +index 2edbfb5..526556f 100644
7063 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
7064 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.cpp
7065 +@@ -244,9 +244,9 @@ extern "C" {
7066 + #include <limits.h>
7067 + #include <ctype.h>
7068 +
7069 +-#include "cbf.h"
7070 +-#include "cbf_file.h"
7071 +-#include "cbf_byte_offset.h"
7072 ++#include "cbf/cbf.h"
7073 ++#include "cbf/cbf_file.h"
7074 ++#include "cbf/cbf_byte_offset.h"
7075 + #include <cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h>
7076 +
7077 + /* Changes made in the byte-offset algorithm
7078 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp b/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
7079 +index 5f5d9b1..d121530 100644
7080 +--- a/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
7081 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/tst_memory.cpp
7082 +@@ -1,5 +1,5 @@
7083 +-#include <include/cbf.h>
7084 +-#include <include/cbf_simple.h>
7085 ++#include <cbf/cbf.h>
7086 ++#include <cbf/cbf_simple.h>
7087 + #include <cstdio>
7088 + #include <string>
7089 + #include <exception>
7090 +diff --git a/cctbx_sources/ccp4io_adaptbx/ext.cpp b/cctbx_sources/ccp4io_adaptbx/ext.cpp
7091 +index ce21568..e507515 100644
7092 +--- a/cctbx_sources/ccp4io_adaptbx/ext.cpp
7093 ++++ b/cctbx_sources/ccp4io_adaptbx/ext.cpp
7094 +@@ -1,5 +1,5 @@
7095 + #include <boost/python.hpp>
7096 +-#include <mmdb_manager.h>
7097 ++#include <mmdb/mmdb_manager.h>
7098 + #include <ssm_align.h>
7099 +
7100 + namespace ccp4io_adaptbx { namespace boost_python {
7101 +diff --git a/cctbx_sources/iotbx/mtz/ext.cpp b/cctbx_sources/iotbx/mtz/ext.cpp
7102 +index b1a0db7..6aa416a 100644
7103 +--- a/cctbx_sources/iotbx/mtz/ext.cpp
7104 ++++ b/cctbx_sources/iotbx/mtz/ext.cpp
7105 +@@ -1,5 +1,5 @@
7106 + #include <boost/python/module.hpp>
7107 +-#include <ccp4_errno.h>
7108 ++#include <ccp4/ccp4_errno.h>
7109 +
7110 + namespace iotbx { namespace mtz { namespace boost_python {
7111 +
7112 +diff --git a/cctbx_sources/iotbx/mtz/object.h b/cctbx_sources/iotbx/mtz/object.h
7113 +index da35fcf..b593534 100644
7114 +--- a/cctbx_sources/iotbx/mtz/object.h
7115 ++++ b/cctbx_sources/iotbx/mtz/object.h
7116 +@@ -6,9 +6,9 @@
7117 + # include <math.h>
7118 + #endif
7119 +
7120 +-#include <cmtzlib.h>
7121 +-#include <ccp4_array.h>
7122 +-#include <ccp4_errno.h>
7123 ++#include <ccp4/cmtzlib.h>
7124 ++#include <ccp4/ccp4_array.h>
7125 ++#include <ccp4/ccp4_errno.h>
7126 + #include <cctbx/sgtbx/space_group.h>
7127 + #include <cctbx/hendrickson_lattman.h>
7128 + #include <boost/shared_ptr.hpp>
7129
7130 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0018-Fix-to-skip-build-of-clipper-examples.patch b/sci-libs/cctbx/files/2013.02.27.0005/0018-Fix-to-skip-build-of-clipper-examples.patch
7131 new file mode 100644
7132 index 0000000..ffd4ebb
7133 --- /dev/null
7134 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0018-Fix-to-skip-build-of-clipper-examples.patch
7135 @@ -0,0 +1,52 @@
7136 +From: Radostan Riedel <raybuntu@××××××××××.com>
7137 +Date: Tue, 7 Aug 2012 18:19:02 +0200
7138 +Subject: Fix to skip build of clipper examples
7139 +
7140 +---
7141 + cctbx_sources/clipper_adaptbx/SConscript | 33 +++++++++++++++---------------
7142 + 1 file changed, 17 insertions(+), 16 deletions(-)
7143 +
7144 +diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
7145 +index c39047f..b0699ad 100644
7146 +--- a/cctbx_sources/clipper_adaptbx/SConscript
7147 ++++ b/cctbx_sources/clipper_adaptbx/SConscript
7148 +@@ -61,22 +61,23 @@ else:
7149 + env_exe = env.Clone()
7150 + env_exe.Prepend(LIBS=[env_etc.clipper_libs[0]])
7151 +
7152 +-exe = env_exe.Program(
7153 +- target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
7154 +- +env["PROGSUFFIX"],
7155 +- source = ["../clipper/examples/symtest.cpp",
7156 +- ])
7157 +-libtbx.env.write_dispatcher_in_bin(
7158 +- source_file=exe[0].get_abspath(),
7159 +- target_file="clipper.symtest")
7160 +-exe = env_exe.Program(
7161 +- target='#exe_dev/'+env["PROGPREFIX"]+'clipper.sanity_check'
7162 +- +env["PROGSUFFIX"],
7163 +- source = ["sanity_check.cpp",
7164 +- ])
7165 +-libtbx.env.write_dispatcher_in_bin(
7166 +- source_file=exe[0].get_abspath(),
7167 +- target_file="clipper.sanity_check")
7168 ++# Skip building clipper examples in Debian
7169 ++#exe = env_exe.Program(
7170 ++# target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
7171 ++# +env["PROGSUFFIX"],
7172 ++# source = ["../clipper/examples/symtest.cpp",
7173 ++# ])
7174 ++#libtbx.env.write_dispatcher_in_bin(
7175 ++# source_file=exe[0].get_abspath(),
7176 ++# target_file="clipper.symtest")
7177 ++#exe = env_exe.Program(
7178 ++# target='#exe_dev/'+env["PROGPREFIX"]+'clipper.sanity_check'
7179 ++# +env["PROGSUFFIX"],
7180 ++# source = ["sanity_check.cpp",
7181 ++# ])
7182 ++#libtbx.env.write_dispatcher_in_bin(
7183 ++# source_file=exe[0].get_abspath(),
7184 ++# target_file="clipper.sanity_check")
7185 +
7186 + if (hasattr(env_etc, "cctbx_include")):
7187 + if (not env_etc.no_boost_python):
7188
7189 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0101-system-cbf.patch b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-cbf.patch
7190 new file mode 100644
7191 index 0000000..1688026
7192 --- /dev/null
7193 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-cbf.patch
7194 @@ -0,0 +1,16 @@
7195 + cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h | 2 +-
7196 + 1 file changed, 1 insertion(+), 1 deletion(-)
7197 +
7198 +diff --git a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
7199 +index 0089325..02234d1 100644
7200 +--- a/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
7201 ++++ b/cctbx_sources/cbflib_adaptbx/detectors/cbf_byte_offset_optimized.h
7202 +@@ -5,7 +5,7 @@
7203 + extern "C" {
7204 + #endif
7205 + #include <stdio.h>
7206 +-#include <include/cbf_file.h>
7207 ++#include <cbf/cbf_file.h>
7208 +
7209 + /* Decompress an array with the byte-offset algorithm */
7210 +
7211
7212 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0101-system-clipper.patch b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-clipper.patch
7213 new file mode 100644
7214 index 0000000..6f50e5f
7215 --- /dev/null
7216 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-clipper.patch
7217 @@ -0,0 +1,185 @@
7218 + cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h | 2 +-
7219 + cctbx_sources/clipper/clipper/contrib/Makefile.dep | 14 +++++++-------
7220 + cctbx_sources/clipper/clipper/contrib/edcalc.cpp | 2 +-
7221 + cctbx_sources/clipper/clipper/contrib/fffear.cpp | 2 +-
7222 + .../clipper/clipper/contrib/function_object_bases.h | 6 +++---
7223 + cctbx_sources/clipper/clipper/contrib/sfcalc.cpp | 2 +-
7224 + cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp | 4 ++--
7225 + cctbx_sources/clipper/clipper/contrib/sfweight.cpp | 4 ++--
7226 + cctbx_sources/clipper/clipper/contrib/skeleton.cpp | 2 +-
7227 + cctbx_sources/clipper_adaptbx/clipper/SConscript | 1 -
7228 + 10 files changed, 19 insertions(+), 20 deletions(-)
7229 +
7230 +diff --git a/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h b/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
7231 +index bd9f7d2..079958d 100644
7232 +--- a/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
7233 ++++ b/cctbx_sources/clipper/clipper/cctbx/clipper_cctbx.h
7234 +@@ -47,7 +47,7 @@
7235 + #define CLIPPER_CCTBX
7236 +
7237 +
7238 +-#include "../core/hkl_datatypes.h"
7239 ++#include "clipper/core/hkl_datatypes.h"
7240 +
7241 + #include <cctbx/sgtbx/space_group.h>
7242 + #include <cctbx/hendrickson_lattman.h>
7243 +diff --git a/cctbx_sources/clipper/clipper/contrib/Makefile.dep b/cctbx_sources/clipper/clipper/contrib/Makefile.dep
7244 +index 98251b1..0fe7bb3 100644
7245 +--- a/cctbx_sources/clipper/clipper/contrib/Makefile.dep
7246 ++++ b/cctbx_sources/clipper/clipper/contrib/Makefile.dep
7247 +@@ -1,27 +1,27 @@
7248 +
7249 +-function_object_bases.h: ../core/hkl_datatypes.h ../core/xmap.h ../core/nxmap_operator.h
7250 ++function_object_bases.h: clipper/core/hkl_datatypes.h clipper/core/xmap.h clipper/core/nxmap_operator.h
7251 +
7252 + function_object_bases.o: function_object_bases.cpp function_object_bases.h
7253 +
7254 + sfcalc.h: function_object_bases.h
7255 +
7256 +-sfcalc.o: sfcalc.cpp sfcalc.h ../core/atomsf.h
7257 ++sfcalc.o: sfcalc.cpp sfcalc.h clipper/core/atomsf.h
7258 +
7259 + edcalc.h: function_object_bases.h
7260 +
7261 +-edcalc.o: edcalc.cpp edcalc.h ../core/atomsf.h
7262 ++edcalc.o: edcalc.cpp edcalc.h clipper/core/atomsf.h
7263 +
7264 + sfcalc_obs.h: function_object_bases.h
7265 +
7266 +-sfcalc_obs.o: sfcalc_obs.cpp sfcalc_obs.h edcalc.h ../core/hkl_compute.h ../core/resol_targetfn.h
7267 ++sfcalc_obs.o: sfcalc_obs.cpp sfcalc_obs.h edcalc.h clipper/core/hkl_compute.h clipper/core/resol_targetfn.h
7268 +
7269 + sfweight.h: function_object_bases.h
7270 +
7271 +-sfweight.o: sfweight.cpp sfweight.h ../core/hkl_operators.h ../core/resol_targetfn.h
7272 ++sfweight.o: sfweight.cpp sfweight.h clipper/core/hkl_operators.h clipper/core/resol_targetfn.h
7273 +
7274 + fffear.h: function_object_bases.h
7275 +
7276 +-fffear.o: fffear.cpp fffear.h ../core/map_interp.h
7277 ++fffear.o: fffear.cpp fffear.h clipper/core/map_interp.h
7278 +
7279 + mapfilter.h: function_object_bases.h
7280 +
7281 +@@ -29,7 +29,7 @@ mapfilter.o: mapfilter.cpp mapfilter.h
7282 +
7283 + skeleton.h: function_object_bases.h
7284 +
7285 +-skeleton.o: skeleton.cpp skeleton.h ../core/map_utils.h
7286 ++skeleton.o: skeleton.cpp skeleton.h clipper/core/map_utils.h
7287 +
7288 + originmatch.h: function_object_bases.h
7289 +
7290 +diff --git a/cctbx_sources/clipper/clipper/contrib/edcalc.cpp b/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
7291 +index f5df7b2..cc031bc 100644
7292 +--- a/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
7293 ++++ b/cctbx_sources/clipper/clipper/contrib/edcalc.cpp
7294 +@@ -43,7 +43,7 @@
7295 +
7296 + #include "edcalc.h"
7297 +
7298 +-#include "../core/atomsf.h"
7299 ++#include "clipper/core/atomsf.h"
7300 +
7301 +
7302 + namespace clipper {
7303 +diff --git a/cctbx_sources/clipper/clipper/contrib/fffear.cpp b/cctbx_sources/clipper/clipper/contrib/fffear.cpp
7304 +index 9a728f7..189855a 100644
7305 +--- a/cctbx_sources/clipper/clipper/contrib/fffear.cpp
7306 ++++ b/cctbx_sources/clipper/clipper/contrib/fffear.cpp
7307 +@@ -42,7 +42,7 @@
7308 +
7309 + #include "fffear.h"
7310 +
7311 +-#include "../core/map_interp.h"
7312 ++#include "clipper/core/map_interp.h"
7313 +
7314 +
7315 + namespace clipper {
7316 +diff --git a/cctbx_sources/clipper/clipper/contrib/function_object_bases.h b/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
7317 +index e6c98c7..4a40c73 100644
7318 +--- a/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
7319 ++++ b/cctbx_sources/clipper/clipper/contrib/function_object_bases.h
7320 +@@ -48,9 +48,9 @@
7321 + #define CLIPPER_FUNCTION_OBJECT_BASES
7322 +
7323 +
7324 +-#include "../core/hkl_datatypes.h"
7325 +-#include "../core/xmap.h"
7326 +-#include "../core/nxmap_operator.h"
7327 ++#include "clipper/core/hkl_datatypes.h"
7328 ++#include "clipper/core/xmap.h"
7329 ++#include "clipper/core/nxmap_operator.h"
7330 +
7331 +
7332 + namespace clipper {
7333 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp b/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
7334 +index 48c0d9c..a3c63f0 100644
7335 +--- a/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
7336 ++++ b/cctbx_sources/clipper/clipper/contrib/sfcalc.cpp
7337 +@@ -43,7 +43,7 @@
7338 +
7339 + #include "sfcalc.h"
7340 +
7341 +-#include "../core/atomsf.h"
7342 ++#include "clipper/core/atomsf.h"
7343 +
7344 +
7345 + namespace clipper {
7346 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp b/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
7347 +old mode 100755
7348 +new mode 100644
7349 +index de47e09..0f67585
7350 +--- a/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
7351 ++++ b/cctbx_sources/clipper/clipper/contrib/sfcalc_obs.cpp
7352 +@@ -43,8 +43,8 @@
7353 +
7354 + #include "sfcalc_obs.h"
7355 + #include "edcalc.h"
7356 +-#include "../core/hkl_compute.h"
7357 +-#include "../core/resol_targetfn.h"
7358 ++#include "clipper/core/hkl_compute.h"
7359 ++#include "clipper/core/resol_targetfn.h"
7360 +
7361 +
7362 + namespace clipper {
7363 +diff --git a/cctbx_sources/clipper/clipper/contrib/sfweight.cpp b/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
7364 +old mode 100755
7365 +new mode 100644
7366 +index 1b2d4dc..6ec98c2
7367 +--- a/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
7368 ++++ b/cctbx_sources/clipper/clipper/contrib/sfweight.cpp
7369 +@@ -42,8 +42,8 @@
7370 +
7371 +
7372 + #include "sfweight.h"
7373 +-#include "../core/hkl_operators.h"
7374 +-#include "../core/resol_targetfn.h"
7375 ++#include "clipper/core/hkl_operators.h"
7376 ++#include "clipper/core/resol_targetfn.h"
7377 +
7378 +
7379 + namespace clipper {
7380 +diff --git a/cctbx_sources/clipper/clipper/contrib/skeleton.cpp b/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
7381 +index bff1049..14ebf55 100644
7382 +--- a/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
7383 ++++ b/cctbx_sources/clipper/clipper/contrib/skeleton.cpp
7384 +@@ -42,7 +42,7 @@
7385 +
7386 + #include "skeleton.h"
7387 +
7388 +-#include "../core/map_utils.h"
7389 ++#include "clipper/core/map_utils.h"
7390 +
7391 +
7392 + namespace clipper {
7393 +diff --git a/cctbx_sources/clipper_adaptbx/clipper/SConscript b/cctbx_sources/clipper_adaptbx/clipper/SConscript
7394 +index 1911eb1..df03808 100644
7395 +--- a/cctbx_sources/clipper_adaptbx/clipper/SConscript
7396 ++++ b/cctbx_sources/clipper_adaptbx/clipper/SConscript
7397 +@@ -11,5 +11,4 @@ env.SharedLibrary(
7398 + "clipper_ext.cpp",
7399 + "hendrickson_lattman_bpl.cpp",
7400 + "sigmaa_bpl.cpp",
7401 +- "../../clipper/clipper/contrib/sfweight.cpp",
7402 + "../../clipper/clipper/cctbx/clipper_cctbx.cpp"]+clipper_contrib_files)
7403
7404 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0101-system-libccp4.patch b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-libccp4.patch
7405 new file mode 100644
7406 index 0000000..16d088d
7407 --- /dev/null
7408 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0101-system-libccp4.patch
7409 @@ -0,0 +1,15 @@
7410 + cctbx_sources/iotbx/mtz/object.cpp | 4 ++--
7411 + 1 file changed, 2 insertions(+), 2 deletions(-)
7412 +
7413 +diff --git a/cctbx_sources/iotbx/mtz/object.cpp b/cctbx_sources/iotbx/mtz/object.cpp
7414 +index c6ce383..1975a44 100644
7415 +--- a/cctbx_sources/iotbx/mtz/object.cpp
7416 ++++ b/cctbx_sources/iotbx/mtz/object.cpp
7417 +@@ -1,5 +1,5 @@
7418 +-#include <cvecmat.h>
7419 +-#include <ccp4_spg.h>
7420 ++#include <ccp4/cvecmat.h>
7421 ++#include <ccp4/ccp4_spg.h>
7422 + #include <scitbx/math/utils.h>
7423 + #include <iotbx/mtz/batch.h>
7424 + #include <iotbx/mtz/column.h>
7425
7426 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0102-dontstrip.patch b/sci-libs/cctbx/files/2013.02.27.0005/0102-dontstrip.patch
7427 new file mode 100644
7428 index 0000000..08118f4
7429 --- /dev/null
7430 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0102-dontstrip.patch
7431 @@ -0,0 +1,25 @@
7432 + cctbx_sources/libtbx/SConscript | 4 ++--
7433 + 1 file changed, 2 insertions(+), 2 deletions(-)
7434 +
7435 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
7436 +index debf569..46ab8d8 100644
7437 +--- a/cctbx_sources/libtbx/SConscript
7438 ++++ b/cctbx_sources/libtbx/SConscript
7439 +@@ -471,7 +471,7 @@ libtbx.scons: Warning: compiling with /MDd:
7440 + elif libtbx.env.build_options.debug_symbols:
7441 + lkfl = ["-rdynamic"]
7442 + else:
7443 +- lkfl = ["-s"]
7444 ++ lkfl = []
7445 + env_etc.shlinkflags = ["-shared"]
7446 + if (libtbx.env.build_options.mode == "profile"):
7447 + env_base.Prepend(LINKFLAGS=["-pg"])
7448 +@@ -589,7 +589,7 @@ else:
7449 + lkfl = ["-rdynamic"]
7450 +
7451 + else:
7452 +- lkfl = ["-s"]
7453 ++ lkfl = []
7454 + env_etc.shlinkflags = ["-shared"]
7455 + if (libtbx.env.build_options.mode == "profile"):
7456 + env_base.Prepend(LINKFLAGS=["-pg"])
7457
7458 diff --git a/sci-libs/cctbx/files/2013.02.27.0005/0103-respect-cflags.patch b/sci-libs/cctbx/files/2013.02.27.0005/0103-respect-cflags.patch
7459 new file mode 100644
7460 index 0000000..60a3c5b
7461 --- /dev/null
7462 +++ b/sci-libs/cctbx/files/2013.02.27.0005/0103-respect-cflags.patch
7463 @@ -0,0 +1,60 @@
7464 + cctbx_sources/libtbx/SConscript | 17 ++++++-----------
7465 + 1 file changed, 6 insertions(+), 11 deletions(-)
7466 +
7467 +diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
7468 +index c273536..a70dae8 100644
7469 +--- a/cctbx_sources/libtbx/SConscript
7470 ++++ b/cctbx_sources/libtbx/SConscript
7471 +@@ -120,7 +120,7 @@ def patch_scons_env_for_ad_hoc_debug(env, O123_replacement=["-O0", "-g"]):
7472 + for f in env[kw]:
7473 + if (f in ["-O1", "-O2", "-O3"]):
7474 + dbg_ccflags.extend(O123_replacement)
7475 +- elif (f not in ["-ffast-math", "-funroll-loops"]):
7476 ++ elif (f not in []):
7477 + dbg_ccflags.append(f)
7478 + env.Replace(**{kw: dbg_ccflags})
7479 + env_etc.patch_scons_env_for_ad_hoc_debug = patch_scons_env_for_ad_hoc_debug
7480 +@@ -453,9 +453,9 @@ libtbx.scons: Warning: compiling with /MDd:
7481 + warn_options = gcc_common_warn_options() + ["-Werror"]
7482 + env_etc.ccflags_base.extend(warn_options)
7483 + if (libtbx.env.build_options.optimization):
7484 +- opts = ["-DNDEBUG", "-O3", "-ffast-math"]
7485 ++ opts = ["-DNDEBUG"]
7486 + if (env_etc.gcc_version >= 40100 and is_64bit_architecture):
7487 +- opts.insert(2, "-funroll-loops")
7488 ++ opts.insert(2, )
7489 + else:
7490 + opts = ["-O0", "-fno-inline"]
7491 + if (libtbx.env.build_options.mode == "profile"):
7492 +@@ -565,9 +565,7 @@ else:
7493 + warn_options = gcc_common_warn_options() + ["-Werror"]
7494 + env_etc.ccflags_base.extend(warn_options)
7495 + if (libtbx.env.build_options.optimization):
7496 +- opts = ["-DNDEBUG", "-O3", "-ffast-math"]
7497 +- if (env_etc.gcc_version >= 40100 and is_64bit_architecture):
7498 +- opts.insert(2, "-funroll-loops")
7499 ++ opts = ["-DNDEBUG"]
7500 + else:
7501 + opts = ["-O0", "-fno-inline"]
7502 + if (libtbx.env.build_options.mode == "profile"):
7503 +@@ -633,10 +631,7 @@ int main() {
7504 + env_etc.cxxflags_base = []
7505 + setup_clang_warning(env_etc, libtbx.env.build_options.warning_level)
7506 + if (libtbx.env.build_options.optimization):
7507 +- opts = [
7508 +- "-DNDEBUG",
7509 +- "-O3",
7510 +- "-ffast-math"]
7511 ++ opts = ["-DNDEBUG"]
7512 + else:
7513 + opts = ["-O0", "-fno-inline"]
7514 + if (libtbx.env.build_options.debug_symbols):
7515 +@@ -782,7 +777,7 @@ int main() {
7516 + env_etc.cxxflags_base.append("-fcoalesce-templates")
7517 + env_etc.cxxflags_base.append("-DBOOST_ALL_NO_LIB")
7518 + if (libtbx.env.build_options.optimization):
7519 +- opts = ["-DNDEBUG", "-O3", "-ffast-math"]
7520 ++ opts = ["-DNDEBUG"]
7521 + if (cxx == "c++" and env_etc.gcc_version
7522 + and env_etc.gcc_version == 40000):
7523 + opts[1] = "-O2" # Apple's optimizer is broken
7524
7525 diff --git a/sci-libs/cctbx/metadata.xml b/sci-libs/cctbx/metadata.xml
7526 new file mode 100644
7527 index 0000000..a259ded
7528 --- /dev/null
7529 +++ b/sci-libs/cctbx/metadata.xml
7530 @@ -0,0 +1,18 @@
7531 +<?xml version="1.0" encoding="UTF-8"?>
7532 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
7533 +<pkgmetadata>
7534 + <herd>sci-chemistry</herd>
7535 + <maintainer>
7536 + <email>jlec@g.o</email>
7537 + <name>Justin Lecher (jlec)</name>
7538 + </maintainer>
7539 + <longdescription>
7540 + The Computational Crystallography Toolbox (cctbx) is being developed
7541 + as the open source component of the PHENIX system. The goal of
7542 + the PHENIX project is to advance automation of macromolecular structure
7543 + determination. PHENIX depends on the cctbx, but not vice versa. This
7544 + hierarchical approach enforces a clean design as a reusable library.
7545 + The cctbx is therefore also useful for small-molecule crystallography
7546 + and even general scientific applications.
7547 + </longdescription>
7548 +</pkgmetadata>