| 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/sparky/sparky-3.115.ebuild,v 1.3 2010/03/07 12:49:22 jlec Exp $
|
| 4 |
|
| 5 |
EAPI="3"
|
| 6 |
|
| 7 |
PYTHON_USE_WITH="tk"
|
| 8 |
PYTHON_DEPEND="2"
|
| 9 |
|
| 10 |
inherit eutils flag-o-matic multilib prefix python 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="app-shells/tcsh"
|
| 22 |
DEPEND="${RDEPEND}"
|
| 23 |
|
| 24 |
RESTRICT="mirror"
|
| 25 |
|
| 26 |
S="${WORKDIR}/${PN}"
|
| 27 |
|
| 28 |
pkg_setup() {
|
| 29 |
python_set_active_version 2
|
| 30 |
python_pkg_setup
|
| 31 |
TKVER=$(best_version dev-lang/tk | cut -d- -f3 | cut -d. -f1,2)
|
| 32 |
PYVER=$(python_get_version)
|
| 33 |
}
|
| 34 |
|
| 35 |
src_prepare() {
|
| 36 |
epatch "${FILESDIR}"/${PV}-ldflags.patch
|
| 37 |
epatch "${FILESDIR}"/${PV}-wrapper.patch
|
| 38 |
epatch "${FILESDIR}"/${PV}-paths.patch
|
| 39 |
epatch "${FILESDIR}"/${PV}-makefile.patch
|
| 40 |
|
| 41 |
sed -i \
|
| 42 |
-e "s:^\(set PYTHON =\).*:\1 ${EPREFIX}/usr/bin/python${PYVER}:g" \
|
| 43 |
-e "s:^\(setenv SPARKY_INSTALL[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir)/${PN}:g" \
|
| 44 |
-e "s:tcl8.4:tcl${TKVER}:g" \
|
| 45 |
-e "s:tk8.4:tk${TKVER}:g" \
|
| 46 |
-e "s:^\(setenv TCLTK_LIB[[:space:]]*\).*:\1 ${EPREFIX}/usr/$(get_libdir):g" \
|
| 47 |
"${S}"/bin/sparky
|
| 48 |
eprefixify "${S}"/bin/sparky
|
| 49 |
}
|
| 50 |
|
| 51 |
src_compile() {
|
| 52 |
emake \
|
| 53 |
SPARKY="${S}" \
|
| 54 |
PYTHON_VERSION="${PYVER}" \
|
| 55 |
PYTHON_PREFIX="${EPREFIX}/usr" \
|
| 56 |
PYTHON_LIB="${EPREFIX}$(python_get_libdir)" \
|
| 57 |
PYTHON_INC="${EPREFIX}$(python_get_includedir)" \
|
| 58 |
TK_PREFIX="${EPREFIX}/usr" \
|
| 59 |
TCLTK_VERSION="${TKVER}" \
|
| 60 |
TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk${TKVER} -ltcl${TKVER} -lX11" \
|
| 61 |
CXX="$(tc-getCXX)" \
|
| 62 |
CC="$(tc-getCC)" \
|
| 63 |
LDSHARED="-shared" \
|
| 64 |
binaries || die "make failed"
|
| 65 |
|
| 66 |
rm c++/*.o || die
|
| 67 |
|
| 68 |
emake \
|
| 69 |
SPARKY="${S}" \
|
| 70 |
PYTHON_VERSION="${PYVER}" \
|
| 71 |
PYTHON_PREFIX="${EPREFIX}/usr" \
|
| 72 |
PYTHON_LIB="${EPREFIX}$(python_get_libdir)" \
|
| 73 |
PYTHON_INC="${EPREFIX}$(python_get_includedir)" \
|
| 74 |
TK_PREFIX="${EPREFIX}/usr" \
|
| 75 |
TCLTK_VERSION="${TKVER}" \
|
| 76 |
TKLIBS="-L${EPREFIX}/usr/$(get_libdir)/ -ltk${TKVER} -ltcl${TKVER} -lX11" \
|
| 77 |
CXX="$(tc-getCXX)" \
|
| 78 |
CC="$(tc-getCC)" \
|
| 79 |
CXXFLAGS="${CXXFLAGS} -fPIC" \
|
| 80 |
CFLAGS="${CFLAGS} -fPIC" \
|
| 81 |
LDSHARED="-shared -fPIC" \
|
| 82 |
libraries || die "make failed"
|
| 83 |
}
|
| 84 |
|
| 85 |
src_install() {
|
| 86 |
# The symlinks are needed to avoid hacking the complete code to fix the locations
|
| 87 |
|
| 88 |
dobin c++/{{bruk,matrix,peaks,pipe,vnmr}2ucsf,ucsfdata,sparky-no-python} bin/${PN} || die
|
| 89 |
|
| 90 |
insinto /usr/share/${PN}/
|
| 91 |
doins lib/{print-prolog.ps,Sparky} || die
|
| 92 |
dosym ../../share/${PN}/print-prolog.ps /usr/$(get_libdir)/${PN}/print-prolog.ps
|
| 93 |
dosym ../../share/${PN}/Sparky /usr/$(get_libdir)/${PN}/Sparky
|
| 94 |
|
| 95 |
dohtml -r manual/* || die
|
| 96 |
dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/manual
|
| 97 |
|
| 98 |
insinto $(python_get_sitedir)/${PN}
|
| 99 |
doins python/*.py c++/{spy.so,_tkinter.so} || die
|
| 100 |
fperms 755 $(python_get_sitedir)/${PN}/{spy.so,_tkinter.so} || die
|
| 101 |
dosym ../python${PYVER}/site-packages /usr/$(get_libdir)/${PN}/python
|
| 102 |
|
| 103 |
if use examples; then
|
| 104 |
insinto /usr/share/doc/${PF}/
|
| 105 |
doins -r example || die
|
| 106 |
dosym ../../share/doc/${PF}/example /usr/$(get_libdir)/${PN}/example
|
| 107 |
fi
|
| 108 |
|
| 109 |
dodoc README || die
|
| 110 |
newdoc python/README README.python || die
|
| 111 |
}
|
| 112 |
|
| 113 |
pkg_postinst() {
|
| 114 |
python_need_rebuild
|
| 115 |
python_mod_optimize ${PN}
|
| 116 |
}
|
| 117 |
|
| 118 |
pkg_postrm() {
|
| 119 |
python_mod_cleanup ${PN}
|
| 120 |
}
|