/[gentoo-x86]/sci-chemistry/ccpn/ccpn-2.1.5_p120304.ebuild
Gentoo

Contents of /sci-chemistry/ccpn/ccpn-2.1.5_p120304.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Apr 3 17:24:27 2012 UTC (2 years, 5 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
sci-chemistry/ccpn: Cleaned old, add latest python patches

(Portage version: 2.2.0_alpha99/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ccpn/ccpn-2.1.5_p120304.ebuild,v 1.1 2012/03/04 09:18:53 jlec Exp $
4
5 EAPI="3"
6
7 PYTHON_DEPEND="2:2.5"
8 PYTHON_USE_WITH="ssl tk"
9
10 inherit eutils portability python toolchain-funcs versionator
11
12 PATCHSET="${PV##*_p}"
13 MY_PN="${PN}mr"
14 MY_PV="$(replace_version_separator 3 _ ${PV%%_p*})"
15 MY_MAJOR="$(get_version_component_range 1-3)"
16
17 DESCRIPTION="The Collaborative Computing Project for NMR"
18 HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
19 SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
20 [[ -n ${PATCHSET} ]] && SRC_URI="${SRC_URI} http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
21
22 SLOT="0"
23 LICENSE="|| ( CCPN LGPL-2.1 )"
24 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
25 IUSE="extendnmr +opengl"
26
27 RDEPEND="
28 dev-lang/tk[threads]
29 >=dev-python/numpy-1.4
30 >=dev-tcltk/tix-8.4.3
31 =sci-libs/ccpn-data-"${MY_MAJOR}"*
32 >=sci-libs/ccpn-data-2.1.5_p111011
33 sci-biology/psipred
34 x11-libs/libXext
35 x11-libs/libX11
36 opengl? (
37 media-libs/freeglut
38 dev-python/pyglet )"
39 # We need to fix this
40 # sci-chemistry/mdd
41 DEPEND="${RDEPEND}"
42 PDEPEND="
43 extendnmr? (
44 <=sci-chemistry/aria-2.3.2
45 sci-chemistry/prodecomp )"
46
47 RESTRICT="mirror"
48
49 S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2 ${PV})
50
51 pkg_setup() {
52 python_set_active_version 2
53 }
54
55 src_prepare() {
56 [[ -n ${PATCHSET} ]] && \
57 epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
58
59 epatch "${FILESDIR}"/${MY_PV}-parallel.patch
60
61 sed \
62 -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
63 -e "s:weights_s:weights:g" \
64 -i python/ccpnmr/analysis/wrappers/Psipred.py || die
65
66 local tk_ver
67 local myconf
68
69 tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
70
71 if use opengl; then
72 GLUT_NEED_INIT="-DNEED_GLUT_INIT"
73 IGNORE_GL_FLAG=""
74 GL_FLAG="-DUSE_GL_TRUE"
75 GL_DIR="${EPREFIX}/usr"
76 GL_LIB="-lglut -lGLU -lGL"
77 GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
78 GL_LIB_FLAGS="-L\$(GL_DIR)/$(get_libdir)"
79
80 else
81 IGNORE_GL_FLAG="-DIGNORE_GL"
82 GL_FLAG="-DUSE_GL_FALSE"
83 fi
84
85 GLUT_NOT_IN_GL=""
86 GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
87
88 rm -rf data model doc license || die
89
90 sed \
91 -e "s|/usr|${EPREFIX}/usr|g" \
92 -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
93 -e "s|^\(OPT_FLAG =\).*|\1 ${CFLAGS}|g" \
94 -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
95 -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
96 -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
97 -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
98 -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
99 -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
100 -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
101 -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
102 -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
103 -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
104 -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
105 -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
106 -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I${EPREFIX}/$(python_get_includedir)|g" \
107 -e "s|^\(PYTHON_LIB =\).*|\1 $(python_get_library -l)|g" \
108 c/environment_default.txt > c/environment.txt
109 }
110
111 src_compile() {
112 emake -C c all links || die
113 }
114
115 src_install() {
116 local libdir
117 local tkver
118 local _wrapper
119
120 find . -name "*.pyc" -type d -delete
121
122 libdir=$(get_libdir)
123 tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
124
125 _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara"
126 use extendnmr && _wrapper="${_wrapper} extendNmr"
127 for wrapper in ${_wrapper}; do
128 sed \
129 -e "s|gentoo_sitedir|${EPREFIX}$(python_get_sitedir)|g" \
130 -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
131 -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
132 -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
133 -e "s|gentoopython|${EPREFIX}/usr/bin/python|g" \
134 -e "s|gentoousr|${EPREFIX}/usr|g" \
135 -e "s|//|/|g" \
136 "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
137 dobin "${T}"/${wrapper} || die "Failed to install ${wrapper}"
138 done
139
140 local in_path
141 local files
142 local pydocs
143
144 pydocs="$(find python -name doc -type d)"
145 rm -rf ${pydocs} || die
146
147 in_path=$(python_get_sitedir)/${PN}
148
149 for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
150 sed \
151 -e 's|#from __future__|from __future__|g' \
152 -i ${i} || die
153 done
154
155 insinto ${in_path}
156
157 dodir ${in_path}/c
158
159 ebegin "Installing main files"
160 doins -r python || die "main files installation failed"
161 eend
162
163 einfo "Adjusting permissions"
164
165 files="
166 cambridge/c/BayesPeakSeparator.so
167 ccp/c/StructUtil.so
168 ccp/c/StructStructure.so
169 ccp/c/StructBond.so
170 ccp/c/StructAtom.so
171 ccpnmr/c/DyAtomCoord.so
172 ccpnmr/c/DyDistConstraint.so
173 ccpnmr/c/DyDistForce.so
174 ccpnmr/c/AtomCoordList.so
175 ccpnmr/c/DyAtomCoordList.so
176 ccpnmr/c/ContourStyle.so
177 ccpnmr/c/ContourLevels.so
178 ccpnmr/c/SliceFile.so
179 ccpnmr/c/PeakCluster.so
180 ccpnmr/c/Dynamics.so
181 ccpnmr/c/Bacus.so
182 ccpnmr/c/Midge.so
183 ccpnmr/c/DyDistConstraintList.so
184 ccpnmr/c/WinPeakList.so
185 ccpnmr/c/PeakList.so
186 ccpnmr/c/DistConstraint.so
187 ccpnmr/c/CloudUtil.so
188 ccpnmr/c/DistForce.so
189 ccpnmr/c/DistConstraintList.so
190 ccpnmr/c/AtomCoord.so
191 ccpnmr/c/DyDynamics.so
192 ccpnmr/c/ContourFile.so
193 memops/c/ShapeFile.so
194 memops/c/BlockFile.so
195 memops/c/PdfHandler.so
196 memops/c/MemCache.so
197 memops/c/FitMethod.so
198 memops/c/PsHandler.so
199 memops/c/GlHandler.so
200 memops/c/StoreFile.so
201 memops/c/StoreHandler.so
202 memops/c/TkHandler.so"
203 for FILE in ${files}; do
204 fperms 755 ${in_path}/python/${FILE}
205 done
206 }
207
208 pkg_postinst() {
209 python_mod_optimize ${PN}
210 }
211
212 pkg_postrm() {
213 python_mod_cleanup ${PN}
214 }

  ViewVC Help
Powered by ViewVC 1.1.20