Sync Mk with ports
[dports.git] / Mk / Uses / pyqt.mk
1 # $FreeBSD$
2 #
3 # Handle PyQt related ports
4 #
5 # Feature:      pyqt
6 # Usage:        USES=pyqt:ARGS
7 # Valid ARGS:   4,5
8 #
9 # MAINTAINER:   kde@FreeBSD.org
10 #
11 # Internal Port variables for PyQt ports:
12 # PYQT_DIST     - This port is part of PyQt4/5 itself. Variables and
13 #               targets are then set assuming a certain tarball and
14 #               port layout.
15 # USE_PYQT      - List of PyQt components to depend on
16 #               * foo_build    only build depend
17 #               * foo_run      only run depend
18 #               * foo          both (default)
19 # SIPDIR        - Absolute path where sip files will be installed
20 # SIPDIR_REL    - Relative version of SIPDIR
21 #
22 # Also PYQT_SIPDIR=${SIPDIR_REL} will be added to PLIST_SUB.
23 #
24
25 .if !defined(_INCLUDE_USES_PYQT_MK)
26 _INCLUDE_USES_PYQT_MK=  yes
27
28 # At the moment we support PyQt bindings versions 4 and 5, sip
29 # option is for internal use by the py-sip ports.
30 _PYQT_SUPPORTED=        4 5 sip
31
32 .if empty(pyqt_ARGS)
33 IGNORE= pyqt needs a qt-version (${_PYQT_SUPPORTED})
34 .endif
35
36 # At the moment we support PyQt bindings versions 4 and 5
37 .for ver in ${_PYQT_SUPPORTED:O:u}
38 .  if ${pyqt_ARGS:M${ver}}
39 .    if empty(_PYQT_VERSION)
40 _PYQT_VERSION=  ${ver}
41 .    else
42 IGNORE?=        cannot be installed: different PYQT versions specified via pyqt:[${_PYQT_SUPPORTED:S/ //g}]
43 .    endif
44 .  endif
45 .endfor
46
47 .if empty(_PYQT_VERSION)
48 IGNORE?=        USES=pyqt needs a version number (valid values: ${_PYQT_SUPPORTED})
49 .endif
50
51 PYQT_MAINTAINER=        kde@FreeBSD.org
52
53 MASTER_SITE_RIVERBANK=  http://www.riverbankcomputing.com/static/Downloads/%SUBDIR%/
54
55 MASTER_SITES_SIP=       SF/pyqt/sip/sip-${PORTVERSION} \
56                         GENTOO
57 MASTER_SITES_PYQT4=     SF/pyqt/PyQt4/PyQt-${PORTVERSION} \
58                         GENTOO
59 MASTER_SITES_PYQT5=     SF/pyqt/PyQt5/PyQt-${PORTVERSION} \
60                         GENTOO
61 MASTER_SITES_QSCI2=     SF/pyqt/QScintilla2/QScintilla-${PORTVERSION} \
62                         GENTOO
63
64 SIP_VERSION=            4.17
65 QSCI2_VERSION=          2.9.1
66 PYQT4_VERSION=          4.11.4
67 PYQT5_VERSION=          5.5.1
68
69 SIP_DISTNAME=           sip-${SIP_VERSION}
70 PYQT4_DISTNAME=         PyQt-x11-gpl-${PYQT4_VERSION}
71 PYQT4_DISTINFO_FILE=    ${.CURDIR}/../../devel/${PYQT_RELNAME}/distinfo
72 PYQT5_DISTNAME=         PyQt-gpl-${PYQT5_VERSION}
73 PYQT5_DISTINFO_FILE=    ${.CURDIR}/../../devel/py-qt5/distinfo
74 QSCI2_DISTNAME=         QScintilla-gpl-${QSCI2_VERSION}
75
76 # PyQt components split up into pyqt4/pyqt5/...
77 _USE_PYQT_ALL=          core dbus dbussupport demo designer designerplugin \
78                         doc gui multimedia network opengl qscintilla2 \
79                         sql svg test webkit xml xmlpatterns sip
80 # List of components only in pyqt4
81 _USE_PYQT4_ONLY=        assistant declarative \
82                         help phonon script scripttools
83 # List of components only in pyqt5
84 _USE_PYQT5_ONLY=        multimediawidgets printsupport qml serialport \
85                         webkitwidgets widgets
86
87 # Unversioned variables for the rest of the file
88 PYQT_VERSION=           ${PYQT${_PYQT_VERSION}_VERSION}
89 PYQT_RELNAME=           py-qt${_PYQT_VERSION}
90 PYQT_PY_RELNAME=        ${PYTHON_PKGNAMEPREFIX}qt${_PYQT_VERSION}
91 PYQT_MASTERSITES=       ${MASTER_SITES_PYQT${_PYQT_VERSION}}
92 PYQT_DISTNAME=          ${PYQT${_PYQT_VERSION}_DISTNAME}
93 PYQT_DISTINFO_FILE=     ${PYQT${_PYQT_VERSION}_DISTINFO_FILE}
94
95 py-sip_PATH=            ${PYTHON_PKGNAMEPREFIX}sip>=${SIP_VERSION}
96
97 py-assistant_PATH=      ${PYQT_PY_RELNAME}-assistant>=${PYQT_VERSION}
98 py-core_PATH=           ${PYQT_PY_RELNAME}-core>=${PYQT_VERSION}
99 py-dbus_PATH=           ${PYQT_PY_RELNAME}-dbus>=${PYQT_VERSION}
100 py-dbussupport_PATH=    ${PYQT_PY_RELNAME}-dbussupport>=${PYQT_VERSION}
101 py-declarative_PATH=    ${PYQT_PY_RELNAME}-declarative>=${PYQT_VERSION}
102 py-demo_PATH=           ${PYQT_PY_RELNAME}-demo>=${PYQT_VERSION}
103 py-designer_PATH=       ${PYQT_PY_RELNAME}-designer>=${PYQT_VERSION}
104 py-designerplugin_PATH= ${PYQT_PY_RELNAME}-designerplugin>=${PYQT_VERSION}
105 py-doc_PATH=            ${PYQT_PY_RELNAME}-doc>=${PYQT_VERSION}
106 py-gui_PATH=            ${PYQT_PY_RELNAME}-gui>=${PYQT_VERSION}
107 py-help_PATH=           ${PYQT_PY_RELNAME}-help>=${PYQT_VERSION}
108 py-multimedia_PATH=     ${PYQT_PY_RELNAME}-multimedia>=${PYQT_VERSION}
109 py-network_PATH=        ${PYQT_PY_RELNAME}-network>=${PYQT_VERSION}
110 py-opengl_PATH=         ${PYQT_PY_RELNAME}-opengl>=${PYQT_VERSION}
111 py-phonon_PATH=         ${PYQT_PY_RELNAME}-phonon>=${PYQT_VERSION}
112 py-qscintilla2_PATH=    ${PYQT_PY_RELNAME}-qscintilla2>=${QSCI2_VERSION}
113 py-script_PATH=         ${PYQT_PY_RELNAME}-script>=${PYQT_VERSION}
114 py-scripttools_PATH=    ${PYQT_PY_RELNAME}-scripttools>=${PYQT_VERSION}
115 py-sql_PATH=            ${PYQT_PY_RELNAME}-sql>=${PYQT_VERSION}
116 py-svg_PATH=            ${PYQT_PY_RELNAME}-svg>=${PYQT_VERSION}
117 py-test_PATH=           ${PYQT_PY_RELNAME}-test>=${PYQT_VERSION}
118 py-webkit_PATH=         ${PYQT_PY_RELNAME}-webkit>=${PYQT_VERSION}
119 py-xml_PATH=            ${PYQT_PY_RELNAME}-xml>=${PYQT_VERSION}
120 py-xmlpatterns_PATH=    ${PYQT_PY_RELNAME}-xmlpatterns>=${PYQT_VERSION}
121
122 py-multimediawidgets_PATH=      ${PYQT_PY_RELNAME}-multimediawidgets>=${PYQT_VERSION}
123 py-qml_PATH=                    ${PYQT_PY_RELNAME}-qml>=${PYQT_VERSION}
124 py-printsupport_PATH=           ${PYQT_PY_RELNAME}-printsupport>=${PYQT_VERSION}
125 py-serialport_PATH=             ${PYQT_PY_RELNAME}-serialport>=${PYQT_VERSION}
126 py-webkitwidgets_PATH=          ${PYQT_PY_RELNAME}-webkitwidgets>=${PYQT_VERSION}
127 py-widgets_PATH=                ${PYQT_PY_RELNAME}-widgets>=${PYQT_VERSION}
128
129 py-sip_PORT=            devel/py-sip
130
131 py-assistant_PORT=      devel/${PYQT_RELNAME}-assistant
132 py-core_PORT=           devel/${PYQT_RELNAME}-core
133 py-dbus_PORT=           devel/${PYQT_RELNAME}-dbus
134 py-dbussupport_PORT=    devel/${PYQT_RELNAME}-dbussupport
135 py-declarative_PORT=    devel/${PYQT_RELNAME}-declarative
136 py-demo_PORT=           misc/${PYQT_RELNAME}-demo
137 py-designer_PORT=       devel/${PYQT_RELNAME}-designer
138 py-designerplugin_PORT= devel/${PYQT_RELNAME}-designerplugin
139 py-doc_PORT=            misc/${PYQT_RELNAME}-doc
140 py-gui_PORT=            x11-toolkits/${PYQT_RELNAME}-gui
141 py-help_PORT=           devel/${PYQT_RELNAME}-help
142 py-multimedia_PORT=     multimedia/${PYQT_RELNAME}-multimedia
143 py-network_PORT=        net/${PYQT_RELNAME}-network
144 py-opengl_PORT=         x11/${PYQT_RELNAME}-opengl
145 py-phonon_PORT=         multimedia/${PYQT_RELNAME}-phonon
146 py-qscintilla2_PORT=    devel/${PYQT_RELNAME}-qscintilla2
147 py-script_PORT=         devel/${PYQT_RELNAME}-script
148 py-scripttools_PORT=    devel/${PYQT_RELNAME}-scripttools
149 py-sql_PORT=            databases/${PYQT_RELNAME}-sql
150 py-svg_PORT=            graphics/${PYQT_RELNAME}-svg
151 py-test_PORT=           devel/${PYQT_RELNAME}-test
152 py-webkit_PORT=         www/${PYQT_RELNAME}-webkit
153 py-xml_PORT=            textproc/${PYQT_RELNAME}-xml
154 py-xmlpatterns_PORT=    textproc/${PYQT_RELNAME}-xmlpatterns
155
156 py-multimediawidgets_PORT=      multimedia/py-qt5-multimediawidgets
157 py-qml_PORT=                    lang/py-qt5-qml
158 py-printsupport_PORT=           print/py-qt5-printsupport
159 py-serialport_PORT=             comms/py-qt5-serialport
160 py-webkitwidgets_PORT=          www/py-qt5-webkitwidgets
161 py-widgets_PORT=                x11-toolkits/py-qt5-widgets
162
163 py-assistant_DESC=      Python bindings for QtAssistant module
164 py-core_DESC=           Python bindings for QtCore module
165 py-dbus_DESC=           Python bindings for QtDBus module
166 py-dbussupport_DESC=    Qt event loop support for dbus-python
167 py-declarative_DESC=    Python bindings for QtDeclarative module
168 py-demo_DESC=           PyQt demo and examples
169 py-designer_DESC=       Python bindings for QtDesigner module
170 py-designerplugin_DESC= Python bindings for QtDesigner plugin
171 py-doc_DESC=            PyQt documentation
172 py-gui_DESC=            Python bindings for QtGui module
173 py-help_DESC=           Python bindings for QtHelp module
174 py-multimedia_DESC=     Python bindings for Multimedia module
175 py-network_DESC=        Python bindings for QtNetwork module
176 py-opengl_DESC=         Python bindings for QtOpenGL module
177 py-phonon_DESC=         Python bindings for Phonon module
178 py-qscintilla2_DESC=    Python bindings for QScintilla2
179 py-script_DESC=         Python bindings for QtScript module
180 py-scripttools_DESC=    Python bindings for QtScriptTools module
181 py-sql_DESC=            Python bindings for QtSql module
182 py-svg_DESC=            Python bindings for QtSvg module
183 py-test_DESC=           Python bindings for QtTest module
184 py-webkit_DESC=         Python bindings for QtWebKit module
185 py-xml_DESC=            Python bindings for QtXml module
186 py-xmlpatterns_DESC=    Python bindings for QtXmlPatterns module
187
188 py-multimediawidgets_DESC=      Python bindings for QtMultimediaWidgets module
189 py-qml_DESC=                    Python bindings for Qml module
190 py-printsupport_DESC=           Python bindings for Printsupport module
191 py-serialport_DESC=             Python bindings for QtSerialPort
192 py-webkitwidgets_DESC=          Python bindings for QtWebKitWidgets module
193 py-widgets_DESC=                Python bindings for QTWidgets module
194
195 SIPDIR_REL=     share/py-sip/PyQt${_PYQT_VERSION}
196 SIPDIR=         ${PREFIX}/${SIPDIR_REL}
197 PLIST_SUB+=     PYQT_SIPDIR=${SIPDIR_REL}
198
199 .if defined(PYQT_DIST)
200 PORTVERSION=    ${PYQT_VERSION}
201 MASTER_SITES=   ${PYQT_MASTERSITES}
202 PKGNAMEPREFIX=  ${PYQT_PY_RELNAME}-
203 DISTNAME=       ${PYQT_DISTNAME}
204 DISTINFO_FILE=  ${PYQT_DISTINFO_FILE}
205 HAS_CONFIGURE=  yes
206 QT_NONSTANDARD= yes  # Do not add unknown arguments to CONFIGURE_ARGS.
207
208 .if ${_PYQT_VERSION} > 4
209 # PyQt5's configure.py generates .pro files and calls qmake to generate the
210 # Makefiles. qmake's Makefiles use INSTALL_ROOT instead of DESTDIR.
211 DESTDIRNAME=    INSTALL_ROOT
212 .endif
213
214 PATCHDIR=       ${.CURDIR}/../../devel/${PYQT_RELNAME}-core/files
215 QSCIDIR=        ${PREFIX}/share/qt${_PYQT_VERSION}/qsci
216 CONFIGURE_ARGS+=-b ${PREFIX}/bin \
217                 -d ${PYTHONPREFIX_SITELIBDIR} \
218                 -q ${QMAKE} \
219                 --confirm-license \
220                 --sipdir ${SIPDIR}
221
222 # One of the things PyQt looks for to determine whether to build the Qt DBus
223 # main loop module (${PYQT_RELNAME}-dbussupport) is whether the dbus/ directory is
224 # present. Only extract it for that port then.
225 .if ${PORTNAME} != "dbussupport"
226 EXTRACT_AFTER_ARGS+=    --exclude "${DISTNAME}/dbus"
227 .endif  # ${PORTNAME} != "dbussupport"
228
229 .if !target(do-configure)
230 do-configure:
231         cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
232                 ${PYTHON_CMD} configure.py ${CONFIGURE_ARGS}
233 .endif  # !target(do-configure)
234 .endif  # defined(PYQT_DIST)
235
236 # Set build and run depends -- we need to prefix them internally with "py-"
237 # else we conflict with the ones defined in bsd.qt.mk with the same name
238 _USE_PYQT_ALL+=                 ${_USE_PYQT${_PYQT_VERSION}_ONLY}
239 .for comp in ${_USE_PYQT_ALL:O:u}
240 _USE_PYQT_ALL_SUFFIXED+=                py-${comp} py-${comp}_build py-${comp}_run
241 py-${comp}_BUILD_DEPENDS?=              ${py-${comp}_PATH}:${py-${comp}_PORT}
242 py-${comp}_RUN_DEPENDS?=                ${py-${comp}_PATH}:${py-${comp}_PORT}
243 py-${comp}_build_BUILD_DEPENDS?=        ${py-${comp}_BUILD_DEPENDS}
244 py-${comp}_run_RUN_DEPENDS?=            ${py-${comp}_RUN_DEPENDS}
245 .endfor
246
247 _USE_PYQT=      ${USE_PYQT:O:u}
248 .for comp in ${_USE_PYQT}
249 .  if ${_USE_PYQT_ALL_SUFFIXED:Mpy-${comp}}
250 BUILD_DEPENDS+=         ${py-${comp}_BUILD_DEPENDS}
251 RUN_DEPENDS+=           ${py-${comp}_RUN_DEPENDS}
252 .  else
253 IGNORE?=        cannot be installed: unknown USE_PYQT component ${comp} #'
254 .  endif
255 .endfor
256
257 .endif # defined(_INCLUDE_USES_PYQT_MK)