Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyside6/
Date: Mon, 07 Nov 2022 10:18:35
Message-Id: 1667816299.d79f30e45438c5ff4ab6bcea46966c24d155817a.andrewammerlaan@gentoo
1 commit: d79f30e45438c5ff4ab6bcea46966c24d155817a
2 Author: Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
3 AuthorDate: Fri Oct 28 07:21:39 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 7 10:18:19 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d79f30e4
7
8 dev-python/pyside6: add 6.4.0
9
10 - add charts and network-auth modules
11 - add templates for httpserver, pdf{,widgets} and spatialaudio modules
12 - adjust some required use and outdated dependencies
13
14 Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
15 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
16
17 dev-python/pyside6/Manifest | 1 +
18 dev-python/pyside6/metadata.xml | 2 +
19 dev-python/pyside6/pyside6-6.4.0.ebuild | 223 ++++++++++++++++++++++++++++++++
20 3 files changed, 226 insertions(+)
21
22 diff --git a/dev-python/pyside6/Manifest b/dev-python/pyside6/Manifest
23 index d775a81b0c8a..0e0ec12a5299 100644
24 --- a/dev-python/pyside6/Manifest
25 +++ b/dev-python/pyside6/Manifest
26 @@ -1 +1,2 @@
27 DIST pyside-setup-opensource-src-6.3.2.tar.xz 7853068 BLAKE2B 5b39e2f98bca0155d3f6617be206b759b628d0126fd30d76d67352c5c78a385938ce61a3c42b75343b9fde708e9f66617122c687ea9ecffca9cd0ab3af91a2ff SHA512 8d25d20b64ac7874e9b7866f101b6bfd7b6fe1fffa602fec6113e1fdaa11608f14a58c2ae1d87b45ee3eac6a07bd55e66dbbd222727cfe6860d8f444bc2b1ff0
28 +DIST pyside-setup-opensource-src-6.4.0.tar.xz 8551772 BLAKE2B 180d9f2182b8df04394677bbcb0765764d9de1f34064fc688a3ccae8ec37174b4a01fa70c80d98c7ca7fe6b45239225bd801c552d332e2c6fc4a3726535e72e9 SHA512 0517408f110830b888f04777c60b29479831604877da13c5a41a710888ebe53064f06d9b7b61d5c6e6a483ac5ee1639a63bb7f9844301df53e3e9ca8eafcf9e9
29
30 diff --git a/dev-python/pyside6/metadata.xml b/dev-python/pyside6/metadata.xml
31 index 7ae8b44a69d4..ae61fd0e0866 100644
32 --- a/dev-python/pyside6/metadata.xml
33 +++ b/dev-python/pyside6/metadata.xml
34 @@ -10,6 +10,7 @@
35 <name>Bernd Waibel</name>
36 </maintainer>
37 <use>
38 + <flag name="charts">Build QtCharts module</flag>
39 <flag name="concurrent">Build QtConcurrent module</flag>
40 <flag name="designer">Build QtDesigner and QtUiTools modules</flag>
41 <flag name="gles2-only">Build QtGui "QOpenGL*" classes</flag>
42 @@ -17,6 +18,7 @@
43 <flag name="help">Build QtHelp module</flag>
44 <flag name="multimedia">Build QtMultimedia and QtMultimediaWidgets modules</flag>
45 <flag name="network">Build QtNetwork module</flag>
46 + <flag name="network-auth">Build QtNetworkAuth module</flag>
47 <flag name="positioning">Build QtPositioning module</flag>
48 <flag name="printsupport">Build QtPrintSupport module</flag>
49 <flag name="qml">Build QtQml module</flag>
50
51 diff --git a/dev-python/pyside6/pyside6-6.4.0.ebuild b/dev-python/pyside6/pyside6-6.4.0.ebuild
52 new file mode 100644
53 index 000000000000..d1d803dcf7e3
54 --- /dev/null
55 +++ b/dev-python/pyside6/pyside6-6.4.0.ebuild
56 @@ -0,0 +1,223 @@
57 +# Copyright 1999-2022 Gentoo Authors
58 +# Distributed under the terms of the GNU General Public License v2
59 +
60 +EAPI=8
61 +
62 +# TODO: Add PyPy once officially supported. See also:
63 +# https://bugreports.qt.io/browse/PYSIDE-535
64 +PYTHON_COMPAT=( python3_{8..11} )
65 +
66 +inherit cmake python-r1 virtualx
67 +
68 +# TODO: Add conditional support for "QtRemoteObjects" via a new "remoteobjects"
69 +# USE flag after an external "dev-qt/qtremoteobjects" package has been created.
70 +# TODO: Add conditional support for apidoc generation via a new "doc" USE flag.
71 +# Note that doing so requires the Qt source tree, sphinx, and graphviz. Once
72 +# ready, pass the ${QT_SRC_DIR} variable to cmake to enable this support.
73 +# TODO: Disable GLES support if the "gles2-only" USE flag is disabled. Note
74 +# that the "PySide6/QtGui/CMakeLists.txt" and
75 +# "PySide6/QtOpenGLFunctions/CMakeLists.txt" files test for GLES support by
76 +# testing whether the "Qt5::Gui" list property defined by
77 +# "/usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake" at "dev-qt/qtgui" installation
78 +# time contains the substring "opengles2". Since cmake does not permit
79 +# properties to be overridden from the command line, these files must instead
80 +# be conditionally patched to avoid these tests. An issue should be filed with
81 +# upstream requesting a CLI-settable variable to control this.
82 +
83 +MY_P=pyside-setup-opensource-src-${PV}
84 +
85 +DESCRIPTION="Python bindings for the Qt framework"
86 +HOMEPAGE="https://wiki.qt.io/PySide6"
87 +SRC_URI="https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-${PV}-src/${MY_P}.tar.xz"
88 +S="${WORKDIR}/${MY_P}/sources/pyside6"
89 +
90 +# See "sources/pyside6/PySide6/licensecomment.txt" for licensing details.
91 +# Shall we allow essential modules to be disabled? They are:
92 +# (core), gui, widgets, printsupport, sql, network, testlib, concurrent,
93 +# x11extras (for X)
94 +LICENSE="|| ( GPL-2 GPL-3+ LGPL-3 )"
95 +SLOT="0"
96 +KEYWORDS="~amd64"
97 +IUSE="
98 + +dbus charts +concurrent designer gles2-only +gui help multimedia
99 + +network network-auth +opengl positioning +printsupport qml quick
100 + quick3d serialport +sql svg test +testlib webchannel webengine
101 + websockets +widgets +xml
102 +"
103 +
104 +# Manually reextract these requirements on version bumps by running the
105 +# following one-liner from within "${S}":
106 +# $ grep 'set.*_deps' PySide6/Qt*/CMakeLists.txt
107 +# Note that the "designer" USE flag corresponds to the "Qt6UiTools" module.
108 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
109 + charts? ( gui widgets )
110 + designer? ( widgets )
111 + gles2-only? ( gui )
112 + gui? ( dbus opengl )
113 + help? ( network sql widgets )
114 + multimedia? ( gui network )
115 + network-auth? ( network )
116 + opengl? ( gui )
117 + printsupport? ( widgets )
118 + qml? ( network )
119 + quick? ( gui network opengl qml )
120 + quick3d? ( gui network opengl qml quick )
121 + sql? ( widgets )
122 + svg? ( gui )
123 + testlib? ( widgets )
124 + webchannel? ( qml )
125 + webengine? ( network gui printsupport quick webchannel )
126 + websockets? ( network )
127 + widgets? ( gui )
128 +"
129 +
130 +# Tests fail pretty bad and I'm not fixing them right now
131 +RESTRICT="test"
132 +
133 +# Minimal supported version of Qt.
134 +QT_PV="$(ver_cut 1-2):6"
135 +
136 +RDEPEND="${PYTHON_DEPS}
137 + >=dev-python/shiboken6-${PV}[${PYTHON_USEDEP}]
138 + >=dev-qt/qtbase-${QT_PV}[concurrent?,dbus?,gles2-only=,network?,opengl?,sql?,widgets?,xml?]
139 + charts? ( >=dev-qt/qtcharts-${QT_PV} )
140 + designer? ( >=dev-qt/qttools-${QT_PV}[designer] )
141 + gui? (
142 + >=dev-qt/qtbase-${QT_PV}[gui,jpeg]
143 + x11-libs/libxkbcommon
144 + )
145 + help? ( >=dev-qt/qttools-${QT_PV}[assistant] )
146 + multimedia? ( >=dev-qt/qtmultimedia-${QT_PV}[qml(+)?,gles2-only(-)=,widgets(+)?] )
147 + network-auth? ( >=dev-qt/qtnetworkauth-${QT_PV} )
148 + positioning? ( >=dev-qt/qtpositioning-${QT_PV} )
149 + printsupport? ( >=dev-qt/qtbase-${QT_PV}[gui,widgets] )
150 + qml? ( >=dev-qt/qtdeclarative-${QT_PV}[widgets?] )
151 + quick3d? ( >=dev-qt/qtquick3d-${QT_PV} )
152 + serialport? ( >=dev-qt/qtserialport-${QT_PV} )
153 + svg? ( >=dev-qt/qtsvg-${QT_PV} )
154 + testlib? ( >=dev-qt/qtbase-${QT_PV}[gui] )
155 + webchannel? ( >=dev-qt/qtwebchannel-${QT_PV} )
156 + webengine? ( >=dev-qt/qtwebengine-${QT_PV}[widgets?] )
157 + websockets? ( >=dev-qt/qtwebsockets-${QT_PV} )
158 +"
159 +DEPEND="${RDEPEND}
160 + test? ( >=dev-qt/qtbase-${QT_PV}[gui] )
161 +"
162 +# testlib is toggled by the gui flag on qtbase
163 +
164 +PATCHES=(
165 + "${FILESDIR}/${PN}-6.3.1-no-strip.patch"
166 + "${FILESDIR}/${PN}-6.3.1-fix-designer-plugin-install-location.patch"
167 +)
168 +
169 +src_configure() {
170 + # See collect_module_if_found macros in PySideHelpers.cmake
171 + local mycmakeargs=(
172 + -DBUILD_TESTS=$(usex test)
173 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DAnimation=yes
174 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DCore=yes
175 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DExtras=yes
176 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DInput=yes
177 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DLogic=yes
178 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DRender=yes
179 + #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6AxContainer=yes
180 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Bluetooth=yes
181 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Charts=$(usex !charts)
182 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Concurrent=$(usex !concurrent)
183 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DataVisualization=yes
184 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DBus=$(usex !dbus)
185 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Designer=$(usex !designer)
186 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Gui=$(usex !gui)
187 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Help=$(usex !help)
188 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6HttpServer=yes
189 + #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6Location=yes
190 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Multimedia=$(usex !multimedia)
191 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6MultimediaWidgets=$(usex !multimedia yes $(usex !widgets))
192 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6NetworkAuth=$(usex !network-auth)
193 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Network=$(usex !network)
194 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Nfc=yes
195 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGL=$(usex !opengl)
196 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGLWidgets=$(usex !opengl yes $(usex !widgets))
197 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Pdf=yes
198 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PdfWidgets=yes
199 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Positioning=$(usex !positioning)
200 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PrintSupport=$(usex !printsupport)
201 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Qml=$(usex !qml)
202 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick3D=$(usex !quick3d)
203 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick=$(usex !quick)
204 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickControls2=yes
205 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickWidgets=$(usex !quick yes $(usex !widgets))
206 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6RemoteObjects=yes
207 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Scxml=yes
208 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sensors=yes
209 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SerialPort=$(usex !serialport)
210 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SpatialAudio=yes
211 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sql=$(usex !sql)
212 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6StateMachine=yes
213 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Svg=$(usex !svg)
214 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SvgWidgets=$(usex !svg yes $(usex !widgets))
215 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Test=$(usex !testlib)
216 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6TextToSpeech=yes
217 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6UiTools=$(usex !designer)
218 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebChannel=$(usex !webchannel)
219 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineCore=$(usex !webengine)
220 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineQuick=$(usex !webengine yes $(usex !quick))
221 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineWidgets=$(usex !webengine yes $(usex !widgets))
222 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebSockets=$(usex !websockets)
223 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Widgets=$(usex !widgets)
224 + #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6WinExtras=yes
225 + -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Xml=$(usex !xml)
226 + # try to avoid pre-stripping
227 + -DQFP_NO_OVERRIDE_OPTIMIZATION_FLAGS=yes
228 + -DQFP_NO_STRIP=yes
229 +
230 + )
231 +
232 + pyside6_configure() {
233 + local mycmakeargs=(
234 + "${mycmakeargs[@]}"
235 + -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
236 + -DPYTHON_EXECUTABLE="${PYTHON}"
237 + -DPYTHON_SITE_PACKAGES="$(python_get_sitedir)"
238 + -DSHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX="-${EPYTHON}"
239 + )
240 + cmake_src_configure
241 + }
242 + python_foreach_impl pyside6_configure
243 +}
244 +
245 +src_compile() {
246 + python_foreach_impl cmake_src_compile
247 +}
248 +
249 +src_test() {
250 + local -x PYTHONDONTWRITEBYTECODE
251 + python_foreach_impl virtx cmake_src_test
252 +}
253 +
254 +src_install() {
255 + pyside6_install() {
256 + cmake_src_install
257 + python_optimize
258 +
259 + # Uniquify the shiboken6 pkgconfig dependency in the PySide6 pkgconfig
260 + # file for the current Python target. See also:
261 + # https://github.com/leycec/raiagent/issues/73
262 + sed -i -e 's~^Requires: shiboken6$~&-'${EPYTHON}'~' \
263 + "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}.pc || die
264 +
265 + # Uniquify the PySide6 pkgconfig file for the current Python target,
266 + # preserving an unversioned "pyside6.pc" file arbitrarily associated
267 + # with the last Python target. (See the previously linked issue.)
268 + cp "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}{,-${EPYTHON}}.pc || die
269 + }
270 + python_foreach_impl pyside6_install
271 +
272 + # CMakeLists.txt installs a "PySide6Targets-gentoo.cmake" file forcing
273 + # downstream consumers (e.g., pyside6-tools) to target one
274 + # "libpyside6-*.so" library linked to one Python interpreter. See also:
275 + # https://bugreports.qt.io/browse/PYSIDE-1053
276 + # https://github.com/leycec/raiagent/issues/74
277 + sed -i -e 's~pyside6-python[[:digit:]]\+\.[[:digit:]]\+~pyside6${PYTHON_CONFIG_SUFFIX}~g' \
278 + "${ED}/usr/$(get_libdir)/cmake/PySide6-${PV}/PySide6Targets-${CMAKE_BUILD_TYPE,,}.cmake" || die
279 +}