aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2018-03-22 13:48:25 +0800
committerYuri Victorovich <yuri@FreeBSD.org>2018-03-22 13:48:25 +0800
commit5a2a5d32b93384840f87f58989893f0c9b31ae24 (patch)
treed22f935e646e4e5a4ecac91cc39f02630252071a
parentf138c0cebf436f5004169b582b05967b1c1db9a6 (diff)
downloadfreebsd-ports-5a2a5d32b93384840f87f58989893f0c9b31ae24.tar.gz
freebsd-ports-5a2a5d32b93384840f87f58989893f0c9b31ae24.tar.zst
freebsd-ports-5a2a5d32b93384840f87f58989893f0c9b31ae24.zip
science/py-pymol: Add GUI options QT5 and TK; Add missing dependency NUMPY
Now QT5 is the default, while Tk is still available as a second choice.
Notes
Notes: svn path=/head/; revision=465257
-rw-r--r--science/py-pymol/Makefile20
-rw-r--r--science/py-pymol/files/patch-modules_pymol_Qt_____init____.py20
2 files changed, 38 insertions, 2 deletions
diff --git a/science/py-pymol/Makefile b/science/py-pymol/Makefile
index bee0da31614f..88b79ef71cee 100644
--- a/science/py-pymol/Makefile
+++ b/science/py-pymol/Makefile
@@ -4,6 +4,7 @@
PORTNAME= pymol
DISTVERSIONPREFIX= v
DISTVERSION= 2.1.0
+PORTREVISION= 1
CATEGORIES= science biology python
MASTER_SITES= SF/pymol/pymol/2/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -16,11 +17,13 @@ LICENSE_NAME= Open-Source PyMOL Copyright
LICENSE_FILE= ${WRKSRC}/LICENSE
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}msgpack-python>0:devel/py-msgpack-python@${FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}Pmw>0:x11-toolkits/py-Pmw@${FLAVOR}
+BUILD_DEPENDS= ${PYNUMPY}
LIB_DEPENDS= libfreetype.so:print/freetype2 \
libpng.so:graphics/png \
libmsgpackc.so:devel/msgpack
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}msgpack-python>0:devel/py-msgpack-python@${FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}Pmw>0:x11-toolkits/py-Pmw@${FLAVOR} \
+ ${PYNUMPY}
USES= compiler:c++11-lang python:2.7 shebangfix tar:bz2
USE_GL= gl glew glu glut
@@ -30,6 +33,19 @@ SHEBANG_FILES= test/show test/run test/cyg
WRKSRC= ${WRKDIR}/pymol
+OPTIONS_SINGLE= GUI
+OPTIONS_SINGLE_GUI= QT5 TK
+OPTIONS_DEFAULT= QT5
+
+QT5_USES= pyqt:5
+QT5_USE= PYQT=core_run,gui_run,opengl_run
+
+post-patch-TK-on:
+ @${REINPLACE_CMD} -e ' \
+ 23s|if not PYQT_NAME:|if False:| ; \
+ s|from PyQt5 import|from X import|' \
+ ${WRKSRC}/modules/pymol/Qt/__init__.py
+
post-install:
@${REINPLACE_CMD} -i '' -e 's|#!/bin/bash|#!/bin/sh|' ${STAGEDIR}${PREFIX}/bin/pymol
@${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/pymol/_cmd.so
diff --git a/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py b/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py
new file mode 100644
index 000000000000..ef91b48ff01e
--- /dev/null
+++ b/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py
@@ -0,0 +1,20 @@
+--- modules/pymol/Qt/__init__.py.orig 2018-03-22 05:10:42 UTC
++++ modules/pymol/Qt/__init__.py
+@@ -28,7 +28,7 @@ if not PYQT_NAME:
+ if DEBUG:
+ print('import PyQt5 failed')
+
+-if not PYQT_NAME:
++if False:
+ try:
+ __import__("sip").setapi("QString", 2)
+ from PyQt4 import QtGui, QtCore, QtOpenGL
+@@ -37,7 +37,7 @@ if not PYQT_NAME:
+ if DEBUG:
+ print('import PyQt4 failed')
+
+-if not PYQT_NAME:
++if False:
+ try:
+ from PySide import QtGui, QtCore, QtOpenGL
+ PYQT_NAME = 'PySide'