/[gentoo-x86]/sci-chemistry/sparky/sparky-3.115-r1.ebuild
Gentoo

Contents of /sci-chemistry/sparky/sparky-3.115-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Mar 20 15:29:21 2015 UTC (3 years, 6 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +5 -5 lines
Fix tcl/tk slotting; drop old

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/sparky/sparky-3.115-r1.ebuild,v 1.3 2013/11/11 18:12:11 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="tk"
9
10 inherit eutils flag-o-matic multilib prefix python-single-r1 toolchain-funcs
11
12 DESCRIPTION="Graphical NMR assignment and integration program for proteins, nucleic acids, and other polymers"
13 HOMEPAGE="http://www.cgl.ucsf.edu/home/sparky/"
14 SRC_URI="http://www.cgl.ucsf.edu/home/sparky/distrib-${PV}/${PN}-source-${PV}.tar.gz"
15
16 LICENSE="sparky"
17 SLOT="0"
18 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
19 IUSE="examples"
20
21 RDEPEND="
22 app-shells/tcsh
23 dev-lang/tcl:0=
24 dev-lang/tk:0="
25 DEPEND="${RDEPEND}"
26
27 RESTRICT="mirror"
28
29 S="${WORKDIR}/${PN}"
30
31 PATCHES=(
32 "${FILESDIR}"/${PV}-ldflags.patch
33 "${FILESDIR}"/${PV}-wrapper-r1.patch
34 "${FILESDIR}"/${PV}-paths.patch
35 "${FILESDIR}"/${PV}-makefile.patch
36 )
37
38 pkg_setup() {
39 python-single-r1_pkg_setup
40 TKVER=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
41 PYVER=${EPYTHON#python}
42 }
43
44 src_prepare() {
45 epatch ${PATCHES[@]}
46
47 sed -i \
48 -e "s:^\(set PYTHON =\).*:\1 ${EPREFIX}/usr/bin/${EPYTHON}:g" \
49 -e "s:^\(setenv SPARKY_INSTALL[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir)/${PN}:g" \
50 -e "s:tcl8.4:tcl${TKVER}:g" \
51 -e "s:tk8.4:tk${TKVER}:g" \
52 -e "s:^\(setenv TCLTK_LIB[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir):g" \
53 "${S}"/bin/sparky || die
54 eprefixify "${S}"/bin/sparky
55 }
56
57 src_compile() {
58 emake \
59 SPARKY="${S}" \
60 PYTHON_VERSION="${PYVER}" \
61 PYTHON_PREFIX="${EPREFIX}/usr" \
62 PYTHON_LIB="${EPREFIX}/usr/$(get_libdir)" \
63 PYTHON_INC="${EPREFIX}/usr/include/${EPYTHON}" \
64 TK_PREFIX="${EPREFIX}/usr" \
65 TCLTK_VERSION="${TKVER}" \
66 TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk -ltcl -lX11" \
67 CXX="$(tc-getCXX)" \
68 CC="$(tc-getCC)" \
69 LDSHARED="-shared" \
70 binaries
71
72 rm c++/*.o || die
73
74 emake \
75 SPARKY="${S}" \
76 PYTHON_VERSION="${PYVER}" \
77 PYTHON_PREFIX="${EPREFIX}/usr" \
78 PYTHON_LIB="${EPREFIX}/usr/$(get_libdir)" \
79 PYTHON_INC="${EPREFIX}/usr/include/${EPYTHON}" \
80 TK_PREFIX="${EPREFIX}/usr" \
81 TCLTK_VERSION="${TKVER}" \
82 TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk -ltcl -lX11" \
83 CXX="$(tc-getCXX)" \
84 CC="$(tc-getCC)" \
85 CXXFLAGS="${CXXFLAGS} -fPIC" \
86 CFLAGS="${CFLAGS} -fPIC" \
87 LDSHARED="-shared -fPIC" \
88 libraries
89 }
90
91 src_install() {
92 # The symlinks are needed to avoid hacking the complete code to fix the locations
93
94 dobin c++/{{bruk,matrix,peaks,pipe,vnmr}2ucsf,ucsfdata,sparky-no-python} bin/${PN}
95
96 insinto /usr/share/${PN}/
97 doins lib/{print-prolog.ps,Sparky}
98 dosym ../../share/${PN}/print-prolog.ps /usr/$(get_libdir)/${PN}/print-prolog.ps
99 dosym ../../share/${PN}/Sparky /usr/$(get_libdir)/${PN}/Sparky
100
101 dohtml -r manual/*
102 dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/manual
103
104 python_moduleinto ${PN}
105 python_domodule python/*.py c++/{spy.so,_tkinter.so}
106
107 python_optimize
108
109 dosym ../${EPYTHON}/site-packages /usr/$(get_libdir)/${PN}/python
110
111 if use examples; then
112 insinto /usr/share/doc/${PF}/
113 doins -r example || die
114 dosym ../../share/doc/${PF}/example /usr/$(get_libdir)/${PN}/example
115 fi
116
117 dodoc README
118 newdoc python/README README.python
119 }

  ViewVC Help
Powered by ViewVC 1.1.20