summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2014-03-13 08:16:23 +0000
committerJustin Lecher <jlec@gentoo.org>2014-03-13 08:16:23 +0000
commitd63a56ee25b2468a0533770cbf16b1462b0865ca (patch)
treee0ec7553106db145429b4993555ff84c2daa74af /sci-chemistry
parentUse python_doexe() to make it non-dependant on Python wrapping implementation... (diff)
downloadgentoo-2-d63a56ee25b2468a0533770cbf16b1462b0865ca.tar.gz
gentoo-2-d63a56ee25b2468a0533770cbf16b1462b0865ca.tar.bz2
gentoo-2-d63a56ee25b2468a0533770cbf16b1462b0865ca.zip
sci-chemistry/pymol: Backport fix for broken labels
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/pymol/ChangeLog8
-rw-r--r--sci-chemistry/pymol/files/pymol-1.7.0.4-fix-broken-label-scaling-on-Linux.patch79
-rw-r--r--sci-chemistry/pymol/pymol-1.7.0.4-r1.ebuild104
3 files changed, 190 insertions, 1 deletions
diff --git a/sci-chemistry/pymol/ChangeLog b/sci-chemistry/pymol/ChangeLog
index f5a97ddc2778..b6626a5e7595 100644
--- a/sci-chemistry/pymol/ChangeLog
+++ b/sci-chemistry/pymol/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-chemistry/pymol
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/ChangeLog,v 1.109 2014/03/10 07:08:07 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/ChangeLog,v 1.110 2014/03/13 08:16:23 jlec Exp $
+
+*pymol-1.7.0.4-r1 (13 Mar 2014)
+
+ 13 Mar 2014; Justin Lecher <jlec@gentoo.org> +pymol-1.7.0.4-r1.ebuild,
+ +files/pymol-1.7.0.4-fix-broken-label-scaling-on-Linux.patch:
+ Backport fix for broken labels
*pymol-1.7.0.4 (10 Mar 2014)
diff --git a/sci-chemistry/pymol/files/pymol-1.7.0.4-fix-broken-label-scaling-on-Linux.patch b/sci-chemistry/pymol/files/pymol-1.7.0.4-fix-broken-label-scaling-on-Linux.patch
new file mode 100644
index 000000000000..359a3bc9c78c
--- /dev/null
+++ b/sci-chemistry/pymol/files/pymol-1.7.0.4-fix-broken-label-scaling-on-Linux.patch
@@ -0,0 +1,79 @@
+From 5c744d0dcf3ae717ce774e07e24812a543f4a866 Mon Sep 17 00:00:00 2001
+From: speleo3 <speleo3@21428953-86e3-433d-9a34-2224224d0fc8>
+Date: Mon, 10 Mar 2014 15:50:16 +0000
+Subject: [PATCH] fix broken label scaling on Linux
+
+- label scaling became distorted on window resizing
+- minor readability update in label.vs (no change)
+
+
+git-svn-id: svn://svn.code.sf.net/p/pymol/code/trunk@4069 21428953-86e3-433d-9a34-2224224d0fc8
+---
+ pymol/data/shaders/label.vs | 17 ++++++++---------
+ pymol/layer1/Scene.c | 10 ----------
+ 2 files changed, 8 insertions(+), 19 deletions(-)
+
+diff --git a/pymol/data/shaders/label.vs b/pymol/data/shaders/label.vs
+index b179530..58d9dad 100644
+--- a/pymol/data/shaders/label.vs
++++ b/pymol/data/shaders/label.vs
+@@ -21,16 +21,15 @@ uniform float fog_enabled; // actually bool
+
+ void main()
+ {
+- vec4 transformedPosition = gl_ModelViewProjectionMatrix * attr_worldpos;
+- transformedPosition.xyz = transformedPosition.xyz/transformedPosition.w;
+- transformedPosition.w = 1.;
+- transformedPosition.xy = transformedPosition.xy + attr_screenworldoffset.xy/(screenSize*screenOriginVertexScale);
+- transformedPosition.z = transformedPosition.z + attr_screenworldoffset.z/(screenSize.x*screenOriginVertexScale);
+- transformedPosition.x = transformedPosition.x + aspectRatioAdjustment * attr_screenoffset.x * 2./screenSize.x;
+- transformedPosition.y = transformedPosition.y + attr_screenoffset.y * 2./screenSize.y;
+- gl_Position = transformedPosition;
++ vec4 pos = gl_ModelViewProjectionMatrix * attr_worldpos;
++ pos /= pos.w;
++ pos.xyz += attr_screenworldoffset / (screenSize.xyx * screenOriginVertexScale);
++ pos.xy += attr_screenoffset.xy * 2. / screenSize * vec2(aspectRatioAdjustment, 1.);
++
++ gl_Position = pos;
+ textureLookup = attr_texcoords;
+- normalizedViewCoordinate = (gl_Position.xyz/gl_Position.w) / 2.0 + 0.5;
++ normalizedViewCoordinate = pos.xyz / 2.0 + 0.5;
++
+ if (fog_enabled > 0.5) {
+ vec3 eye_pos = vec3(gl_ModelViewMatrix * attr_worldpos);
+ fog = max(0.0, (gl_Fog.end - abs(eye_pos.z)) * gl_Fog.scale);
+diff --git a/pymol/layer1/Scene.c b/pymol/layer1/Scene.c
+index 639f737..59ee89e 100644
+--- a/pymol/layer1/Scene.c
++++ b/pymol/layer1/Scene.c
+@@ -1972,13 +1972,8 @@ void SceneGetImageSize(PyMOLGlobals * G, int *width, int *height)
+ void SceneGetImageSizeFast(PyMOLGlobals * G, int *width, int *height)
+ {
+ register CScene *I = G->Scene;
+- if(I->Image) {
+- *width = I->Image->width;
+- *height = I->Image->height;
+- } else {
+ *width = I->Width;
+ *height = I->Height;
+- }
+ }
+ void SceneGetImageSizeFastAdjustForGrid(PyMOLGlobals * G, int *width, int *height){
+ register CScene *I = G->Scene;
+@@ -1986,13 +1981,8 @@ void SceneGetImageSizeFastAdjustForGrid(PyMOLGlobals * G, int *width, int *heigh
+ *width = I->grid.cur_viewport_size[0];
+ *height = I->grid.cur_viewport_size[1];
+ } else {
+- if(I->Image) {
+- *width = I->Image->width;
+- *height = I->Image->height;
+- } else {
+ *width = I->Width;
+ *height = I->Height;
+- }
+ }
+ }
+
+--
+1.9.0
+
diff --git a/sci-chemistry/pymol/pymol-1.7.0.4-r1.ebuild b/sci-chemistry/pymol/pymol-1.7.0.4-r1.ebuild
new file mode 100644
index 000000000000..29c0fe58de9d
--- /dev/null
+++ b/sci-chemistry/pymol/pymol-1.7.0.4-r1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/pymol-1.7.0.4-r1.ebuild,v 1.1 2014/03/13 08:16:23 jlec Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="tk"
+
+inherit distutils-r1 fdo-mime versionator
+
+DESCRIPTION="A Python-extensible molecular graphics system"
+HOMEPAGE="http://www.pymol.org/"
+SRC_URI="
+ http://dev.gentoo.org/~jlec/distfiles/${PN}-1.7.0.0.png.xz
+ http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz
+"
+# mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2
+
+LICENSE="PSF-2.2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="apbs web"
+
+DEPEND="
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pmw[${PYTHON_USEDEP}]
+ dev-python/pyopengl[${PYTHON_USEDEP}]
+ media-libs/freetype:2
+ media-libs/glew
+ media-libs/libpng
+ media-video/mpeg-tools
+ sys-libs/zlib
+ media-libs/freeglut
+ apbs? (
+ dev-libs/maloc
+ sci-chemistry/apbs
+ sci-chemistry/pdb2pqr
+ sci-chemistry/pymol-apbs-plugin[${PYTHON_USEDEP}]
+ )
+ web? ( !dev-python/webpy[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${P}/${PN}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-broken-label-scaling-on-Linux.patch
+)
+
+python_prepare_all() {
+ sed \
+ -e "s:\"/usr:\"${EPREFIX}/usr:g" \
+ -e "/ext_comp_args/s:=\[.*\]$:= \[\]:g" \
+ -e "/import/s:argparse:argparseX:g" \
+ -i setup.py || die
+
+ rm ./modules/pmg_tk/startup/apbs_tools.py || die
+
+ sed \
+ -e "s:/opt/local:${EPREFIX}/usr:g" \
+ -e '/ext_comp_args/s:\[.*\]:[]:g' \
+ -i setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_install() {
+ distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ python_export python2_7 EPYTHON
+
+ # These environment variables should not go in the wrapper script, or else
+ # it will be impossible to use the PyMOL libraries from Python.
+ cat >> "${T}"/20pymol <<- EOF
+ PYMOL_PATH="$(python_get_sitedir)/${PN}"
+ PYMOL_DATA="${EPREFIX}/usr/share/pymol/data"
+ PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts"
+ EOF
+
+ doenvd "${T}"/20pymol
+
+ newicon "${WORKDIR}"/${PN}-1.7.0.0.png ${PN}.png
+ make_desktop_entry pymol PyMol ${PN} "Graphics;Education;Science;Chemistry" "MimeType=chemical/x-pdb;"
+
+ if ! use web; then
+ rm -rf "${D}/$(python_get_sitedir)/web" || die
+ fi
+
+ rm -f "${ED}"/usr/share/${PN}/LICENSE || die
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}