/[gentoo-x86]/sci-chemistry/vmd/vmd-1.8.7.ebuild
Gentoo

Contents of /sci-chemistry/vmd/vmd-1.8.7.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri May 28 18:21:25 2010 UTC (8 years ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Removed all non PythonABI compatible ebuilds
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/vmd/vmd-1.8.7.ebuild,v 1.6 2010/02/23 18:00:14 alexxy Exp $
4
5 EAPI="2"
6
7 inherit eutils toolchain-funcs python
8
9 DESCRIPTION="Visual Molecular Dynamics"
10 LICENSE="vmd"
11 HOMEPAGE="http://www.ks.uiuc.edu/Research/vmd/"
12 SRC_URI="${P}.src.tar.gz"
13
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~x86"
16 IUSE="tachyon"
17
18 RESTRICT="fetch"
19
20 # currently, tk-8.5* with USE=truetype breaks some
21 # tk apps such as Sequence Viewer or Timeline.
22 DEPEND="x11-libs/libXft
23 virtual/opengl
24 x11-libs/fltk:1.1
25 >=dev-lang/tcl-8.4
26 || (
27 >=dev-lang/tk-8.5[-truetype]
28 =dev-lang/tk-8.4*
29 )
30 =dev-lang/python-2*
31 dev-lang/perl
32 dev-python/numpy
33 sci-biology/stride
34 sci-libs/netcdf"
35
36 RDEPEND="${DEPEND}
37 x11-terms/xterm
38 tachyon? ( media-gfx/tachyon )"
39
40 VMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD"
41
42 pkg_nofetch() {
43 echo
44 elog "Please download ${SRC_URI} from"
45 elog "${VMD_DOWNLOAD}"
46 elog "after agreeing to the license and then move it to "
47 elog "${DISTDIR}"
48 echo
49 }
50
51 src_prepare() {
52 # apply LINUX-arch patches to vmd configure
53 epatch "${FILESDIR}/${P}-config.patch"
54 epatch "${FILESDIR}/${P}-use-bash-startup.patch"
55
56 # prepare the plugins
57 cd "${WORKDIR}"/plugins
58
59 sed -e "s:CC = gcc:CC = $(tc-getCC):" \
60 -e "s:CXX = g++:CXX = $(tc-getCXX):" \
61 -e "s:COPTO =.*\":COPTO = -fPIC -o\":" \
62 -e "s:LOPTO = .*\":LOPTO = -fPIC -o\":" \
63 -e "s:CCFLAGS =.*\":CCFLAGS = ${CFLAGS}\":" \
64 -e "s:CXXFLAGS =.*\":CXXFLAGS = ${CXXFLAGS}\":" \
65 -e "s:SHLD = gcc:SHLD = $(tc-getCC):" \
66 -e "s:-ltcl8.5:-ltcl:" \
67 -i Make-arch || die "Failed to set up plugins Makefile"
68
69 # prepare vmd itself
70 cd "${S}"
71
72 sed -e "s:gentoo-bindir:${D}/usr/bin:" \
73 -e "s:gentoo-libdir:${D}/usr/$(get_libdir):" \
74 -i configure || die "failed to adjust install paths"
75
76 sed -e "s:gentoo-opengl-include:/usr/include/GL:" \
77 -e "s:gentoo-opengl-libs:/usr/$(get_libdir):" \
78 -i configure || die "failed to adjust OpenGL paths"
79
80 sed -e "s:gentoo-gcc:$(tc-getCC):" \
81 -e "s:gentoo-g++:$(tc-getCXX):" \
82 -e "s:gentoo-cflags:${CFLAGS}:" \
83 -i configure || die "Failed to adjust C compiler/flags"
84
85 sed -e "s:gentoo-plugindir:${WORKDIR}/plugins:" \
86 -i configure || die "Failed to set up linking to plugin files"
87
88 sed -e "s:gentoo-fltk-include:/usr/include/fltk-1.1:" \
89 -e "s:gentoo-fltk-libs:/usr/$(get_libdir)/fltk-1.1:" \
90 -i configure || die "failed setting up fltk"
91
92 sed -e "s:gentoo-netcdf-include:/usr/include:" \
93 -e "s:gentoo-netcdf-libs:/usr/$(get_libdir):" \
94 -i configure || die "failed to set up netcdf"
95
96 # get installed python version
97 python_version
98 local PY="python${PYVER}"
99
100 local NUMPY_INCLUDE="site-packages/numpy/core/include"
101 sed -e "s:gentoo-python-include:/usr/include/${PY}:" \
102 -e "s:gentoo-python-lib:/usr/$(get_libdir)/${PY}:" \
103 -e "s:gentoo-python-link:${PY}:" \
104 -e "s:gentoo-numpy-include:/usr/$(get_libdir)/${PY}/${NUMPY_INCLUDE}:" \
105 -i configure || die "failed setting up python"
106
107 sed -e "s:LINUXPPC:LINUX:g" \
108 -e "s:LINUXALPHA:LINUX:g" \
109 -e "s:LINUXAMD64:LINUX:g" \
110 -i "${S}"/bin/vmd.sh || die "failed setting up vmd wrapper script"
111 }
112
113 src_configure() {
114 local myconfig="LINUX OPENGL FLTK TK TCL PTHREADS PYTHON IMD NETCDF NUMPY"
115 rm -f configure.options && echo $myconfig >> configure.options
116
117 ./configure &> /dev/null || die "failed to configure"
118 }
119
120 src_compile() {
121 # build plugins
122 cd "${WORKDIR}"/plugins
123
124 make LINUX TCLINC="-I/usr/include" \
125 TCLLIB="-L/usr/$(get_libdir)" \
126 || die "failed to build plugins"
127
128 # build vmd
129 cd "${S}"/src
130 emake || die "failed to build vmd"
131 }
132
133 src_install() {
134 # install plugins
135 cd "${WORKDIR}"/plugins
136 PLUGINDIR=${D}/usr/$(get_libdir)/${PN}/plugins make distrib || \
137 die "failed to install plugins"
138
139 # install vmd
140 cd "${S}"/src
141 make install || die "failed to install vmd"
142
143 # export STRIDE_BIN so VMD knows where to find stride
144 echo "STRIDE_BIN=/usr/bin/stride" > "${T}"/99${PN} || \
145 die "Failed to create vmd env file"
146 doenvd "${T}"/99${PN} || die "Failed to install vmd env file"
147
148 # install docs
149 cd "${S}"
150 dodoc Announcement README doc/ig.pdf doc/ug.pdf
151
152 # remove some of the things we don't want and need in
153 # /usr/lib
154 cd "${D}"/usr/$(get_libdir)/vmd
155 rm -fr doc README Announcement LICENSE || \
156 die "failed to clean up /usr/lib/vmd directory"
157
158 # adjust path in vmd wrapper
159 sed -e "s:${D}::" -i "${D}"/usr/bin/${PN} \
160 || die "failed to set up vmd wrapper script"
161
162 # install icon and generate desktop entry
163 insinto /usr/share/pixmaps
164 doins "${FILESDIR}"/vmd.png || die "Failed to install vmd icon"
165 insinto /usr/share/applications
166 doins "${FILESDIR}"/vmd.desktop || die "Failed to install desktop entry"
167 }

  ViewVC Help
Powered by ViewVC 1.1.20