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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sun Aug 12 09:19:09 2012 UTC (9 months ago) by jlec
Branch: MAIN
sci-chemistry/ccpn: Todays python patches

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

1 jlec 1.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.2.2_p120809-r1.ebuild,v 1.1 2012/08/09 16:32:10 jlec Exp $
4    
5     EAPI=4
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     SRC_URI="http://www-old.ccpn.ac.uk/download/${MY_PN}/analysis${MY_PV}.tar.gz"
19     [[ -n ${PATCHSET} ]] && SRC_URI="${SRC_URI} http://dev.gentoo.org/~jlec/distfiles/ccpn-update-${MY_MAJOR}-${PATCHSET}.patch.xz"
20     HOMEPAGE="http://www.ccpn.ac.uk/ccpn"
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
30     dev-tcltk/tix
31     =sci-libs/ccpn-data-"${MY_MAJOR}"*
32     sci-biology/psipred
33     x11-libs/libXext
34     x11-libs/libX11
35     opengl? (
36     media-libs/freeglut
37     dev-python/pyglet )"
38     # We need to fix this
39     # sci-chemistry/mdd
40     DEPEND="${RDEPEND}"
41     PDEPEND="
42     extendnmr? (
43     >=sci-chemistry/aria-2.3.2-r1
44     sci-chemistry/prodecomp )"
45    
46     RESTRICT="mirror"
47    
48     S="${WORKDIR}"/${MY_PN}/${MY_PN}$(get_version_component_range 1-2 ${PV})
49    
50     pkg_setup() {
51     python_set_active_version 2
52     python_pkg_setup
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 || die
109    
110     sed \
111     -e 's:ln -s:cp -f:g' \
112     -i $(find python -name linkSharedObjs) || die
113     }
114    
115     src_compile() {
116     emake -C c all
117     emake -C c links
118     }
119    
120     src_install() {
121     local libdir
122     local tkver
123     local _wrapper
124    
125     find . -name "*.pyc" -type f -delete
126    
127     libdir=$(get_libdir)
128     tkver=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
129    
130     _wrapper="analysis dangle dataShifter depositionFileImporter eci formatConverter pipe2azara xeasy2azara"
131     use extendnmr && _wrapper="${_wrapper} extendNmr"
132     for wrapper in ${_wrapper}; do
133     sed \
134     -e "s|gentoo_sitedir|${EPREFIX}$(python_get_sitedir)|g" \
135     -e "s|gentoolibdir|${EPREFIX}/usr/${libdir}|g" \
136     -e "s|gentootk|${EPREFIX}/usr/${libdir}/tk${tkver}|g" \
137     -e "s|gentootcl|${EPREFIX}/usr/${libdir}/tclk${tkver}|g" \
138     -e "s|gentoopython|$(PYTHON -a)|g" \
139     -e "s|gentoousr|${EPREFIX}/usr|g" \
140     -e "s|//|/|g" \
141     "${FILESDIR}"/${wrapper} > "${T}"/${wrapper} || die "Fail fix ${wrapper}"
142     dobin "${T}"/${wrapper}
143     done
144    
145     local in_path=$(python_get_sitedir)/${PN}
146     local files
147     local pydocs
148    
149     pydocs="$(find python -name doc -type d)"
150     rm -rf ${pydocs} || die
151    
152     for i in python/memops/format/compatibility/{Converters,part2/Converters2}.py; do
153     sed \
154     -e 's|#from __future__|from __future__|g' \
155     -i ${i} || die
156     done
157    
158     insinto ${in_path}
159    
160     dodir ${in_path}/c
161    
162     ebegin "Installing main files"
163     doins -r python
164     eend
165    
166     ebegin "Adjusting permissions"
167    
168     for _file in $(find "${ED}" -type f -name "*so"); do
169     chmod 755 ${_file}
170     done
171     eend
172     }
173    
174     pkg_postinst() {
175     python_mod_optimize ${PN}
176     }
177    
178     pkg_postrm() {
179     python_mod_cleanup ${PN}
180     }

  ViewVC Help
Powered by ViewVC 1.1.13