Gentoo Archives: gentoo-commits

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