/[gentoo-x86]/sci-chemistry/ccpn/ccpn-2.2.2_p130213.ebuild
Gentoo

Contents of /sci-chemistry/ccpn/ccpn-2.2.2_p130213.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Feb 13 11:56:42 2013 UTC (3 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
sci-chemistry/ccpn: Todays Python patches

(Portage version: 2.2.0_alpha162/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2013 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.2.2_p130116.ebuild,v 1.1 2013/01/16 11:43:05 jlec Exp $
4
5 EAPI=5
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} ]] \
21 && SRC_URI+=" http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
22
23 SLOT="0"
24 LICENSE="|| ( CCPN LGPL-2.1 )"
25 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
26 IUSE="+opengl"
27
28 RDEPEND="
29 dev-lang/tk[threads]
30 dev-python/numpy
31 dev-tcltk/tix
32 =sci-libs/ccpn-data-"${MY_MAJOR}"*
33 sci-biology/psipred
34 x11-libs/libXext
35 x11-libs/libX11
36 opengl? (
37 media-libs/freeglut
38 dev-python/pyglet )"
39 DEPEND="${RDEPEND}"
40
41 RESTRICT="mirror"
42
43 S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2 ${PV})
44
45 pkg_setup() {
46 python_set_active_version 2
47 python_pkg_setup
48 }
49
50 src_prepare() {
51 [[ -n ${PATCHSET} ]] && \
52 epatch "${WORKDIR}"/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch
53
54 epatch "${FILESDIR}"/${MY_PV}-parallel.patch
55
56 sed \
57 -e "/PSIPRED_DIR/s:'data':'share/psipred/data':g" \
58 -e "s:weights_s:weights:g" \
59 -i python/ccpnmr/analysis/wrappers/Psipred.py || die
60
61 local tk_ver
62 local myconf
63
64 tk_ver="$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)"
65
66 if use opengl; then
67 GLUT_NEED_INIT="-DNEED_GLUT_INIT"
68 IGNORE_GL_FLAG=""
69 GL_FLAG="-DUSE_GL_TRUE"
70 GL_DIR="${EPREFIX}/usr"
71 GL_LIB="-lglut -lGLU -lGL"
72 GL_INCLUDE_FLAGS="-I\$(GL_DIR)/include"
73 GL_LIB_FLAGS="-L\$(GL_DIR)/$(get_libdir)"
74
75 else
76 IGNORE_GL_FLAG="-DIGNORE_GL"
77 GL_FLAG="-DUSE_GL_FALSE"
78 fi
79
80 GLUT_NOT_IN_GL=""
81 GLUT_FLAG="\$(GLUT_NEED_INIT) \$(GLUT_NOT_IN_GL)"
82
83 rm -rf data model doc license || die
84
85 sed \
86 -e "s|/usr|${EPREFIX}/usr|g" \
87 -e "s|^\(CC =\).*|\1 $(tc-getCC)|g" \
88 -e "s|^\(OPT_FLAG =\).*|\1 ${CFLAGS}|g" \
89 -e "s|^\(LINK_FLAGS =.*\)|\1 ${LDFLAGS}|g" \
90 -e "s|^\(IGNORE_GL_FLAG =\).*|\1 ${IGNORE_GL_FLAG}|g" \
91 -e "s|^\(GL_FLAG =\).*|\1 ${GL_FLAG}|g" \
92 -e "s|^\(GL_DIR =\).*|\1 ${GL_DIR}|g" \
93 -e "s|^\(GL_LIB =\).*|\1 ${GL_LIB}|g" \
94 -e "s|^\(GL_LIB_FLAGS =\).*|\1 ${GL_LIB_FLAGS}|g" \
95 -e "s|^\(GL_INCLUDE_FLAGS =\).*|\1 ${GL_INCLUDE_FLAGS}|g" \
96 -e "s|^\(GLUT_NEED_INIT =\).*|\1 ${GLUT_NEED_INIT}|g" \
97 -e "s|^\(GLUT_NOT_IN_GL =\).*|\1|g" \
98 -e "s|^\(X11_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
99 -e "s|^\(TCL_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
100 -e "s|^\(TK_LIB =\).*|\1 -ltk|g" \
101 -e "s|^\(TK_LIB_FLAGS =\).*|\1 -L${EPREFIX}/usr/$(get_libdir)|g" \
102 -e "s|^\(PYTHON_INCLUDE_FLAGS =\).*|\1 -I${EPREFIX}/$(python_get_includedir)|g" \
103 -e "s|^\(PYTHON_LIB =\).*|\1 $(python_get_library -l)|g" \
104 c/environment_default.txt > c/environment.txt || die
105
106 sed \
107 -e 's:ln -s:cp -f:g' \
108 -i $(find python -name linkSharedObjs) || die
109 }
110
111 src_compile() {
112 emake -C c all
113 emake -C c links
114 }
115
116 src_install() {
117 local libdir
118 local tkver
119 local _wrapper
120
121 find . -name "*.pyc" -type f -delete
122
123 libdir=$(get_libdir)
124 tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
125
126 _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara 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|$(PYTHON -a)|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}
138 done
139
140 local in_path=$(python_get_sitedir)/${PN}
141 local files
142 local pydocs
143
144 pydocs="$(find python -name doc -type d)"
145 rm -rf ${pydocs} || die
146
147 for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
148 sed \
149 -e 's|#from __future__|from __future__|g' \
150 -i ${i} || die
151 done
152
153 insinto ${in_path}
154
155 dodir ${in_path}/c
156
157 ebegin "Installing main files"
158 doins -r python
159 eend
160
161 ebegin "Adjusting permissions"
162 for _file in $(find "${ED}" -type f -name "*so"); do
163 chmod 755 ${_file}
164 done
165 eend
166 }
167
168 pkg_postinst() {
169 python_mod_optimize ${PN}
170 }
171
172 pkg_postrm() {
173 python_mod_cleanup ${PN}
174 }

  ViewVC Help
Powered by ViewVC 1.1.13