Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-chemistry/vmd/, sci-chemistry/vmd/files/
Date: Thu, 30 May 2019 11:15:56
Message-Id: 1559214896.3e2a2a3baebbc26bdcd1ee23a765bf04ebed7ee3.pacho@gentoo
1 commit: 3e2a2a3baebbc26bdcd1ee23a765bf04ebed7ee3
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 30 11:14:56 2019 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Thu May 30 11:14:56 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e2a2a3b
7
8 sci-chemistry/vmd: Multiple fixes and update ebuild
9
10 - Longer explanation to download sources files (#640440)
11 - Fix tachyon support (#644122)
12 - Install netcdf plugin (#661636)
13
14 Bug: https://bugs.gentoo.org/640440
15 Closes: https://bugs.gentoo.org/644122
16 Closes: https://bugs.gentoo.org/661636
17 Package-Manager: Portage-2.3.66, Repoman-2.3.12
18 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
19
20 .../vmd/files/vmd-1.9.1-cuda-device_ptr.patch | 8 +-
21 .../vmd/files/vmd-1.9.3-configure-libtachyon.patch | 13 +
22 sci-chemistry/vmd/vmd-1.9.3-r1.ebuild | 262 +++++++++++++++++++++
23 3 files changed, 279 insertions(+), 4 deletions(-)
24
25 diff --git a/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch b/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch
26 index ce842448dec..67eb11bbd36 100644
27 --- a/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch
28 +++ b/sci-chemistry/vmd/files/vmd-1.9.1-cuda-device_ptr.patch
29 @@ -4,8 +4,8 @@
30
31 diff --git a/vmd-1.9.1/src/CUDAMarchingCubes.cu b/vmd-1.9.1/src/CUDAMarchingCubes.cu
32 index 5bfe7bf..36faaf0 100755
33 ---- a/vmd-1.9.1/src/CUDAMarchingCubes.cu
34 -+++ b/vmd-1.9.1/src/CUDAMarchingCubes.cu
35 +--- a/src/CUDAMarchingCubes.cu
36 ++++ b/src/CUDAMarchingCubes.cu
37 @@ -45,6 +45,7 @@
38 #include "CUDAMarchingCubes.h"
39 #include <thrust/scan.h>
40 @@ -16,8 +16,8 @@ index 5bfe7bf..36faaf0 100755
41 // (limited by shared memory size)
42 diff --git a/vmd-1.9.1/src/CUDAQuickSurf.cu b/vmd-1.9.1/src/CUDAQuickSurf.cu
43 index a21ebde..56a42c8 100755
44 ---- a/vmd-1.9.1/src/CUDAQuickSurf.cu
45 -+++ b/vmd-1.9.1/src/CUDAQuickSurf.cu
46 +--- a/src/CUDAQuickSurf.cu
47 ++++ b/src/CUDAQuickSurf.cu
48 @@ -22,6 +22,7 @@
49 #include <stdlib.h>
50 #include <string.h>
51
52 diff --git a/sci-chemistry/vmd/files/vmd-1.9.3-configure-libtachyon.patch b/sci-chemistry/vmd/files/vmd-1.9.3-configure-libtachyon.patch
53 new file mode 100644
54 index 00000000000..b71cd97210a
55 --- /dev/null
56 +++ b/sci-chemistry/vmd/files/vmd-1.9.3-configure-libtachyon.patch
57 @@ -0,0 +1,13 @@
58 +--- a/configure.old 2019-05-16 17:26:05.347560700 +0200
59 ++++ b/configure 2019-05-16 17:30:25.478455770 +0200
60 +@@ -1105,8 +1105,8 @@
61 + # This may be commented out if not required.
62 + $libtachyon_defines = "-DVMDLIBTACHYON";
63 + $libtachyon_dir = "$vmd_library_dir/tachyon";
64 +-$libtachyon_include = "-I$libtachyon_dir/include";
65 +-$libtachyon_library = "-L$libtachyon_dir/lib_$config_arch";
66 ++$libtachyon_include = "-Igentoo-libtachyon-include";
67 ++$libtachyon_library = "-Lgentoo-libtachyon-libs";
68 + $libtachyon_libs = "-ltachyon";
69 + @libtachyon_cc = ();
70 + @libtachyon_cu = ();
71
72 diff --git a/sci-chemistry/vmd/vmd-1.9.3-r1.ebuild b/sci-chemistry/vmd/vmd-1.9.3-r1.ebuild
73 new file mode 100644
74 index 00000000000..392e380ece1
75 --- /dev/null
76 +++ b/sci-chemistry/vmd/vmd-1.9.3-r1.ebuild
77 @@ -0,0 +1,262 @@
78 +# Copyright 1999-2019 Gentoo Authors
79 +# Distributed under the terms of the GNU General Public License v2
80 +
81 +EAPI=7
82 +PYTHON_COMPAT=( python2_7 )
83 +
84 +inherit cuda desktop flag-o-matic prefix python-single-r1 toolchain-funcs
85 +
86 +DESCRIPTION="Visual Molecular Dynamics"
87 +HOMEPAGE="http://www.ks.uiuc.edu/Research/vmd/"
88 +SRC_URI="
89 + https://dev.gentoo.org/~jlec/distfiles/${P}-gentoo-patches.tar.xz
90 + ${P}.src.tar
91 +"
92 +
93 +SLOT="0"
94 +LICENSE="vmd"
95 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
96 +IUSE="cuda gromacs msms povray sqlite tachyon xinerama"
97 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
98 +
99 +RESTRICT="fetch"
100 +
101 +# currently, tk-8.5* with USE=truetype breaks some
102 +# tk apps such as Sequence Viewer or Timeline.
103 +CDEPEND="
104 + >=dev-lang/tk-8.6.1:0=
105 + dev-lang/perl
106 + dev-libs/expat
107 + dev-python/numpy[${PYTHON_USEDEP}]
108 + sci-libs/netcdf:0=
109 + virtual/opengl
110 + >=x11-libs/fltk-1.1.10-r2:1
111 + x11-libs/libXft
112 + x11-libs/libXi
113 + ${PYTHON_DEPS}
114 + cuda? ( >=dev-util/nvidia-cuda-toolkit-4.2.9-r1:= )
115 + gromacs? ( >=sci-chemistry/gromacs-5.0.4-r1:0=[tng] )
116 + sqlite? ( dev-db/sqlite:3= )
117 + tachyon? ( >=media-gfx/tachyon-0.99_beta6 )
118 + xinerama? ( x11-libs/libXinerama )
119 +"
120 +DEPEND="${CDEPEND}"
121 +BDEPEND="
122 + virtual/pkgconfig
123 + dev-lang/swig
124 +"
125 +RDEPEND="${CDEPEND}
126 + sci-biology/stride
127 + sci-chemistry/surf
128 + x11-terms/xterm
129 + msms? ( sci-chemistry/msms-bin )
130 + povray? ( media-gfx/povray )
131 +"
132 +
133 +VMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD"
134 +# Binary only plugin!!
135 +QA_PREBUILT="usr/lib*/vmd/plugins/LINUX/tcl/intersurf1.1/bin/intersurf.so"
136 +QA_FLAGS_IGNORED_amd64=" usr/lib64/vmd/plugins/LINUX/tcl/volutil1.3/volutil"
137 +QA_FLAGS_IGNORED_x86=" usr/lib/vmd/plugins/LINUX/tcl/volutil1.3/volutil"
138 +
139 +pkg_nofetch() {
140 + elog "Please download ${P}.src.tar from"
141 + elog "${VMD_DOWNLOAD}"
142 + elog "after agreeing to the license and get"
143 + elog "https://dev.gentoo.org/~jlec/distfiles/${P}-gentoo-patches.tar.xz"
144 + elog "Place both into your DISTDIR directory"
145 + elog
146 + elog "Due to an upstream bug (https://bugs.gentoo.org/640440) sources"
147 + elog "file may get downloaded as a compressed tarball or not. In that case"
148 + elog "you will need to ensure you uncompress the file and rename it"
149 + elog "as ${P}.src.tar"
150 +}
151 +
152 +src_prepare() {
153 + default
154 +
155 + use cuda && cuda_sanitize
156 +
157 + eapply "${FILESDIR}"/${PN}-1.9.1-cuda-device_ptr.patch
158 +
159 + cd "${WORKDIR}"/plugins || die
160 +
161 + eapply -p2 "${WORKDIR}"/${P}-gentoo-plugins.patch
162 +
163 + [[ ${SILENT} == yes ]] || sed '/^.SILENT/d' -i $(find -name Makefile)
164 +
165 + sed \
166 + -e "s:CC = gcc:CC = $(tc-getCC):" \
167 + -e "s:CXX = g++:CXX = $(tc-getCXX):" \
168 + -e "s:COPTO =.*\":COPTO = -fPIC -o \":" \
169 + -e "s:LOPTO = .*\":LOPTO = ${LDFLAGS} -fPIC -o \":" \
170 + -e "s:CCFLAGS =.*\":CCFLAGS = ${CFLAGS}\":" \
171 + -e "s:CXXFLAGS =.*\":CXXFLAGS = ${CXXFLAGS}\":" \
172 + -e "s:SHLD = gcc:SHLD = $(tc-getCC) -shared:" \
173 + -e "s:SHXXLD = g++:SHXXLD = $(tc-getCXX) -shared:" \
174 + -e "s:-ltcl8.5:-ltcl:" \
175 + -i Make-arch || die "Failed to set up plugins Makefile"
176 +
177 + sed \
178 + -e '/^AR /s:=:?=:g' \
179 + -e '/^RANLIB /s:=:?=:g' \
180 + -i ../plugins/*/Makefile || die
181 +
182 + tc-export AR RANLIB
183 +
184 + sed \
185 + -e "s:\$(CXXFLAGS)::g" \
186 + -i hesstrans/Makefile || die
187 +
188 + # prepare vmd itself
189 + cd "${S}" || die
190 +
191 + eapply -p2 "${WORKDIR}"/${P}-gentoo-base.patch
192 + eapply "${FILESDIR}"/${P}-configure-libtachyon.patch
193 +
194 + # PREFIX
195 + sed \
196 + -e "s:/usr/include/:${EPREFIX}/usr/include:g" \
197 + -i configure || die
198 +
199 + sed \
200 + -e "s:gentoo-bindir:${ED}/usr/bin:g" \
201 + -e "s:gentoo-libdir:${ED}/usr/$(get_libdir):g" \
202 + -e "s:gentoo-opengl-include:${EPREFIX}/usr/include/GL:g" \
203 + -e "s:gentoo-opengl-libs:${EPREFIX}/usr/$(get_libdir):g" \
204 + -e "s:gentoo-gcc:$(tc-getCC):g" \
205 + -e "s:gentoo-g++:$(tc-getCXX):g" \
206 + -e "s:gentoo-nvcc:${EPREFIX}/opt/cuda/bin/nvcc:g" \
207 + -e "s:gentoo-cflags:${CFLAGS}:g" \
208 + -e "s:gentoo-cxxflags:${CXXFLAGS}:g" \
209 + -e "s:gentoo-nvflags::g" \
210 + -e "s:gentoo-ldflags:${LDFLAGS}:g" \
211 + -e "s:gentoo-plugindir:${WORKDIR}/plugins:g" \
212 + -e "s:gentoo-fltk-include:$(fltk-config --includedir):g" \
213 + -e "s:gentoo-fltk-libs:$(dirname $(fltk-config --libs)) -Wl,-rpath,$(dirname $(fltk-config --libs)):g" \
214 + -e "s:gentoo-libtachyon-include:${EPREFIX}/usr/include/tachyon:g" \
215 + -e "s:gentoo-libtachyon-libs:${EPREFIX}/usr/$(get_libdir):g" \
216 + -e "s:gentoo-netcdf-include:${EPREFIX}/usr/include:g" \
217 + -e "s:gentoo-netcdf-libs:${EPREFIX}/usr/$(get_libdir):g" \
218 + -i configure || die
219 +
220 + if use cuda; then
221 + sed \
222 + -e "s:gentoo-cuda-lib:${EPREFIX}/opt/cuda/$(get_libdir):g" \
223 + -e "/NVCCFLAGS/s:=:= ${NVCCFLAGS}:g" \
224 + -i configure src/Makefile || die
225 + sed \
226 + -e '/compute_/d' \
227 + -i configure || die
228 + sed \
229 + -e 's:-gencode .*code=sm_..::' \
230 + -i src/Makefile || die
231 + fi
232 +
233 + sed \
234 + -e "s:LINUXPPC:LINUX:g" \
235 + -e "s:LINUXALPHA:LINUX:g" \
236 + -e "s:LINUXAMD64:LINUX:g" \
237 + -e "s:gentoo-stride:${EPREFIX}/usr/bin/stride:g" \
238 + -e "s:gentoo-surf:${EPREFIX}/usr/bin/surf:g" \
239 + -e "s:gentoo-tachyon:${EPREFIX}/usr/bin/tachyon:g" \
240 + -i "${S}"/bin/vmd.sh || die "failed setting up vmd wrapper script"
241 +
242 + EMAKEOPTS=(
243 + TCLINC="-I${EPREFIX}/usr/include"
244 + TCLLIB="-L${EPREFIX}/usr/$(get_libdir)"
245 + TCLLDFLAGS="-shared"
246 + NETCDFLIB="$($(tc-getPKG_CONFIG) --libs-only-L netcdf)${EPREFIX}/usr/$(get_libdir)/libnetcdf.so"
247 + NETCDFINC="$($(tc-getPKG_CONFIG) --cflags-only-I netcdf)${EPREFIX}/usr/include"
248 + NETCDFLDFLAGS="$($(tc-getPKG_CONFIG) --libs netcdf)"
249 + NETCDFDYNAMIC=1
250 + EXPATINC="-I${EPREFIX}/usr/include"
251 + EXPATLIB="$($(tc-getPKG_CONFIG) --libs expat)"
252 + EXPATLDFLAGS="-shared"
253 + EXPATDYNAMIC=1
254 + )
255 + if use gromacs; then
256 + EMAKEOPTS+=(
257 + TNGLIB="$($(tc-getPKG_CONFIG) --libs libgromacs)"
258 + TNGINC="-I${EPREFIX}/usr/include"
259 + TNGLDFLAGS="-shared"
260 + TNGDYNAMIC=1
261 + )
262 + fi
263 + if use sqlite; then
264 + EMAKEOPTS+=(
265 + SQLITELIB="$($(tc-getPKG_CONFIG) --libs sqlite3)"
266 + SQLITEINC="-I${EPREFIX}/usr/include"
267 + SQLITELDFLAGS="-shared"
268 + SQLITEDYNAMIC=1
269 + )
270 + fi
271 +}
272 +
273 +src_configure() {
274 + local myconf="OPENGL OPENGLPBUFFER COLVARS FLTK TK TCL PTHREADS PYTHON IMD NETCDF NUMPY NOSILENT XINPUT"
275 + rm -f configure.options && echo $myconf >> configure.options
276 +
277 + use cuda && myconf+=" CUDA"
278 +# use mpi && myconf+=" MPI"
279 + use tachyon && myconf+=" LIBTACHYON"
280 + use xinerama && myconf+=" XINERAMA"
281 +
282 + export \
283 + PYTHON_INCLUDE_DIR="$(python_get_includedir)" \
284 + PYTHON_LIBRARY_DIR="$(python_get_library_path)" \
285 + PYTHON_LIBRARY="$(python_get_LIBS)" \
286 + NUMPY_INCLUDE_DIR="$(python_get_sitedir)/numpy/core/include" \
287 + NUMPY_LIBRARY_DIR="$(python_get_sitedir)/numpy/core/include"
288 +
289 + perl ./configure LINUX \
290 + ${myconf} || die
291 +}
292 +
293 +src_compile() {
294 + # build plugins
295 + cd "${WORKDIR}"/plugins || die
296 +
297 + emake \
298 + ${EMAKEOPTS[@]} \
299 + LINUX
300 +
301 + # build vmd
302 + cd "${S}"/src || die
303 + emake
304 +}
305 +
306 +src_install() {
307 + # install plugins
308 + cd "${WORKDIR}"/plugins || die
309 + emake \
310 + PLUGINDIR="${ED}/usr/$(get_libdir)/${PN}/plugins" \
311 + distrib
312 +
313 + # install vmd
314 + cd "${S}"/src || die
315 + emake install
316 +
317 + # install docs
318 + cd "${S}" || die
319 + dodoc Announcement README doc/ig.pdf doc/ug.pdf
320 +
321 + # remove some of the things we don't want and need in
322 + # /usr/lib
323 + cd "${ED}"/usr/$(get_libdir)/vmd || die
324 + rm -fr doc README Announcement LICENSE || \
325 + die "failed to clean up /usr/lib/vmd directory"
326 +
327 + # adjust path in vmd wrapper
328 + sed \
329 + -e "s:${ED}::" -i "${ED}"/usr/bin/${PN} \
330 + -e "/^defaultvmddir/s:^.*$:defaultvmddir=\"${EPREFIX}/usr/$(get_libdir)/${PN}\":g" \
331 + || die "failed to set up vmd wrapper script"
332 +
333 + # install icon and generate desktop entry
334 + insinto /usr/share/pixmaps
335 + doins "${WORKDIR}"/vmd.png
336 + eprefixify "${WORKDIR}"/vmd.desktop
337 + sed -i '/^Path/d' "${WORKDIR}"/vmd.desktop || die
338 + domenu "${WORKDIR}"/vmd.desktop
339 +}