1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
10 inherit distutils-r1 fdo-mime versionator
12 DESCRIPTION="A Python-extensible molecular graphics system"
13 HOMEPAGE="http://www.pymol.org/"
15 https://dev.gentoo.org/~jlec/distfiles/${PN}-1.7.0.0.png.xz
16 https://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz
18 # mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2
19 # git archive -v --prefix=${P}/ master -o ${P}.tar.xz
23 KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
27 dev-python/numpy[${PYTHON_USEDEP}]
28 dev-python/pyopengl[${PYTHON_USEDEP}]
33 media-video/mpeg-tools
35 virtual/pmw[${PYTHON_USEDEP}]
37 sci-chemistry/apbs[${PYTHON_USEDEP}]
38 sci-chemistry/pdb2pqr[${PYTHON_USEDEP}]
39 sci-chemistry/pymol-apbs-plugin[${PYTHON_USEDEP}]
41 web? ( !dev-python/webpy[${PYTHON_USEDEP}] )"
44 S="${WORKDIR}"/${P}/${PN}
47 "${FILESDIR}"/${PN}-1.7.3.1-maeffplugin.cpp.patch
50 python_prepare_all() {
52 -e "s:\"/usr:\"${EPREFIX}/usr:g" \
53 -e "/ext_comp_args.*+=/s:\[.*\]$:\[\]:g" \
54 -e "/import/s:argparse:argparseX:g" \
57 rm ./modules/pmg_tk/startup/apbs_tools.py || die
60 -e "s:/opt/local:${EPREFIX}/usr:g" \
61 -e '/ext_comp_args/s:\[.*\]:[]:g' \
64 distutils-r1_python_prepare_all
68 distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
71 python_install_all() {
72 distutils-r1_python_install_all
74 python_export python2_7 EPYTHON
76 # These environment variables should not go in the wrapper script, or else
77 # it will be impossible to use the PyMOL libraries from Python.
78 cat >> "${T}"/20pymol <<- EOF
79 PYMOL_PATH="$(python_get_sitedir)/${PN}"
80 PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
81 PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
86 newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
87 make_desktop_entry ${PN} PyMol ${PN} \
88 "Graphics;Education;Science;Chemistry;" \
89 "MimeType=chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2;chemical/seq-aa-fasta;chemical/seq-na-fasta;chemical/x-xyz;chemical/x-mdl-sdf;"
92 rm -rf "${D}/$(python_get_sitedir)/web" || die
95 rm -f "${ED}"/usr/share/${PN}/LICENSE || die
99 fdo-mime_desktop_database_update
100 fdo-mime_mime_database_update
104 fdo-mime_desktop_database_update
105 fdo-mime_mime_database_update