diff options
author | rakuco <rakuco@FreeBSD.org> | 2015-12-09 00:49:43 +0800 |
---|---|---|
committer | rakuco <rakuco@FreeBSD.org> | 2015-12-09 00:49:43 +0800 |
commit | 2447b762ada630bfd429c970df6b7dbdfeaf0a11 (patch) | |
tree | 344b6abf61ea06069f5de2c1cdcb8209791ac07e /Mk/Uses | |
parent | 761533d12d1c53c68d9d0d582a3964731b76fb2c (diff) | |
download | freebsd-ports-graphics-2447b762ada630bfd429c970df6b7dbdfeaf0a11.tar.gz freebsd-ports-graphics-2447b762ada630bfd429c970df6b7dbdfeaf0a11.tar.zst freebsd-ports-graphics-2447b762ada630bfd429c970df6b7dbdfeaf0a11.zip |
PyQt: Replace bsd.pyqt.mk with Uses/pyqt.mk.
In preparation for landing PyQt5 ports, generalize devel/py-qt4's
bsd.pyqt.mk and make it a proper file in Uses/.
Ports wishing to depend on PyQt4 ports can now do the following:
USES= pyqt:4
USE_PYQT= foo bar_build baz_run
Other changes include the renaming of the PYQT4_DIST variable to PYQT_DIST
and the introduction of the PYQT_SIPDIR plist substitution variable. The
rest of the contents of Uses/pyqt.mk are pretty much identical to what we
had in bsd.pyqt.mk with additional processing of USE_PYQT.
Even though this patch touches files in many different ports, the goal is
for it to be a no-op from an end-user perspective (so that the basic
infrastructure is landed before the other, riskier changes): no dependencies
have been changed, PyQt/SIP/QScintilla have not been upgraded and the plists
should remain exactly the same, since PYQT_SIPDIR currently contains the
same value that used to be hardcoded in the plists.
Huge thanks to Guido Falsi (madpilot@) for spearheading most of the work: he
took the initiative to work on PyQt5 and sent D2910 to Phabricator with the
original version of this patch. Tobias Berner (tcberner@gmail.com) later
applied it to kde@'s experimental area51 repositories and did some more work
on it.
Diffstat (limited to 'Mk/Uses')
-rw-r--r-- | Mk/Uses/pyqt.mk | 223 |
1 files changed, 223 insertions, 0 deletions
diff --git a/Mk/Uses/pyqt.mk b/Mk/Uses/pyqt.mk new file mode 100644 index 00000000000..b655f6bb94d --- /dev/null +++ b/Mk/Uses/pyqt.mk @@ -0,0 +1,223 @@ +# $FreeBSD$ +# +# Handle PyQt related ports +# +# Feature: pyqt +# Usage: USES=pyqt:ARGS +# Valid ARGS: 4 +# +# MAINTAINER: kde@FreeBSD.org +# +# Internal Port variables for PyQt ports: +# PYQT_DIST - This port is part of PyQt4 itself. Variables and +# targets are then set assuming a certain tarball and +# port layout. +# USE_PYQT - List of PyQt components to depend on +# * foo_build only build depend +# * foo_run only run depend +# * foo both (default) +# SIPDIR - Absolute path where sip files will be installed +# SIPDIR_REL - Relative version of SIPDIR +# +# Also PYQT_SIPDIR=${SIPDIR_REL} will be added to PLIST_SUB. +# + +.if !defined(_INCLUDE_USES_PYQT_MK) +_INCLUDE_USES_PYQT_MK= yes + +# At the moment we support PyQt bindings versions 4, sip +# option is for internal use by the py-sip ports. +_PYQT_SUPPORTED= 4 sip + +.if empty(pyqt_ARGS) +IGNORE= pyqt needs a qt-version (${_PYQT_SUPPORTED}) +.endif + +# At the moment we support PyQt bindings version 4 +.for ver in ${_PYQT_SUPPORTED:O:u} +. if ${pyqt_ARGS:M${ver}} +. if empty(_PYQT_VERSION) +_PYQT_VERSION= ${ver} +. else +IGNORE?= cannot be installed: different PYQT versions specified via pyqt:[${_PYQT_SUPPORTED:S/ //g}] +. endif +. endif +.endfor + +.if empty(_PYQT_VERSION) +IGNORE?= USES=pyqt needs a version number (valid values: ${_PYQT_SUPPORTED}) +.endif + +PYQT_MAINTAINER= kde@FreeBSD.org + +MASTER_SITE_RIVERBANK= http://www.riverbankcomputing.com/static/Downloads/%SUBDIR%/ + +MASTER_SITES_SIP= SF/pyqt/sip/sip-${PORTVERSION} \ + GENTOO +MASTER_SITES_PYQT4= SF/pyqt/PyQt4/PyQt-${PORTVERSION} \ + GENTOO +MASTER_SITES_QSCI2= SF/pyqt/QScintilla2/QScintilla-${PORTVERSION} \ + GENTOO + +SIP_VERSION= 4.16.5 +QSCI2_VERSION= 2.8.4 +PYQT4_VERSION= 4.11.3 + +SIP_DISTNAME= sip-${SIP_VERSION} +PYQT4_DISTNAME= PyQt-x11-gpl-${PYQT4_VERSION} +PYQT4_DISTINFO_FILE= ${.CURDIR}/../../devel/${PYQT_RELNAME}/distinfo +QSCI2_DISTNAME= QScintilla-gpl-${QSCI2_VERSION} + +# PyQt components split up into pyqt4/pyqt5 (upcoming)/... +_USE_PYQT_ALL= core dbus demo designer doc gui \ + multimedia network opengl qscintilla2 \ + sql svg test webkit xml xmlpatterns sip +# List of components only in pyqt4 +_USE_PYQT4_ONLY= assistant declarative dbussupport \ + designerplugin help phonon script \ + scripttools + +# Unversioned variables for the rest of the file +PYQT_VERSION= ${PYQT${_PYQT_VERSION}_VERSION} +PYQT_RELNAME= py-qt${_PYQT_VERSION} +PYQT_PY_RELNAME= ${PYTHON_PKGNAMEPREFIX}qt${_PYQT_VERSION} +PYQT_MASTERSITES= ${MASTER_SITES_PYQT${_PYQT_VERSION}} +PYQT_DISTNAME= ${PYQT${_PYQT_VERSION}_DISTNAME} +PYQT_DISTINFO_FILE= ${PYQT${_PYQT_VERSION}_DISTINFO_FILE} + +py-sip_PATH= ${PYTHON_PKGNAMEPREFIX}sip>=${SIP_VERSION} + +py-assistant_PATH= ${PYQT_PY_RELNAME}-assistant>=${PYQT_VERSION} +py-core_PATH= ${PYQT_PY_RELNAME}-core>=${PYQT_VERSION} +py-dbus_PATH= ${PYQT_PY_RELNAME}-dbus>=${PYQT_VERSION} +py-dbussupport_PATH= ${PYQT_PY_RELNAME}-dbussupport>=${PYQT_VERSION} +py-declarative_PATH= ${PYQT_PY_RELNAME}-declarative>=${PYQT_VERSION} +py-demo_PATH= ${PYQT_PY_RELNAME}-demo>=${PYQT_VERSION} +py-designer_PATH= ${PYQT_PY_RELNAME}-designer>=${PYQT_VERSION} +py-designerplugin_PATH= ${PYQT_PY_RELNAME}-designerplugin>=${PYQT_VERSION} +py-doc_PATH= ${PYQT_PY_RELNAME}-doc>=${PYQT_VERSION} +py-gui_PATH= ${PYQT_PY_RELNAME}-gui>=${PYQT_VERSION} +py-help_PATH= ${PYQT_PY_RELNAME}-help>=${PYQT_VERSION} +py-multimedia_PATH= ${PYQT_PY_RELNAME}-multimedia>=${PYQT_VERSION} +py-network_PATH= ${PYQT_PY_RELNAME}-network>=${PYQT_VERSION} +py-opengl_PATH= ${PYQT_PY_RELNAME}-opengl>=${PYQT_VERSION} +py-phonon_PATH= ${PYQT_PY_RELNAME}-phonon>=${PYQT_VERSION} +py-qscintilla2_PATH= ${PYQT_PY_RELNAME}-qscintilla2>=${QSCI2_VERSION} +py-script_PATH= ${PYQT_PY_RELNAME}-script>=${PYQT_VERSION} +py-scripttools_PATH= ${PYQT_PY_RELNAME}-scripttools>=${PYQT_VERSION} +py-sql_PATH= ${PYQT_PY_RELNAME}-sql>=${PYQT_VERSION} +py-svg_PATH= ${PYQT_PY_RELNAME}-svg>=${PYQT_VERSION} +py-test_PATH= ${PYQT_PY_RELNAME}-test>=${PYQT_VERSION} +py-webkit_PATH= ${PYQT_PY_RELNAME}-webkit>=${PYQT_VERSION} +py-xml_PATH= ${PYQT_PY_RELNAME}-xml>=${PYQT_VERSION} +py-xmlpatterns_PATH= ${PYQT_PY_RELNAME}-xmlpatterns>=${PYQT_VERSION} + +py-sip_PORT= devel/py-sip + +py-assistant_PORT= devel/${PYQT_RELNAME}-assistant +py-core_PORT= devel/${PYQT_RELNAME}-core +py-dbus_PORT= devel/${PYQT_RELNAME}-dbus +py-dbussupport_PORT= devel/${PYQT_RELNAME}-dbussupport +py-declarative_PORT= devel/${PYQT_RELNAME}-declarative +py-demo_PORT= misc/${PYQT_RELNAME}-demo +py-designer_PORT= devel/${PYQT_RELNAME}-designer +py-designerplugin_PORT= devel/${PYQT_RELNAME}-designerplugin +py-doc_PORT= misc/${PYQT_RELNAME}-doc +py-gui_PORT= x11-toolkits/${PYQT_RELNAME}-gui +py-help_PORT= devel/${PYQT_RELNAME}-help +py-multimedia_PORT= multimedia/${PYQT_RELNAME}-multimedia +py-network_PORT= net/${PYQT_RELNAME}-network +py-opengl_PORT= x11/${PYQT_RELNAME}-opengl +py-phonon_PORT= multimedia/${PYQT_RELNAME}-phonon +py-qscintilla2_PORT= devel/${PYQT_RELNAME}-qscintilla2 +py-script_PORT= devel/${PYQT_RELNAME}-script +py-scripttools_PORT= devel/${PYQT_RELNAME}-scripttools +py-sql_PORT= databases/${PYQT_RELNAME}-sql +py-svg_PORT= graphics/${PYQT_RELNAME}-svg +py-test_PORT= devel/${PYQT_RELNAME}-test +py-webkit_PORT= www/${PYQT_RELNAME}-webkit +py-xml_PORT= textproc/${PYQT_RELNAME}-xml +py-xmlpatterns_PORT= textproc/${PYQT_RELNAME}-xmlpatterns + +py-assistant_DESC= Python bindings for QtAssistant module +py-core_DESC= Python bindings for QtCore module +py-dbus_DESC= Python bindings for QtDBus module +py-dbussupport_DESC= Qt event loop support for dbus-python +py-declarative_DESC= Python bindings for QtDeclarative module +py-demo_DESC= PyQt demo and examples +py-designer_DESC= Python bindings for QtDesigner module +py-designerplugin_DESC= Python bindings for QtDesigner plugin +py-doc_DESC= PyQt documentation +py-gui_DESC= Python bindings for QtGui module +py-help_DESC= Python bindings for QtHelp module +py-multimedia_DESC= Python bindings for Multimedia module +py-network_DESC= Python bindings for QtNetwork module +py-opengl_DESC= Python bindings for QtOpenGL module +py-phonon_DESC= Python bindings for Phonon module +py-qscintilla2_DESC= Python bindings for QScintilla2 +py-script_DESC= Python bindings for QtScript module +py-scripttools_DESC= Python bindings for QtScriptTools module +py-sql_DESC= Python bindings for QtSql module +py-svg_DESC= Python bindings for QtSvg module +py-test_DESC= Python bindings for QtTest module +py-webkit_DESC= Python bindings for QtWebKit module +py-xml_DESC= Python bindings for QtXml module +py-xmlpatterns_DESC= Python bindings for QtXmlPatterns module + +SIPDIR_REL= share/py-sip +SIPDIR= ${PREFIX}/${SIPDIR_REL} +PLIST_SUB+= PYQT_SIPDIR=${SIPDIR_REL} + +.if defined(PYQT_DIST) +PORTVERSION= ${PYQT_VERSION} +MASTER_SITES= ${PYQT_MASTERSITES} +PKGNAMEPREFIX= ${PYQT_PY_RELNAME}- +DISTNAME= ${PYQT_DISTNAME} +DISTINFO_FILE= ${PYQT_DISTINFO_FILE} +HAS_CONFIGURE= yes +QT_NONSTANDARD= yes # Do not add unknown arguments to CONFIGURE_ARGS. + +PATCHDIR= ${.CURDIR}/../../devel/${PYQT_RELNAME}-core/files +QSCIDIR= ${PREFIX}/share/qt${_PYQT_VERSION}/qsci +CONFIGURE_ARGS+=-b ${PREFIX}/bin \ + -d ${PYTHONPREFIX_SITELIBDIR} \ + -q ${QMAKE} \ + --confirm-license \ + --sipdir ${SIPDIR} + +# One of the things PyQt looks for to determine whether to build the Qt DBus +# main loop module (${PYQT_RELNAME}-dbussupport) is whether the dbus/ directory is +# present. Only extract it for that port then. +.if ${PORTNAME} != "dbussupport" +EXTRACT_AFTER_ARGS+= --exclude "${DISTNAME}/dbus" +.endif # ${PORTNAME} != "dbussupport" + +.if !target(do-configure) +do-configure: + cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \ + ${PYTHON_CMD} configure.py ${CONFIGURE_ARGS} +.endif # !target(do-configure) +.endif # defined(PYQT_DIST) + +# Set build and run depends -- we need to prefix them internally with "py-" +# else we conflict with the ones defined in bsd.qt.mk with the same name +_USE_PYQT_ALL+= ${_USE_PYQT${_PYQT_VERSION}_ONLY} +.for comp in ${_USE_PYQT_ALL:O:u} +_USE_PYQT_ALL_SUFFIXED+= py-${comp} py-${comp}_build py-${comp}_run +py-${comp}_BUILD_DEPENDS?= ${py-${comp}_PATH}:${PORTSDIR}/${py-${comp}_PORT} +py-${comp}_RUN_DEPENDS?= ${py-${comp}_PATH}:${PORTSDIR}/${py-${comp}_PORT} +py-${comp}_build_BUILD_DEPENDS?= ${py-${comp}_BUILD_DEPENDS} +py-${comp}_run_RUN_DEPENDS?= ${py-${comp}_RUN_DEPENDS} +.endfor + +_USE_PYQT= ${USE_PYQT:O:u} +.for comp in ${_USE_PYQT} +. if ${_USE_PYQT_ALL_SUFFIXED:Mpy-${comp}} +BUILD_DEPENDS+= ${py-${comp}_BUILD_DEPENDS} +RUN_DEPENDS+= ${py-${comp}_RUN_DEPENDS} +. else +IGNORE?= cannot be installed: unknown USE_PYQT component ${comp} #' +. endif +.endfor + +.endif # defined(_INCLUDE_USES_PYQT_MK) |