Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/PyQt6/
Date: Wed, 03 Aug 2022 00:22:26
Message-Id: 1659486084.8de55366bacf6b14e74ce9adca0df10ee9fd1d3e.ionen@gentoo
1 commit: 8de55366bacf6b14e74ce9adca0df10ee9fd1d3e
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 20 07:25:08 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 3 00:21:24 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8de55366
7
8 dev-python/PyQt6: new package, add 6.3.1
9
10 May still be rough around the edges, currently only tested with
11 qutebrowser so please report if missing anything for other consumers.
12
13 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
14
15 dev-python/PyQt6/Manifest | 1 +
16 dev-python/PyQt6/PyQt6-6.3.1.ebuild | 149 ++++++++++++++++++++++++++++++++++++
17 dev-python/PyQt6/metadata.xml | 35 +++++++++
18 3 files changed, 185 insertions(+)
19
20 diff --git a/dev-python/PyQt6/Manifest b/dev-python/PyQt6/Manifest
21 new file mode 100644
22 index 000000000000..631567942685
23 --- /dev/null
24 +++ b/dev-python/PyQt6/Manifest
25 @@ -0,0 +1 @@
26 +DIST PyQt6-6.3.1.tar.gz 1015220 BLAKE2B e225f2da11eec482ab8e00f886a858cec4a2c8add764f5e54bf603959394aad7f12d91b92c1ba6ab98d1b25903d4404e6667232258a87c52c95a2abdae9ccd2d SHA512 94319cd0983eb3f9bb0f1acbc620a1631a37f82e2fcffb9d0e58437fb1c120640be1e2a0a09e98e03f6c7082a2d94e9eabceefa6b07bae354f77bda02ba92d58
27
28 diff --git a/dev-python/PyQt6/PyQt6-6.3.1.ebuild b/dev-python/PyQt6/PyQt6-6.3.1.ebuild
29 new file mode 100644
30 index 000000000000..4eee1c118cf4
31 --- /dev/null
32 +++ b/dev-python/PyQt6/PyQt6-6.3.1.ebuild
33 @@ -0,0 +1,149 @@
34 +# Copyright 2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +DISTUTILS_USE_PEP517=sip
40 +PYTHON_COMPAT=( python3_{8..11} )
41 +inherit distutils-r1 flag-o-matic multiprocessing qmake-utils
42 +
43 +QT_PV="6.3:6" # minimum tested qt version
44 +
45 +DESCRIPTION="Python bindings for the Qt framework"
46 +HOMEPAGE="https://www.riverbankcomputing.com/software/pyqt/"
47 +SRC_URI="mirror://pypi/${P::1}/${PN}/${P}.tar.gz"
48 +
49 +LICENSE="GPL-3"
50 +SLOT="0"
51 +KEYWORDS="~amd64"
52 +# currently keeping defaults in sync with qtbase, and beside that trying to
53 +# stay minimal'ish given each builds relatively slowly (but still subject to
54 +# change if something is needed by most consumers)
55 +IUSE="
56 + +dbus debug qml designer examples gles2-only +gui help multimedia
57 + +network opengl positioning printsupport quick quick3d serialport
58 + +sql +ssl svg testlib webchannel websockets +widgets +xml"
59 +# see `grep -r "%Import " sip` and `grep qmake_QT project.py`
60 +REQUIRED_USE="
61 + designer? ( gui widgets )
62 + help? ( gui widgets )
63 + multimedia? ( gui network )
64 + opengl? ( gui )
65 + printsupport? ( gui widgets )
66 + qml? ( network )
67 + quick3d? ( gui qml )
68 + quick? ( gui qml )
69 + sql? ( widgets )
70 + svg? ( gui )
71 + testlib? ( gui widgets )
72 + webchannel? ( network )
73 + websockets? ( network )
74 + widgets? ( gui )"
75 +
76 +# note: xml(+) for now given qtbase-6.3.1-r0 is missing IUSE=xml with a TODO
77 +DEPEND="
78 + >=dev-qt/qtbase-${QT_PV}[dbus?,gles2-only=,gui?,network?,opengl?,sql?,ssl=,widgets?,xml(+)?]
79 + dbus? (
80 + dev-python/dbus-python[${PYTHON_USEDEP}]
81 + sys-apps/dbus
82 + )
83 + designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
84 + help? ( >=dev-qt/qttools-${QT_PV}[assistant] )
85 + multimedia? ( >=dev-qt/qtmultimedia-${QT_PV} )
86 + positioning? ( >=dev-qt/qtpositioning-${QT_PV} )
87 + qml? ( >=dev-qt/qtdeclarative-${QT_PV} )
88 + quick3d? ( >=dev-qt/qtquick3d-${QT_PV} )
89 + serialport? ( >=dev-qt/qtserialport-${QT_PV} )
90 + svg? ( >=dev-qt/qtsvg-${QT_PV} )
91 + webchannel? ( >=dev-qt/qtwebchannel-${QT_PV} )
92 + websockets? ( >=dev-qt/qtwebsockets-${QT_PV} )"
93 +RDEPEND="
94 + ${DEPEND}
95 + >=dev-python/PyQt6_sip-13.4[${PYTHON_USEDEP}]"
96 +BDEPEND="
97 + >=dev-python/PyQt-builder-1.11[${PYTHON_USEDEP}]
98 + >=dev-qt/qtbase-${QT_PV}
99 + sys-devel/gcc
100 + dbus? ( virtual/pkgconfig )"
101 +
102 +src_prepare() {
103 + default
104 +
105 + # hack: qmake wants g++ (not clang), try to respect ${CHOST} #726112
106 + mkdir "${T}"/cxx || die
107 + ln -s "$(type -P ${CHOST}-g++ || type -P g++ || die)" "${T}"/cxx/g++ || die
108 + PATH=${T}/cxx:${PATH}
109 +}
110 +
111 +src_configure() {
112 + append-cxxflags -std=c++17 # for clang and old gcc that default to <17
113 +
114 + pyqt-use_enable() {
115 + local state=$(usex ${1} --enable= --disable=)
116 + shift
117 + echo ${*/#/${state}}
118 + }
119 +
120 + # hack: currently lacking qt6_get_bindir (or alternatively have
121 + # qmake6 in PATH like qmake5 is so it wouldn't matter)
122 + local qmake6=$(qt5_get_bindir)/qmake6
123 + qmake6=${qmake6//qt5/qt6}
124 +
125 + DISTUTILS_ARGS=(
126 + --jobs=$(makeopts_jobs)
127 + --qmake="${qmake6}"
128 + --qmake-setting="$(qt5_get_qmake_args)"
129 + --verbose
130 + --confirm-license
131 +
132 + # TODO: enable/restrict more as qt6 packages/USE get added
133 + --disable=QAxContainer
134 + --disable=QtBluetooth
135 + --enable=QtCore
136 + $(pyqt-use_enable dbus QtDBus)
137 + $(pyqt-use_enable designer QtDesigner)
138 + $(pyqt-use_enable help QtHelp)
139 + $(pyqt-use_enable gui QtGui)
140 + #--disable=QtLocation # force-disabled in project.py
141 + $(pyqt-use_enable multimedia QtMultimedia \
142 + $(usev widgets QtMultimediaWidgets))
143 + $(pyqt-use_enable network QtNetwork)
144 + --disable=QtNfc
145 + $(pyqt-use_enable opengl QtOpenGL \
146 + $(usev widgets QtOpenGLWidgets))
147 + $(pyqt-use_enable positioning QtPositioning)
148 + $(pyqt-use_enable printsupport QtPrintSupport)
149 + $(pyqt-use_enable qml QtQml)
150 + $(pyqt-use_enable quick QtQuick \
151 + $(usev widgets QtQuickWidgets))
152 + $(pyqt-use_enable quick3d QtQuick3D)
153 + --disable=QtRemoteObjects
154 + --disable=QtSensors
155 + $(pyqt-use_enable serialport QtSerialPort)
156 + $(pyqt-use_enable sql QtSql)
157 + $(pyqt-use_enable svg QtSvg \
158 + $(usev widgets QtSvgWidgets))
159 + $(pyqt-use_enable testlib QtTest)
160 + #--disable=QtTextToSpeech # force-disabled in project.py
161 + $(pyqt-use_enable webchannel QtWebChannel)
162 + $(pyqt-use_enable websockets QtWebSockets)
163 + $(pyqt-use_enable widgets QtWidgets)
164 + $(pyqt-use_enable xml QtXml)
165 +
166 + $(usev debug '--debug --qml-debug --tracing')
167 +
168 + $(usev !dbus --no-dbus-python)
169 + # TODO?: plugins not in wheels by upstream, see project.py#L215
170 + # (if needed by something, will need to be added to python_install)
171 + $(usev !designer --no-designer-plugin)
172 + $(usev !qml --no-qml-plugin)
173 +
174 + $(usev !gles2-only --disabled-feature=PyQt_OpenGL_ES2)
175 + $(usev !ssl --disabled-feature=PyQt_SSL)
176 + )
177 +}
178 +
179 +python_install_all() {
180 + einstalldocs
181 + use examples && dodoc -r examples
182 +}
183
184 diff --git a/dev-python/PyQt6/metadata.xml b/dev-python/PyQt6/metadata.xml
185 new file mode 100644
186 index 000000000000..1872d32a4049
187 --- /dev/null
188 +++ b/dev-python/PyQt6/metadata.xml
189 @@ -0,0 +1,35 @@
190 +<?xml version="1.0" encoding="UTF-8"?>
191 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
192 +<pkgmetadata>
193 + <maintainer type="person">
194 + <email>ionen@g.o</email>
195 + <name>Ionen Wolkens</name>
196 + </maintainer>
197 + <use>
198 + <flag name="dbus">Build bindings for the QtDBus module</flag>
199 + <flag name="designer">Build bindings for the QtDesigner module and enable the designer plugin</flag>
200 + <flag name="gui">Build bindings for the QtGui module</flag>
201 + <flag name="help">Build bindings for the QtHelp module</flag>
202 + <flag name="multimedia">Build bindings for the QtMultimedia module</flag>
203 + <flag name="network">Build bindings for the QtNetwork module</flag>
204 + <flag name="opengl">Build bindings for the QtOpenGL module</flag>
205 + <flag name="positioning">Build bindings for the QtPositioning module</flag>
206 + <flag name="printsupport">Build bindings for the QtPrintSupport module</flag>
207 + <flag name="qml">Build bindings for the QtQml module and enable the qml plugin</flag>
208 + <flag name="quick">Build bindings for the QtQuick module</flag>
209 + <flag name="quick3d">Build bindings for the QtQuick3D module</flag>
210 + <flag name="serialport">Build bindings for the QtSerialPort module</flag>
211 + <flag name="sql">Build bindings for the QtSql module</flag>
212 + <flag name="svg">Build bindings for the QtSvg module</flag>
213 + <flag name="testlib">Build bindings for the QtTest module</flag>
214 + <flag name="webchannel">Build bindings for the QtWebChannel module</flag>
215 + <flag name="websockets">Build bindings for the QtWebSockets module</flag>
216 + <flag name="widgets">Build bindings for the QtWidgets module</flag>
217 + <flag name="xml">Build bindings for the QtXml module</flag>
218 + </use>
219 + <upstream>
220 + <bugs-to>https://www.riverbankcomputing.com/mailman/listinfo/pyqt/</bugs-to>
221 + <doc>https://www.riverbankcomputing.com/static/Docs/PyQt6/</doc>
222 + <remote-id type="pypi">PyQt6</remote-id>
223 + </upstream>
224 +</pkgmetadata>