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: ChangeLog cctbx-2010.03.29.2334-r5.ebuild
Date: Sun, 04 Dec 2011 19:04:10
Message-Id: 20111204190325.4B7642004C@flycatcher.gentoo.org
1 jlec 11/12/04 19:03:25
2
3 Modified: ChangeLog
4 Added: cctbx-2010.03.29.2334-r5.ebuild
5 Log:
6 Create soname symlink, streamelined find and delete of unwanted files
7
8 (Portage version: 2.2.0_alpha79/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.21 sci-libs/cctbx/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?rev=1.21&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?rev=1.21&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/ChangeLog?r1=1.20&r2=1.21
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v
20 retrieving revision 1.20
21 retrieving revision 1.21
22 diff -u -r1.20 -r1.21
23 --- ChangeLog 7 Oct 2011 09:52:42 -0000 1.20
24 +++ ChangeLog 4 Dec 2011 19:03:25 -0000 1.21
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sci-libs/cctbx
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.20 2011/10/07 09:52:42 jlec Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.21 2011/12/04 19:03:25 jlec Exp $
30 +
31 +*cctbx-2010.03.29.2334-r5 (04 Dec 2011)
32 +
33 + 04 Dec 2011; Justin Lecher <jlec@g.o>
34 + +cctbx-2010.03.29.2334-r5.ebuild:
35 + Create soname symlink, streamelined find and delete of unwanted files
36
37 07 Oct 2011; Justin Lecher <jlec@g.o> cctbx-2010.03.29.2334-r3.ebuild,
38 cctbx-2010.03.29.2334-r4.ebuild, metadata.xml:
39
40
41
42 1.1 sci-libs/cctbx/cctbx-2010.03.29.2334-r5.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r5.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r5.ebuild?rev=1.1&content-type=text/plain
46
47 Index: cctbx-2010.03.29.2334-r5.ebuild
48 ===================================================================
49 # Copyright 1999-2011 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/cctbx-2010.03.29.2334-r5.ebuild,v 1.1 2011/12/04 19:03:25 jlec Exp $
52
53 EAPI="3"
54
55 PYTHON_DEPEND="2"
56
57 inherit eutils fortran-2 prefix python toolchain-funcs
58
59 MY_PV="${PV//./_}"
60
61 DESCRIPTION="Computational Crystallography Toolbox"
62 HOMEPAGE="http://cctbx.sourceforge.net/"
63 SRC_URI="http://cci.lbl.gov/cctbx_build/results/${MY_PV}/${PN}_bundle.tar.gz -> ${P}.tar.gz"
64
65 LICENSE="cctbx-2.0"
66 SLOT="0"
67 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
68 IUSE="+minimal openmp threads"
69
70 RDEPEND="
71 virtual/fortran
72 >dev-libs/boost-1.39[python]
73 sci-libs/clipper
74 sci-libs/fftw
75 !minimal? (
76 sci-chemistry/cns
77 sci-chemistry/shelx )"
78 DEPEND="${RDEPEND}
79 >=dev-util/scons-1.2"
80
81 S="${WORKDIR}"
82 MY_S="${WORKDIR}"/cctbx_sources
83 MY_B="${WORKDIR}"/cctbx_build
84
85 pkg_setup() {
86 use openmp && FORTRAN_NEED_OPENMP="1"
87 fortran-2_pkg_setup
88 if use openmp && ! tc-has-openmp; then
89 ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 and icc"
90 ewarn "If you want to build ${PN} with OpenMP, abort now,"
91 ewarn "and switch CC to an OpenMP capable compiler"
92 fi
93 python_set_active_version 2
94 }
95
96 src_prepare() {
97 local opts
98 local optsld
99
100 epatch \
101 "${FILESDIR}"/${PV}-tst_server.py.patch \
102 "${FILESDIR}"/${PV}-boost.patch \
103 "${FILESDIR}"/${PV}-clipper.patch \
104 "${FILESDIR}"/${PV}-flags.patch \
105 "${FILESDIR}"/${PV}-soname.patch \
106 "${FILESDIR}"/${PV}-gcc-4.6.patch
107
108 eprefixify "${MY_S}"/scitbx/libtbx_refresh.py
109
110 rm -rf "${MY_S}/scons" "${MY_S}/boost" "${MY_S}/PyCifRW" || die
111 find "${MY_S}/clipper" -name "*.h" -delete || die
112
113 echo "import os, sys; os.execvp('scons', sys.argv)" > "${MY_S}"/libtbx/command_line/scons.py
114 }
115
116 src_configure() {
117 local compiler
118 local myconf
119
120 myconf="${MY_S}/libtbx/configure.py"
121
122 compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
123 myconf="${myconf} --compiler=${compiler}"
124
125 # Additional USE flag usage
126 check_use openmp
127 myconf="${myconf} --enable-openmp-if-possible=${USE_openmp}"
128
129 use threads && USEthreads="--enable-boost-threads" && \
130 ewarn "If using boost threads openmp support is disabled"
131
132 myconf="${myconf} ${USE_threads} --scan-boost --use_environment_flags"
133
134 mkdir "${MY_B}" && myconf="${myconf} --current_working_directory=${MY_B}"
135 cd "${MY_B}"
136
137 myconf="${myconf} --build=release fftw3tbx rstbx smtbx mmtbx clipper_adaptbx fable"
138 einfo "configuring with ${python} ${myconf}"
139
140 $(PYTHON) ${myconf} || die "configure failed"
141 }
142
143 src_compile() {
144 local makeopts_exp
145
146 cd "${MY_B}"
147
148 makeopts_exp=${MAKEOPTS/j/j }
149 makeopts_exp=${makeopts_exp%-l[0-9]*}
150
151 source setpaths_all.sh
152
153 einfo "compiling with libtbx.scons ${makeopts_exp}"
154 libtbx.scons ${makeopts_exp} .|| die "make failed"
155 }
156
157 src_test(){
158 source "${MY_B}"/setpaths_all.sh
159 libtbx.python $(libtbx.show_dist_paths boost_adaptbx)/tests/tst_rational.py && \
160 libtbx.python ${SCITBX_DIST}/run_tests.py ${MAKEOPTS_EXP} && \
161 libtbx.python ${CCTBX_DIST}/run_tests.py ${MAKEOPTS_EXP} \
162 || die "test failed"
163 }
164
165 src_install(){
166 local lib baselib
167 # find cctbx_build/ -type f \( -name "*.py" -o -name "*sh" \) -exec \
168 # sed -e "s:${MY_S}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_sources:g" \
169 # -e "s:${MY_B}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build:g" \
170 # -i '{}' \; || die "Fail to correct path"
171
172 sed \
173 -e "s:${MY_B}:${EPREFIX}/usr:g" \
174 -e "s:${MY_S}:${EPREFIX}/$(python_get_sitedir):g" \
175 -i "${MY_B}/libtbx_env" || die
176
177 insinto /usr/share/cctbx
178 doins "${MY_B}/libtbx_env" || die
179
180 ebegin "removing unnessary files"
181 rm -r "${S}"/cctbx_sources/{clipper,ccp4io,ucs-fonts,TAG} || die "failed to remove uneeded scons"
182 find -O3 "${S}" -type f \
183 \( -name "*conftest*" -o -name "*.o" -o -name "*.c" -o -name "*.f" -o -name "*.cpp" -o \
184 -name "*.pyc" -o -name "SCons*" -o -name "Makefile" -o -name "config.log" \) -delete || die
185 find "${S}" -type d -empty -delete || die
186 find "${MY_B}" -maxdepth 1 -type f -delete || die
187 eend
188
189 dobin "${MY_B}"/bin/* || die
190 rm -rf "${MY_B}/bin"
191 dolib.so "${MY_B}"/lib/lib* || die
192 mv "${ED}"/usr/$(get_libdir)/libscitbx_min{,i}pack.so || die
193 rm -f "${MY_B}"/lib/lib*
194
195 for lib in "${ED}"/usr/$(get_libdir)/*.so; do
196 baselib=$(basename ${lib})
197 mv ${lib}{,.0.0}
198 dosym ${baselib}.0.0 /usr/$(get_libdir)/${baselib}
199 done
200
201 insinto /usr/include
202 doins -r "${MY_B}"/include/* || die
203 rm -rf "${MY_B}/include"
204
205 insinto /usr/libexec/${PN}
206 doins -r "${MY_B}"/* || die
207 find "${ED}"/usr/libexec/${PN} -type f -exec chmod 755 '{}' \;
208
209 cd "${MY_S}"
210 insinto $(python_get_sitedir)
211 doins -r * || die
212 exeinto $(python_get_sitedir)
213 doexe "${MY_B}"/lib/* || die
214 rm -rf "${MY_B}/lib"
215
216 sed \
217 -e "/PYTHONPATH/s:${MY_S}:$(python_get_sitedir):g" \
218 -e "/PYTHONPATH/s:${MY_B}:$(python_get_sitedir):g" \
219 -e "/LD_LIBRARY_PATH/s:${MY_B}/lib:${EPREFIX}/usr/$(get_libdir):g" \
220 -e "/PATH/s:${MY_B}/bin:${EPREFIX}/usr/bin:g" \
221 -e "/PATH/s:${MY_B}/exe:${EPREFIX}/usr/bin:g" \
222 -e "/exec/s:${MY_S}:$(python_get_sitedir):g" \
223 -e "/LIBTBX_BUILD/s:${MY_B}:${EPREFIX}/usr/share/cctbx:g" \
224 -e "s:${MY_B}/exe_dev/:${EPREFIX}/usr/libexec/${PN}/exe_dev/:g" \
225 -i "${ED}"/usr/bin/* || die
226
227 }
228
229 pkg_postinst () {
230 python_mod_optimize boost_adaptbx cbflib_adaptbx ccp4io_adaptbx cctbx chiltbx clipper_adaptbx crys3d fable fftw3tbx gltbx iotbx libtbx mmtbx omptbx rstbx scitbx smtbx spotfinder tntbx
231 }
232
233 pkg_postrm () {
234 python_mod_cleanup boost_adaptbx cbflib_adaptbx ccp4io_adaptbx cctbx chiltbx clipper_adaptbx crys3d fable fftw3tbx gltbx iotbx libtbx mmtbx omptbx rstbx scitbx smtbx spotfinder tntbx
235 }
236
237 check_use() {
238 for var in $@; do
239 if use ${var}; then
240 printf -v "USE_$var" True
241 else
242 printf -v "USE_$var" False
243 fi
244 shift
245 done
246 }