Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 05:48:25 +0000 (UTC)
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r465257 - in head/science/py-pymol: . files
Message-ID:  <201803220548.w2M5mPYP051160@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuri
Date: Thu Mar 22 05:48:25 2018
New Revision: 465257
URL: https://svnweb.freebsd.org/changeset/ports/465257

Log:
  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.

Added:
  head/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py   (contents, props changed)
Modified:
  head/science/py-pymol/Makefile

Modified: head/science/py-pymol/Makefile
==============================================================================
--- head/science/py-pymol/Makefile	Thu Mar 22 04:45:38 2018	(r465256)
+++ head/science/py-pymol/Makefile	Thu Mar 22 05:48:25 2018	(r465257)
@@ -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
@@ -29,6 +32,19 @@ USE_PYTHON=	distutils concurrent # autoplist is broken
 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

Added: head/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/science/py-pymol/files/patch-modules_pymol_Qt_____init____.py	Thu Mar 22 05:48:25 2018	(r465257)
@@ -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'



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803220548.w2M5mPYP051160>