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 flag-o-matic 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}
46 python_prepare_all() {
48 -e "s:\"/usr:\"${EPREFIX}/usr:g" \
49 -e "/ext_comp_args.*+=/s:\[.*\]$:\[\]:g" \
50 -e "/import/s:argparse:argparseX:g" \
54 -e "s:/opt/local:${EPREFIX}/usr:g" \
55 -e '/ext_comp_args/s:\[.*\]:[]:g' \
58 append-cxxflags -std=c++0x
60 distutils-r1_python_prepare_all
64 distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
68 -e "/APBS_BINARY_LOCATION/s:None:\"${EPREFIX}/usr/bin/apbs\":g" \
69 -e "/APBS_PSIZE_LOCATION/s:None:\"$(python_get_sitedir)/pdb2pqr/src/\":g" \
70 -e "/APBS_PDB2PQR_LOCATION/s:None:\"$(python_get_sitedir)/pdb2pqr/\":g" \
71 -i "${D}/$(python_get_sitedir)"/pmg_tk/startup/apbs_tools.py || die
74 python_install_all() {
75 distutils-r1_python_install_all
78 -e '1i#!/usr/bin/env python' \
79 "${D}/$(python_get_sitedir)"/pymol/__init__.py > "${T}"/${PN} || die
81 python_foreach_impl python_doscript "${T}"/${PN}
83 # These environment variables should not go in the wrapper script, or else
84 # it will be impossible to use the PyMOL libraries from Python.
85 cat >> "${T}"/20pymol <<- EOF
86 PYMOL_PATH="${EPREFIX}/usr/share/pymol"
87 PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
88 PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
93 newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
94 make_desktop_entry ${PN} PyMol ${PN} \
95 "Graphics;Education;Science;Chemistry;" \
96 "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;"
99 rm -rf "${D}/$(python_get_sitedir)/web" || die
102 rm -f "${ED}"/usr/share/${PN}/LICENSE || die
106 fdo-mime_desktop_database_update
107 fdo-mime_mime_database_update
111 fdo-mime_desktop_database_update
112 fdo-mime_mime_database_update