Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jun 2014 14:06:17 +0000 (UTC)
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r358702 - head/devel/py-qt4-core
Message-ID:  <201406211406.s5LE6Huu001757@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rakuco
Date: Sat Jun 21 14:06:17 2014
New Revision: 358702
URL: http://svnweb.freebsd.org/changeset/ports/358702
QAT: https://qat.redports.org/buildarchive/r358702/

Log:
  Build with Python 3 as well.
  
  Instead of forcefully removing the pyuic/uic/port_v3/ directory, which in
  effect prevents the port from building with Python 3, check for the major
  Python version being used and selectively remove either port_v2/ or
  port_v3/.
  
  Additionally, set PYTHON_PY3K_PLIST_HACK, since PyQt does not use either
  distutils or setuptools, and Python >= 3.2 store .pyc/.pyo files in a
  different directory.
  
  PR:		180467
  Submitted by:	nwhitehorn@ (original version)
  MFH:		2014Q2

Modified:
  head/devel/py-qt4-core/Makefile
  head/devel/py-qt4-core/pkg-plist

Modified: head/devel/py-qt4-core/Makefile
==============================================================================
--- head/devel/py-qt4-core/Makefile	Sat Jun 21 13:54:14 2014	(r358701)
+++ head/devel/py-qt4-core/Makefile	Sat Jun 21 14:06:17 2014	(r358702)
@@ -3,6 +3,7 @@
 
 PORTNAME=	core
 PORTVERSION=	${PYQT4_VERSION}
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITES_PYQT4}
@@ -17,6 +18,7 @@ RUN_DEPENDS:=	${BUILD_DEPENDS}
 
 DISTINFO_FILE=	${PYQT4_DISTINFO_FILE}
 HAS_CONFIGURE=	yes
+PYTHON_PY3K_PLIST_HACK=	yes
 USE_PYTHON=	yes
 USE_QT4=	corelib qmake_build moc_build
 
@@ -38,7 +40,7 @@ ARGS=		-b ${PREFIX}/bin \
 		CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
 
 .include "${.CURDIR}/../py-qt4/bsd.pyqt.mk"
-.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
 
 .if empty(PORT_OPTIONS:MAPI)
 ARGS+=		--no-qsci-api
@@ -53,8 +55,16 @@ PLIST_SUB+=	API=""
 ARGS+=		--debug --trace
 .endif
 
+# Bug 180467: We need to remove the port_v${VERSION} directory that does not
+# correspond to the Python version being used to avoid failures in the
+# bytecompilation calls in post-install.
+PLIST_SUB+= PYTHON_MAJOR_VER="${PYTHON_MAJOR_VER}"
 post-patch:
+.if ${PYTHON_MAJOR_VER} == "2"
 	${RM} -rf ${WRKSRC}/pyuic/uic/port_v3
+.elif ${PYTHON_MAJOR_VER} == "3"
+	${RM} -rf ${WRKSRC}/pyuic/uic/port_v2
+.endif
 
 do-configure:
 	cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV}\
@@ -75,4 +85,4 @@ post-install:
 		${PYTHON_CMD} -O ${PYTHON_LIBDIR}/py_compile.py\
 		`ls *.py */*.py */*/*.py`
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Modified: head/devel/py-qt4-core/pkg-plist
==============================================================================
--- head/devel/py-qt4-core/pkg-plist	Sat Jun 21 13:54:14 2014	(r358701)
+++ head/devel/py-qt4-core/pkg-plist	Sat Jun 21 14:06:17 2014	(r358702)
@@ -54,27 +54,27 @@ bin/pyuic4
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/objcreator.py
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/objcreator.pyc
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/objcreator.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/__init__.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/__init__.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/__init__.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/as_string.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/as_string.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/as_string.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/ascii_upper.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/ascii_upper.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/ascii_upper.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/invoke.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/invoke.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/invoke.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/load_plugin.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/load_plugin.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/load_plugin.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/proxy_base.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/proxy_base.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/proxy_base.pyo
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/string_io.py
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/string_io.pyc
-%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2/string_io.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/__init__.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/__init__.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/__init__.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/as_string.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/as_string.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/as_string.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/ascii_upper.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/ascii_upper.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/ascii_upper.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/invoke.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/invoke.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/invoke.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/load_plugin.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/load_plugin.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/load_plugin.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/proxy_base.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/proxy_base.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/proxy_base.pyo
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/string_io.py
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/string_io.pyc
+%%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%/string_io.pyo
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/properties.py
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/properties.pyc
 %%PYTHON_SITELIBDIR%%/PyQt4/uic/properties.pyo
@@ -200,7 +200,7 @@ share/py-sip/QtCore/qxmlstream.sip
 %%API%%share/qt4/qsci/api/python/QtCore.api
 @dirrm share/py-sip/QtCore
 @dirrmtry %%PYTHON_SITELIBDIR%%/PyQt4/uic/widget-plugins
-@dirrm %%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v2
+@dirrm %%PYTHON_SITELIBDIR%%/PyQt4/uic/port_v%%PYTHON_MAJOR_VER%%
 @dirrm %%PYTHON_SITELIBDIR%%/PyQt4/uic/Loader
 @dirrm %%PYTHON_SITELIBDIR%%/PyQt4/uic/Compiler
 @dirrmtry %%PYTHON_SITELIBDIR%%/PyQt4/uic



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