summaryrefslogtreecommitdiff
path: root/dev-python/pyside
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-02-04 00:10:24 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-02-04 00:10:24 +0000
commit908e97e3e242743e9484f67c6f131955e6d0dadd (patch)
tree6983d82a1b66d15e489adac190f16fd663c2ec77 /dev-python/pyside
parent44f7bdd4803ecacf7943d21fdf2531eb2ea9aeff (diff)
gentoo auto-resync : 04:02:2025 - 00:10:23
Diffstat (limited to 'dev-python/pyside')
-rw-r--r--dev-python/pyside/Manifest11
-rw-r--r--dev-python/pyside/files/pyside-6.3.1-no-strip.patch26
-rw-r--r--dev-python/pyside/files/pyside-6.6.0-no-qtexampleicons.patch10
-rw-r--r--dev-python/pyside/files/pyside-6.8.2-no-qtexampleicons.patch10
-rw-r--r--dev-python/pyside/files/pyside-6.8.2-quick-fix-build-wheel.patch17
-rw-r--r--dev-python/pyside/metadata.xml59
-rw-r--r--dev-python/pyside/pyside-6.8.1.1.ebuild253
-rw-r--r--dev-python/pyside/pyside-6.8.1.ebuild253
-rw-r--r--dev-python/pyside/pyside-6.8.2.ebuild440
9 files changed, 1079 insertions, 0 deletions
diff --git a/dev-python/pyside/Manifest b/dev-python/pyside/Manifest
new file mode 100644
index 000000000000..d2d395381096
--- /dev/null
+++ b/dev-python/pyside/Manifest
@@ -0,0 +1,11 @@
+AUX pyside-6.3.1-no-strip.patch 953 BLAKE2B f88bac603a584213a864fcfc7c528f1d236ebdbfb653c3877316cd0b95c30c2f7288b1c81c6a90a3e4228536da4aa63552991fefa952f450b0b852b3e2aed94a SHA512 2920075a26fc059bdebc8eb5fa7c15de74729b7f8d1eb59197f7426afa7a65f1f78a8ebb76e946b2dfaf5817dbf090744bafaed2f2156f2d1548c2932a7ce61a
+AUX pyside-6.6.0-no-qtexampleicons.patch 221 BLAKE2B d45b4ebcd780a0151b793b5b21f5d7599ee5c427372ef19f518ac1c94306938178b0bfb603d9755aae9bddc4c31c35bb4648617c793f8e399f0f8dcce0d1f3bb SHA512 1da97be74142402454ef5384c58d2b2a792fea53b4155d7b5ede6d145496b45e4fd56723f8f7716150c2bba448ce816c6740059d7d38ae53d5cdf7c38c4acd7b
+AUX pyside-6.8.2-no-qtexampleicons.patch 285 BLAKE2B 13d406b6dde61962e3d47c651fc8041784fe2e71de626ab4a2884f045abb65d498ef05837d88e1a593ef4ca05914c4b45fa93605d504eef8f6cea00dfcafa4f6 SHA512 64f6bacb56a6930169ff4c727c5650ca8c515ad91733fcd8e4ddc1ec69c515f273ec619033f97e058d183d4fa1b80bb5464519cc21a12e513eb283a1964cb95c
+AUX pyside-6.8.2-quick-fix-build-wheel.patch 725 BLAKE2B d86c59ea666e0d21b6d7e43ddf0c9ba0f404c7543a02994239f12f4910a89c1a587b85122631da3bfa0818d3834ad3edac2bb5a54e2faafccadd463a3a534737 SHA512 2cd73337a8d1b9c5e9f774b97c3705265fbb61ef837fab438c8331e753508bffd125fbf2d9e235a496fe905038e5fb7e9247ba732f9af50416a4d6378386945c
+DIST pyside-pyside-setup-6.8.1.1.gh.tar.gz 18699613 BLAKE2B 2c16f305a746106edc770c267900b31fe480b167a615adc82496e0604cc618982bb787a0c173b069c258749364d7d2cac900d8d8b82244fc3b916744b7339537 SHA512 bd258be6e4c5f0b6b4bbdf8887e5f8ab16a90117deb00f9c46c4acb7f6bbcc36fb9f6b6e7c201403556e0ee269947a5f5b2611ff1b05e48f231f81b1eeac7bce
+DIST pyside-pyside-setup-6.8.1.gh.tar.gz 18700869 BLAKE2B 5924f8ffc3e5a4f15442af9191b0531ee9f509595d41ae2759b94c2a7f8d7e08f4a70f9c7fff07f11c5252afb77084dc21ca3b22762d6c8dd66f4fca5944c9f2 SHA512 941844b1f6711859add828cbefe7c39497d45f0936f970f3050631294ed3bfe88d9d7b827a81d61ba3efbbf7920daef6ea6c28fa9c78f8e672d68b8bd3fbb2ad
+DIST pyside-pyside-setup-6.8.2.gh.tar.gz 19305680 BLAKE2B d4da8ec63d35714bf4418cdc9ff5921fe554c1635a7c5c467657b64c2140208b4bba57fc9932f0f96426e1d15c124209b0b29eb9340261d34eed194128a03545 SHA512 30691d27afaeaa3117e68b60745918d9697c8d9e4ee8941eaab51995cb5128c56d44964511f2db731f448bf32219160032e4a4cd4773d3fccc4de8c0e509d1c1
+EBUILD pyside-6.8.1.1.ebuild 10314 BLAKE2B ccdf54f48e1a4e3cc02b0a6210a8551ba88262b16d5bd569ada3ff64b70e868a360f54d43225f20501c298b0e1c42c5e831c774a67d79f08a20efec40335eb4a SHA512 b92d4dbaa0a9b7f7f838c3d99c16e757ade7a91b6c8f39f7c16bdac5a704cc5f5f163011b6f80e0efa654c8ed3e4da038372e0ac8963166904ae477b7b70c2c0
+EBUILD pyside-6.8.1.ebuild 10310 BLAKE2B ca864905f3ed3c13b4ff673fb0db08087075e30a950b40ca29fbeda9402cd8d23e2666c3a846a69704c6f308474dd5a87ad3aee677aa327d79bc149d4695e55d SHA512 501094285ad18dccd664d63819ceee40fb24f5ce61bb982f2c2ea12edaf4995c718080da5d9aa01598afd0d5b3fecdc441f880722e9c8fb3fab2bb28b3dd1e97
+EBUILD pyside-6.8.2.ebuild 14911 BLAKE2B b2aa09c2771620150d1dc01b00d1110589bfa02ca761d2d6145042ec025e037c6ad3084fb4737c9d9592fb4711d5ecc8a04b0b88c68d865e7bc8a2a7ca28c455 SHA512 799248f0354cde09378da066f8a8856916e7c96d376d46d17e97d627bffdff68fd02f18a6e872caea2f4965f852ed396125f3c545575c65511ec3a3dec7e7a38
+MISC metadata.xml 2977 BLAKE2B abf5f630457dc13ad1bc9e08ed5fcd3f0beadff9815cf6d7ddb6107410c6584f7acae7d08194c7b621eb4470f844d67e13b97df7620493e27d2df2ec54dbbf77 SHA512 51fd0bdc6059a221fadb7c04b627be5ccd523d28a3234c5f01118d50b6d4b5938fda8390ce5e26e8f1f630b58ef4f5201710804c996607e85d7d69d793a4a09a
diff --git a/dev-python/pyside/files/pyside-6.3.1-no-strip.patch b/dev-python/pyside/files/pyside-6.3.1-no-strip.patch
new file mode 100644
index 000000000000..9f3a8c396f05
--- /dev/null
+++ b/dev-python/pyside/files/pyside-6.3.1-no-strip.patch
@@ -0,0 +1,26 @@
+diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
+index 0b2f7a0..31e41e8 100644
+--- a/libpyside/CMakeLists.txt
++++ b/libpyside/CMakeLists.txt
+@@ -123,8 +123,6 @@ endif()
+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D QT_NO_CAST_FROM_ASCII -D QT_NO_CAST_TO_ASCII")
+
+-qfp_strip_library("pyside6")
+-
+ # create pkg-config file
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside6.pc.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/pyside6${pyside6_SUFFIX}.pc" @ONLY)
+diff --git a/libpysideqml/CMakeLists.txt b/libpysideqml/CMakeLists.txt
+index 42238c8..33bfce1 100644
+--- a/libpysideqml/CMakeLists.txt
++++ b/libpysideqml/CMakeLists.txt
+@@ -57,8 +57,6 @@ endif()
+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D QT_NO_CAST_FROM_ASCII -D QT_NO_CAST_TO_ASCII")
+
+-qfp_strip_library("pyside6qml")
+-
+ # Install-tree / relocatable package config file.
+ configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/PySide6QmlConfig-spec.cmake.in"
diff --git a/dev-python/pyside/files/pyside-6.6.0-no-qtexampleicons.patch b/dev-python/pyside/files/pyside-6.6.0-no-qtexampleicons.patch
new file mode 100644
index 000000000000..f775310504f4
--- /dev/null
+++ b/dev-python/pyside/files/pyside-6.6.0-no-qtexampleicons.patch
@@ -0,0 +1,10 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2e4c701..6792258 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -41,5 +41,3 @@ if(BUILD_TESTS)
+ endif()
+
+ add_subdirectory(doc)
+-
+-add_subdirectory(qtexampleicons)
diff --git a/dev-python/pyside/files/pyside-6.8.2-no-qtexampleicons.patch b/dev-python/pyside/files/pyside-6.8.2-no-qtexampleicons.patch
new file mode 100644
index 000000000000..29adbe25d479
--- /dev/null
+++ b/dev-python/pyside/files/pyside-6.8.2-no-qtexampleicons.patch
@@ -0,0 +1,10 @@
+diff --git a/sources/pyside6/CMakeLists.txt b/sources/pyside6/CMakeLists.txt
+index 2e4c701..6792258 100644
+--- a/sources/pyside6/CMakeLists.txt
++++ b/sources/pyside6/CMakeLists.txt
+@@ -41,5 +41,3 @@ if(BUILD_TESTS)
+ endif()
+
+ add_subdirectory(doc)
+-
+-add_subdirectory(qtexampleicons)
diff --git a/dev-python/pyside/files/pyside-6.8.2-quick-fix-build-wheel.patch b/dev-python/pyside/files/pyside-6.8.2-quick-fix-build-wheel.patch
new file mode 100644
index 000000000000..7cf0f46e87b1
--- /dev/null
+++ b/dev-python/pyside/files/pyside-6.8.2-quick-fix-build-wheel.patch
@@ -0,0 +1,17 @@
+diff --git a/build_scripts/wheel_override.py b/build_scripts/wheel_override.py
+index b389bb8..71de230 100644
+--- a/build_scripts/wheel_override.py
++++ b/build_scripts/wheel_override.py
+@@ -20,9 +20,9 @@ try:
+
+ from packaging import tags
+ from wheel import __version__ as wheel_version
+- from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
+- from wheel.bdist_wheel import get_abi_tag, get_platform
+- from wheel.bdist_wheel import safer_name as _safer_name
++ from wheel._bdist_wheel import bdist_wheel as _bdist_wheel
++ from wheel._bdist_wheel import get_abi_tag, get_platform
++ from wheel._bdist_wheel import safer_name as _safer_name
+
+ wheel_module_exists = True
+ except Exception as e:
diff --git a/dev-python/pyside/metadata.xml b/dev-python/pyside/metadata.xml
new file mode 100644
index 000000000000..c760fb957e04
--- /dev/null
+++ b/dev-python/pyside/metadata.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="proxy">
+ <email>nowa@gentoo.org</email>
+ <name>Nowa Ammerlaan</name>
+ </maintainer>
+ <maintainer type="person" proxied="yes">
+ <email>waebbl-gentoo@posteo.net</email>
+ <name>Bernd Waibel</name>
+ </maintainer>
+ <use>
+ <flag name="3d">Build Qt3DCore, Qt3DAnimation, Qt3DExtras, Qt3DInput, Qt3DLogic, and Qt3DRender modules</flag>
+ <flag name="bluetooth">Build QtBluetooth module</flag>
+ <flag name="charts">Build QtCharts module</flag>
+ <flag name="concurrent">Build QtConcurrent module</flag>
+ <flag name="core">Build QtCore module, if disable then only shiboken will be built</flag>
+ <flag name="designer">Build QtDesigner and QtUiTools modules</flag>
+ <flag name="gles2-only">Build QtGui "QOpenGL*" classes</flag>
+ <flag name="gui">Build QtGui module</flag>
+ <flag name="help">Build QtHelp module</flag>
+ <flag name="httpserver">Build QtHttpServer module</flag>
+ <flag name="location">Build QtLocation module</flag>
+ <flag name="multimedia">Build QtMultimedia and QtMultimediaWidgets modules</flag>
+ <flag name="network">Build QtNetwork module</flag>
+ <flag name="network-auth">Build QtNetworkAuth module</flag>
+ <flag name="nfc">Build QtNfc module</flag>
+ <flag name="numpy">Build with support for <pkg>dev-python/numpy</pkg></flag>
+ <flag name="pdfium">Build QtPdf module</flag>
+ <flag name="positioning">Build QtPositioning module</flag>
+ <flag name="printsupport">Build QtPrintSupport module</flag>
+ <flag name="qml">Build QtQml module</flag>
+ <flag name="quick">Build QtQuick and QtQuickWidgets modules</flag>
+ <flag name="quick3d">Build QtQuick3D and QtQuickWidgets modules</flag>
+ <flag name="scxml">Build QtScxml module</flag>
+ <flag name="sensors">Build QtSensors module</flag>
+ <flag name="serialbus">Build QtSerialBus modules</flag>
+ <flag name="serialport">Build QtSerialPort modules</flag>
+ <flag name="spatialaudio">Build QtSpatialAudio module</flag>
+ <flag name="speech">Build QtTextToSpeech module</flag>
+ <flag name="sql">Build QtSql module</flag>
+ <flag name="svg">Build QtSvg module</flag>
+ <flag name="remoteobjects">Build QtRemoteObjects module</flag>
+ <flag name="testlib">Build QtTest module</flag>
+ <flag name="tools">Build PySide Tools</flag>
+ <flag name="uitools">Build UITools module</flag>
+ <flag name="webchannel">Build QtWebChannel module</flag>
+ <flag name="webengine">Build QtWebEngine and QtWebEngineWidgets modules</flag>
+ <flag name="websockets">Build QtWebSockets module</flag>
+ <flag name="webview">Build QtWebView module</flag>
+ <flag name="widgets">Build QtWidgets module</flag>
+ <flag name="xml">Build QtXml module</flag>
+ </use>
+ <upstream>
+ <remote-id type="pypi">PySide6</remote-id>
+ <remote-id type="pypi">shiboken6</remote-id>
+ <remote-id type="github">qtproject/pyside-pyside-setup</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/pyside/pyside-6.8.1.1.ebuild b/dev-python/pyside/pyside-6.8.1.1.ebuild
new file mode 100644
index 000000000000..89ab1f8e8b99
--- /dev/null
+++ b/dev-python/pyside/pyside-6.8.1.1.ebuild
@@ -0,0 +1,253 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# TODO: Add PyPy once officially supported. See also:
+# https://bugreports.qt.io/browse/PYSIDE-535
+PYTHON_COMPAT=( python3_{10..13} )
+
+LLVM_COMPAT=( {15..18} )
+
+inherit cmake llvm-r1 python-r1 virtualx
+
+# TODO: Add conditional support for apidoc generation via a new "doc" USE flag.
+# Note that doing so requires the Qt source tree, sphinx, and graphviz. Once
+# ready, pass the ${QT_SRC_DIR} variable to cmake to enable this support.
+# TODO: Disable GLES support if the "gles2-only" USE flag is disabled. Note
+# that the "PySide6/QtGui/CMakeLists.txt" and
+# "PySide6/QtOpenGLFunctions/CMakeLists.txt" files test for GLES support by
+# testing whether the "Qt5::Gui" list property defined by
+# "/usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake" at "dev-qt/qtgui" installation
+# time contains the substring "opengles2". Since cmake does not permit
+# properties to be overridden from the command line, these files must instead
+# be conditionally patched to avoid these tests. An issue should be filed with
+# upstream requesting a CLI-settable variable to control this.
+
+MY_PN=pyside-pyside-setup
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Python bindings for the Qt framework"
+HOMEPAGE="https://wiki.qt.io/PySide6"
+SRC_URI="https://github.com/qtproject/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.gh.tar.gz"
+S="${WORKDIR}/${MY_P}/sources/pyside6"
+
+# See "sources/pyside6/PySide6/licensecomment.txt" for licensing details.
+# Shall we allow essential modules to be disabled? They are:
+# (core), gui, widgets, printsupport, sql, network, testlib, concurrent,
+# x11extras (for X)
+LICENSE="|| ( GPL-2 GPL-3+ LGPL-3 )"
+SLOT="6/${PV}"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="
+ 3d bluetooth charts +concurrent +dbus designer gles2-only +gui help
+ httpserver location multimedia +network network-auth nfc positioning +opengl
+ pdfium positioning +printsupport qml quick quick3d remoteobjects serialport
+ scxml sensors spatialaudio speech +sql svg test +testlib uitools webchannel
+ webengine websockets +widgets +xml
+"
+
+# Manually reextract these requirements on version bumps by running the
+# following one-liner from within "${S}":
+# $ grep 'set.*_deps' PySide6/Qt*/CMakeLists.txt
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ 3d? ( gui network )
+ charts? ( gui widgets )
+ designer? ( widgets )
+ gles2-only? ( gui )
+ gui? ( dbus opengl )
+ help? ( network sql widgets )
+ httpserver? ( concurrent network websockets )
+ location? ( gui network positioning quick )
+ multimedia? ( gui network )
+ network-auth? ( network )
+ opengl? ( gui )
+ pdfium? ( gui )
+ printsupport? ( widgets )
+ qml? ( network )
+ quick? ( gui network opengl qml )
+ quick3d? ( gui network opengl qml quick )
+ remoteobjects? ( network )
+ spatialaudio? ( multimedia )
+ speech? ( multimedia )
+ sql? ( widgets )
+ svg? ( gui )
+ testlib? ( widgets )
+ uitools? ( widgets )
+ webchannel? ( qml )
+ webengine? ( network gui printsupport quick webchannel )
+ websockets? ( network )
+ widgets? ( gui )
+"
+
+# Tests fail pretty bad and I'm not fixing them right now
+RESTRICT="test"
+
+# Minimal supported version of Qt.
+QT_PV="$(ver_cut 1-3)*:6"
+
+RDEPEND="${PYTHON_DEPS}
+ ~dev-python/shiboken6-${PV}[${PYTHON_USEDEP},${LLVM_USEDEP}]
+ =dev-qt/qtbase-${QT_PV}[concurrent?,dbus?,gles2-only=,network?,opengl?,sql?,widgets?,xml?]
+ 3d? ( =dev-qt/qt3d-${QT_PV}[qml?,gles2-only=] )
+ bluetooth? ( =dev-qt/qtconnectivity-${QT_PV}[bluetooth] )
+ charts? ( =dev-qt/qtcharts-${QT_PV} )
+ designer? ( =dev-qt/qttools-${QT_PV}[designer,widgets] )
+ gui? (
+ =dev-qt/qtbase-${QT_PV}[gui,jpeg(+)]
+ x11-libs/libxkbcommon
+ )
+ help? ( =dev-qt/qttools-${QT_PV}[assistant] )
+ httpserver? ( =dev-qt/qthttpserver-${QT_PV} )
+ location? ( =dev-qt/qtlocation-${QT_PV} )
+ multimedia? ( =dev-qt/qtmultimedia-${QT_PV} )
+ network? ( =dev-qt/qtbase-${QT_PV}[ssl] )
+ network-auth? ( =dev-qt/qtnetworkauth-${QT_PV} )
+ nfc? ( =dev-qt/qtconnectivity-${QT_PV}[nfc] )
+ pdfium? ( =dev-qt/qtwebengine-${QT_PV}[pdfium(-),widgets?] )
+ positioning? ( =dev-qt/qtpositioning-${QT_PV} )
+ printsupport? ( =dev-qt/qtbase-${QT_PV}[gui,widgets] )
+ qml? ( =dev-qt/qtdeclarative-${QT_PV}[widgets?] )
+ quick3d? ( =dev-qt/qtquick3d-${QT_PV} )
+ remoteobjects? ( =dev-qt/qtremoteobjects-${QT_PV} )
+ scxml? ( =dev-qt/qtscxml-${QT_PV} )
+ sensors? ( =dev-qt/qtsensors-${QT_PV}[qml?] )
+ speech? ( =dev-qt/qtspeech-${QT_PV} )
+ serialport? ( =dev-qt/qtserialport-${QT_PV} )
+ svg? ( =dev-qt/qtsvg-${QT_PV} )
+ testlib? ( =dev-qt/qtbase-${QT_PV}[gui] )
+ uitools? ( =dev-qt/qttools-${QT_PV}[widgets] )
+ webchannel? ( =dev-qt/qtwebchannel-${QT_PV} )
+ webengine? ( || (
+ =dev-qt/qtwebengine-${QT_PV}[alsa,widgets?]
+ =dev-qt/qtwebengine-${QT_PV}[pulseaudio,widgets?]
+ )
+ )
+ websockets? ( =dev-qt/qtwebsockets-${QT_PV} )
+ !dev-python/pyside:0
+"
+DEPEND="${RDEPEND}
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}
+ llvm-core/llvm:${LLVM_SLOT}
+ ')
+ test? ( =dev-qt/qtbase-${QT_PV}[gui] )
+"
+# testlib is toggled by the gui flag on qtbase
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.3.1-no-strip.patch"
+ # References files not present in our dev-qt/qtbase
+ "${FILESDIR}/${PN}-6.6.0-no-qtexampleicons.patch"
+)
+
+src_configure() {
+ # See collect_module_if_found macros in PySideHelpers.cmake
+ local mycmakeargs=(
+ -DBUILD_TESTS=$(usex test)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DAnimation=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DCore=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DExtras=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DInput=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DLogic=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DRender=$(usex !3d)
+ #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6AxContainer=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Bluetooth=$(usex !bluetooth)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Charts=$(usex !charts)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Concurrent=$(usex !concurrent)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DataVisualization=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DBus=$(usex !dbus)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Designer=$(usex !designer)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Gui=$(usex !gui)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Help=$(usex !help)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6HttpServer=$(usex !httpserver)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Location=$(usex !location)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Multimedia=$(usex !multimedia)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6MultimediaWidgets=$(usex !multimedia yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6NetworkAuth=$(usex !network-auth)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Network=$(usex !network)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Nfc=$(usex !nfc)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGL=$(usex !opengl)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGLWidgets=$(usex !opengl yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Pdf=$(usex !pdfium)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PdfWidgets=$(usex !pdfium yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Positioning=$(usex !positioning)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PrintSupport=$(usex !printsupport)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Qml=$(usex !qml)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick3D=$(usex !quick3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick=$(usex !quick)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickControls2=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickWidgets=$(usex !quick yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6RemoteObjects=$(usex !remoteobjects)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Scxml=$(usex !scxml)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sensors=$(usex !sensors)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SerialPort=$(usex !serialport)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SpatialAudio=$(usex !spatialaudio)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sql=$(usex !sql)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6StateMachine=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Svg=$(usex !svg)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SvgWidgets=$(usex !svg yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Test=$(usex !testlib)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6TextToSpeech=$(usex !speech)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6UiTools=$(usex !uitools)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebChannel=$(usex !webchannel)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineCore=$(usex !webengine)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineQuick=$(usex !webengine yes $(usex !quick))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineWidgets=$(usex !webengine yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebSockets=$(usex !websockets)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Widgets=$(usex !widgets)
+ #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6WinExtras=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Xml=$(usex !xml)
+ # try to avoid pre-stripping
+ -DQFP_NO_OVERRIDE_OPTIMIZATION_FLAGS=yes
+ -DQFP_NO_STRIP=yes
+
+ )
+
+ pyside6_configure() {
+ local mycmakeargs=(
+ "${mycmakeargs[@]}"
+ -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
+ -DPYTHON_SITE_PACKAGES="$(python_get_sitedir)"
+ -DSHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX="-${EPYTHON}"
+ )
+ cmake_src_configure
+ }
+ python_foreach_impl pyside6_configure
+}
+
+src_compile() {
+ python_foreach_impl cmake_src_compile
+}
+
+src_test() {
+ local -x PYTHONDONTWRITEBYTECODE
+ python_foreach_impl virtx cmake_src_test
+}
+
+src_install() {
+ pyside6_install() {
+ cmake_src_install
+ python_optimize
+
+ # Uniquify the shiboken6 pkgconfig dependency in the PySide6 pkgconfig
+ # file for the current Python target. See also:
+ # https://github.com/leycec/raiagent/issues/73
+ sed -i -e 's~^Requires: shiboken6$~&-'${EPYTHON}'~' \
+ "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}6.pc || die
+
+ # Uniquify the PySide6 pkgconfig file for the current Python target,
+ # preserving an unversioned "pyside6.pc" file arbitrarily associated
+ # with the last Python target. (See the previously linked issue.)
+ cp "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}6{,-${EPYTHON}}.pc || die
+ }
+ python_foreach_impl pyside6_install
+
+ # CMakeLists.txt installs a "PySide6Targets-gentoo.cmake" file forcing
+ # downstream consumers (e.g., pyside6-tools) to target one
+ # "libpyside6-*.so" library linked to one Python interpreter. See also:
+ # https://bugreports.qt.io/browse/PYSIDE-1053
+ # https://github.com/leycec/raiagent/issues/74
+ sed -i -e 's~pyside6-python[[:digit:]]\+\.[[:digit:]]\+~pyside6${PYTHON_CONFIG_SUFFIX}~g' \
+ "${ED}/usr/$(get_libdir)/cmake/PySide6/PySide6Targets-${CMAKE_BUILD_TYPE,,}.cmake" || die
+}
diff --git a/dev-python/pyside/pyside-6.8.1.ebuild b/dev-python/pyside/pyside-6.8.1.ebuild
new file mode 100644
index 000000000000..e80e682b8c51
--- /dev/null
+++ b/dev-python/pyside/pyside-6.8.1.ebuild
@@ -0,0 +1,253 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# TODO: Add PyPy once officially supported. See also:
+# https://bugreports.qt.io/browse/PYSIDE-535
+PYTHON_COMPAT=( python3_{10..13} )
+
+LLVM_COMPAT=( {15..18} )
+
+inherit cmake llvm-r1 python-r1 virtualx
+
+# TODO: Add conditional support for apidoc generation via a new "doc" USE flag.
+# Note that doing so requires the Qt source tree, sphinx, and graphviz. Once
+# ready, pass the ${QT_SRC_DIR} variable to cmake to enable this support.
+# TODO: Disable GLES support if the "gles2-only" USE flag is disabled. Note
+# that the "PySide6/QtGui/CMakeLists.txt" and
+# "PySide6/QtOpenGLFunctions/CMakeLists.txt" files test for GLES support by
+# testing whether the "Qt5::Gui" list property defined by
+# "/usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake" at "dev-qt/qtgui" installation
+# time contains the substring "opengles2". Since cmake does not permit
+# properties to be overridden from the command line, these files must instead
+# be conditionally patched to avoid these tests. An issue should be filed with
+# upstream requesting a CLI-settable variable to control this.
+
+MY_PN=pyside-pyside-setup
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Python bindings for the Qt framework"
+HOMEPAGE="https://wiki.qt.io/PySide6"
+SRC_URI="https://github.com/qtproject/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.gh.tar.gz"
+S="${WORKDIR}/${MY_P}/sources/pyside6"
+
+# See "sources/pyside6/PySide6/licensecomment.txt" for licensing details.
+# Shall we allow essential modules to be disabled? They are:
+# (core), gui, widgets, printsupport, sql, network, testlib, concurrent,
+# x11extras (for X)
+LICENSE="|| ( GPL-2 GPL-3+ LGPL-3 )"
+SLOT="6/${PV}"
+KEYWORDS="amd64 ~arm arm64 ~ppc64 ~riscv ~x86"
+IUSE="
+ 3d bluetooth charts +concurrent +dbus designer gles2-only +gui help
+ httpserver location multimedia +network network-auth nfc positioning +opengl
+ pdfium positioning +printsupport qml quick quick3d remoteobjects serialport
+ scxml sensors spatialaudio speech +sql svg test +testlib uitools webchannel
+ webengine websockets +widgets +xml
+"
+
+# Manually reextract these requirements on version bumps by running the
+# following one-liner from within "${S}":
+# $ grep 'set.*_deps' PySide6/Qt*/CMakeLists.txt
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ 3d? ( gui network )
+ charts? ( gui widgets )
+ designer? ( widgets )
+ gles2-only? ( gui )
+ gui? ( dbus opengl )
+ help? ( network sql widgets )
+ httpserver? ( concurrent network websockets )
+ location? ( gui network positioning quick )
+ multimedia? ( gui network )
+ network-auth? ( network )
+ opengl? ( gui )
+ pdfium? ( gui )
+ printsupport? ( widgets )
+ qml? ( network )
+ quick? ( gui network opengl qml )
+ quick3d? ( gui network opengl qml quick )
+ remoteobjects? ( network )
+ spatialaudio? ( multimedia )
+ speech? ( multimedia )
+ sql? ( widgets )
+ svg? ( gui )
+ testlib? ( widgets )
+ uitools? ( widgets )
+ webchannel? ( qml )
+ webengine? ( network gui printsupport quick webchannel )
+ websockets? ( network )
+ widgets? ( gui )
+"
+
+# Tests fail pretty bad and I'm not fixing them right now
+RESTRICT="test"
+
+# Minimal supported version of Qt.
+QT_PV="$(ver_cut 1-3)*:6"
+
+RDEPEND="${PYTHON_DEPS}
+ =dev-python/shiboken6-${QT_PV}[${PYTHON_USEDEP},${LLVM_USEDEP}]
+ =dev-qt/qtbase-${QT_PV}[concurrent?,dbus?,gles2-only=,network?,opengl?,sql?,widgets?,xml?]
+ 3d? ( =dev-qt/qt3d-${QT_PV}[qml?,gles2-only=] )
+ bluetooth? ( =dev-qt/qtconnectivity-${QT_PV}[bluetooth] )
+ charts? ( =dev-qt/qtcharts-${QT_PV} )
+ designer? ( =dev-qt/qttools-${QT_PV}[designer,widgets] )
+ gui? (
+ =dev-qt/qtbase-${QT_PV}[gui,jpeg(+)]
+ x11-libs/libxkbcommon
+ )
+ help? ( =dev-qt/qttools-${QT_PV}[assistant] )
+ httpserver? ( =dev-qt/qthttpserver-${QT_PV} )
+ location? ( =dev-qt/qtlocation-${QT_PV} )
+ multimedia? ( =dev-qt/qtmultimedia-${QT_PV} )
+ network? ( =dev-qt/qtbase-${QT_PV}[ssl] )
+ network-auth? ( =dev-qt/qtnetworkauth-${QT_PV} )
+ nfc? ( =dev-qt/qtconnectivity-${QT_PV}[nfc] )
+ pdfium? ( =dev-qt/qtwebengine-${QT_PV}[pdfium(-),widgets?] )
+ positioning? ( =dev-qt/qtpositioning-${QT_PV} )
+ printsupport? ( =dev-qt/qtbase-${QT_PV}[gui,widgets] )
+ qml? ( =dev-qt/qtdeclarative-${QT_PV}[widgets?] )
+ quick3d? ( =dev-qt/qtquick3d-${QT_PV} )
+ remoteobjects? ( =dev-qt/qtremoteobjects-${QT_PV} )
+ scxml? ( =dev-qt/qtscxml-${QT_PV} )
+ sensors? ( =dev-qt/qtsensors-${QT_PV}[qml?] )
+ speech? ( =dev-qt/qtspeech-${QT_PV} )
+ serialport? ( =dev-qt/qtserialport-${QT_PV} )
+ svg? ( =dev-qt/qtsvg-${QT_PV} )
+ testlib? ( =dev-qt/qtbase-${QT_PV}[gui] )
+ uitools? ( =dev-qt/qttools-${QT_PV}[widgets] )
+ webchannel? ( =dev-qt/qtwebchannel-${QT_PV} )
+ webengine? ( || (
+ =dev-qt/qtwebengine-${QT_PV}[alsa,widgets?]
+ =dev-qt/qtwebengine-${QT_PV}[pulseaudio,widgets?]
+ )
+ )
+ websockets? ( =dev-qt/qtwebsockets-${QT_PV} )
+ !dev-python/pyside:0
+"
+DEPEND="${RDEPEND}
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}
+ llvm-core/llvm:${LLVM_SLOT}
+ ')
+ test? ( =dev-qt/qtbase-${QT_PV}[gui] )
+"
+# testlib is toggled by the gui flag on qtbase
+
+PATCHES=(
+ "${FILESDIR}/${PN}-6.3.1-no-strip.patch"
+ # References files not present in our dev-qt/qtbase
+ "${FILESDIR}/${PN}-6.6.0-no-qtexampleicons.patch"
+)
+
+src_configure() {
+ # See collect_module_if_found macros in PySideHelpers.cmake
+ local mycmakeargs=(
+ -DBUILD_TESTS=$(usex test)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DAnimation=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DCore=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DExtras=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DInput=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DLogic=$(usex !3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt63DRender=$(usex !3d)
+ #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6AxContainer=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Bluetooth=$(usex !bluetooth)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Charts=$(usex !charts)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Concurrent=$(usex !concurrent)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DataVisualization=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6DBus=$(usex !dbus)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Designer=$(usex !designer)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Gui=$(usex !gui)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Help=$(usex !help)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6HttpServer=$(usex !httpserver)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Location=$(usex !location)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Multimedia=$(usex !multimedia)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6MultimediaWidgets=$(usex !multimedia yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6NetworkAuth=$(usex !network-auth)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Network=$(usex !network)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Nfc=$(usex !nfc)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGL=$(usex !opengl)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6OpenGLWidgets=$(usex !opengl yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Pdf=$(usex !pdfium)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PdfWidgets=$(usex !pdfium yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Positioning=$(usex !positioning)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6PrintSupport=$(usex !printsupport)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Qml=$(usex !qml)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick3D=$(usex !quick3d)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Quick=$(usex !quick)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickControls2=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6QuickWidgets=$(usex !quick yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6RemoteObjects=$(usex !remoteobjects)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Scxml=$(usex !scxml)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sensors=$(usex !sensors)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SerialPort=$(usex !serialport)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SpatialAudio=$(usex !spatialaudio)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Sql=$(usex !sql)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6StateMachine=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Svg=$(usex !svg)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6SvgWidgets=$(usex !svg yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Test=$(usex !testlib)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6TextToSpeech=$(usex !speech)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6UiTools=$(usex !uitools)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebChannel=$(usex !webchannel)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineCore=$(usex !webengine)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineQuick=$(usex !webengine yes $(usex !quick))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebEngineWidgets=$(usex !webengine yes $(usex !widgets))
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6WebSockets=$(usex !websockets)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Widgets=$(usex !widgets)
+ #-DCMAKE_DISABLE_FIND_PACKAGE_Qt6WinExtras=yes
+ -DCMAKE_DISABLE_FIND_PACKAGE_Qt6Xml=$(usex !xml)
+ # try to avoid pre-stripping
+ -DQFP_NO_OVERRIDE_OPTIMIZATION_FLAGS=yes
+ -DQFP_NO_STRIP=yes
+
+ )
+
+ pyside6_configure() {
+ local mycmakeargs=(
+ "${mycmakeargs[@]}"
+ -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}"
+ -DPYTHON_SITE_PACKAGES="$(python_get_sitedir)"
+ -DSHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX="-${EPYTHON}"
+ )
+ cmake_src_configure
+ }
+ python_foreach_impl pyside6_configure
+}
+
+src_compile() {
+ python_foreach_impl cmake_src_compile
+}
+
+src_test() {
+ local -x PYTHONDONTWRITEBYTECODE
+ python_foreach_impl virtx cmake_src_test
+}
+
+src_install() {
+ pyside6_install() {
+ cmake_src_install
+ python_optimize
+
+ # Uniquify the shiboken6 pkgconfig dependency in the PySide6 pkgconfig
+ # file for the current Python target. See also:
+ # https://github.com/leycec/raiagent/issues/73
+ sed -i -e 's~^Requires: shiboken6$~&-'${EPYTHON}'~' \
+ "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}6.pc || die
+
+ # Uniquify the PySide6 pkgconfig file for the current Python target,
+ # preserving an unversioned "pyside6.pc" file arbitrarily associated
+ # with the last Python target. (See the previously linked issue.)
+ cp "${ED}/usr/$(get_libdir)"/pkgconfig/${PN}6{,-${EPYTHON}}.pc || die
+ }
+ python_foreach_impl pyside6_install
+
+ # CMakeLists.txt installs a "PySide6Targets-gentoo.cmake" file forcing
+ # downstream consumers (e.g., pyside6-tools) to target one
+ # "libpyside6-*.so" library linked to one Python interpreter. See also:
+ # https://bugreports.qt.io/browse/PYSIDE-1053
+ # https://github.com/leycec/raiagent/issues/74
+ sed -i -e 's~pyside6-python[[:digit:]]\+\.[[:digit:]]\+~pyside6${PYTHON_CONFIG_SUFFIX}~g' \
+ "${ED}/usr/$(get_libdir)/cmake/PySide6/PySide6Targets-${CMAKE_BUILD_TYPE,,}.cmake" || die
+}
diff --git a/dev-python/pyside/pyside-6.8.2.ebuild b/dev-python/pyside/pyside-6.8.2.ebuild
new file mode 100644
index 000000000000..6a450ecd3f00
--- /dev/null
+++ b/dev-python/pyside/pyside-6.8.2.ebuild
@@ -0,0 +1,440 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+LLVM_COMPAT=( {15..19} )
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_EXT=1
+
+inherit distutils-r1 llvm-r1 qmake-utils virtualx
+
+MY_PN=pyside-pyside-setup
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Python bindings for the Qt framework"
+HOMEPAGE="https://wiki.qt.io/PySide6"
+SRC_URI="https://github.com/qtproject/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${MY_P}.gh.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="|| ( GPL-2 GPL-3 LGPL-3 )"
+SLOT="6/${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+
+# If a flag enables multiple Qt modules, they should be ordered
+# according to their dependencies, e.g. for 3d, 3DCore must be first.
+# Widgets for various modules are handled as a special case later
+declare -A QT_MODULES=(
+ ["3d"]="3DCore 3DRender 3DLogic 3DInput 3DAnimation 3DExtras"
+ ["bluetooth"]="Bluetooth"
+ ["charts"]="Charts"
+ ["+concurrent"]="Concurrent"
+ ["+core"]="Core"
+ ["+dbus"]="DBus"
+ ["designer"]="Designer"
+ ["+gui"]="Gui"
+ ["help"]="Help"
+ ["httpserver"]="HttpServer"
+ ["location"]="Location"
+ ["multimedia"]="Multimedia" # plus widgets
+ ["network-auth"]="NetworkAuth"
+ ["+network"]="Network"
+ ["nfc"]="Nfc"
+ ["+opengl"]="OpenGL" # plus widgets
+ ["pdfium"]="Pdf" # plus widgets
+ ["positioning"]="Positioning"
+ ["+printsupport"]="PrintSupport"
+ ["qml"]="Qml"
+ ["quick3d"]="Quick3D"
+ ["quick"]="Quick" # plus widgets
+ ["remoteobjects"]="RemoteObjects"
+ ["scxml"]="Scxml"
+ ["sensors"]="Sensors"
+ ["serialbus"]="SerialBus"
+ ["serialport"]="SerialPort"
+ ["spatialaudio"]="SpatialAudio"
+ ["+sql"]="Sql"
+ ["svg"]="Svg" # plus widgets
+ ["speech"]="TextToSpeech"
+ ["+testlib"]="Test"
+ ["uitools"]="UiTools"
+ ["webchannel"]="WebChannel"
+ ["webengine"]="WebEngineCore" # plus widgets and quick
+ ["websockets"]="WebSockets"
+ ["webview"]="WebView"
+ ["+widgets"]="Widgets"
+ ["+xml"]="Xml"
+)
+
+# Manually reextract these requirements on version bumps by running the
+# following one-liner from within "${S}":
+# $ grep 'set.*_deps' PySide6/Qt*/CMakeLists.txt
+declare -A QT_REQUIREMENTS=(
+ ["3d"]="gui network opengl"
+ ["bluetooth"]="core"
+ ["charts"]="core gui widgets"
+ ["concurrent"]="core"
+ ["dbus"]="core"
+ ["designer"]="widgets"
+ ["gles2-only"]="gui"
+ ["gui"]="core"
+ ["help"]="widgets"
+ ["httpserver"]="core concurrent network websockets"
+ ["location"]="core positioning"
+ ["multimedia"]="core gui network"
+ ["network-auth"]="network"
+ ["network"]="core"
+ ["nfc"]="core"
+ ["opengl"]="gui"
+ ["pdfium"]="core gui network"
+ ["positioning"]="core"
+ ["printsupport"]="widgets"
+ ["qml"]="network"
+ ["quick"]="gui network qml opengl"
+ ["quick3d"]="gui network qml quick"
+ ["remoteobjects"]="core network"
+ ["scxml"]="core"
+ ["sensors"]="core"
+ ["serialbus"]="core network serialport"
+ ["serialport"]="core"
+ ["spatialaudio"]="core gui network multimedia"
+ ["speech"]="core multimedia"
+ ["sql"]="widgets"
+ ["svg"]="gui"
+ ["testlib"]="widgets"
+ ["uitools"]="widgets"
+ ["webchannel"]="core"
+ ["webengine"]="core gui network printsupport quick webchannel"
+ ["websockets"]="network"
+ ["webview"]="gui"
+ ["widgets"]="gui"
+ ["xml"]="core"
+)
+
+IUSE="${!QT_MODULES[@]} debug doc gles2-only numpy test tools"
+RESTRICT="!test? ( test )"
+
+for requirement in ${!QT_REQUIREMENTS[@]}; do
+ REQUIRED_USE+=" ${requirement}? ( ${QT_REQUIREMENTS[${requirement}]} ) "
+done
+
+# Minimal supported version of Qt.
+QT_PV="$(ver_cut 1-3)*:6"
+
+# WebEngine needs sound support, so enable either pulseaudio or alsa
+RDEPEND="
+ =dev-qt/qtbase-${QT_PV}[concurrent?,dbus?,gles2-only=,network?,opengl?,sql?,widgets?,xml?]
+ 3d? ( =dev-qt/qt3d-${QT_PV}[qml?,gles2-only=] )
+ bluetooth? ( =dev-qt/qtconnectivity-${QT_PV}[bluetooth] )
+ charts? ( =dev-qt/qtcharts-${QT_PV} )
+ designer? ( =dev-qt/qttools-${QT_PV}[designer,widgets,gles2-only=] )
+ gui? (
+ =dev-qt/qtbase-${QT_PV}[gui,jpeg(+)]
+ x11-libs/libxkbcommon
+ )
+ help? ( =dev-qt/qttools-${QT_PV}[assistant,gles2-only=] )
+ httpserver? ( =dev-qt/qthttpserver-${QT_PV} )
+ location? ( =dev-qt/qtlocation-${QT_PV} )
+ multimedia? ( =dev-qt/qtmultimedia-${QT_PV}[widgets(+)?] )
+ network? ( =dev-qt/qtbase-${QT_PV}[ssl] )
+ network-auth? ( =dev-qt/qtnetworkauth-${QT_PV} )
+ nfc? ( =dev-qt/qtconnectivity-${QT_PV}[nfc] )
+ numpy? ( >=dev-python/numpy-2.1.3[${PYTHON_USEDEP}] )
+ pdfium? ( =dev-qt/qtwebengine-${QT_PV}[pdfium(-),widgets?] )
+ positioning? ( =dev-qt/qtpositioning-${QT_PV} )
+ printsupport? ( =dev-qt/qtbase-${QT_PV}[gui,widgets] )
+ qml? ( =dev-qt/qtdeclarative-${QT_PV}[opengl?,widgets?] )
+ quick3d? ( =dev-qt/qtquick3d-${QT_PV}[opengl?] )
+ remoteobjects? ( =dev-qt/qtremoteobjects-${QT_PV} )
+ scxml? ( =dev-qt/qtscxml-${QT_PV} )
+ sensors? ( =dev-qt/qtsensors-${QT_PV}[qml?] )
+ speech? ( =dev-qt/qtspeech-${QT_PV} )
+ serialbus? ( =dev-qt/qtserialbus-${QT_PV} )
+ serialport? ( =dev-qt/qtserialport-${QT_PV} )
+ svg? ( =dev-qt/qtsvg-${QT_PV} )
+ testlib? ( =dev-qt/qtbase-${QT_PV}[gui] )
+ tools? (
+ =dev-qt/qtbase-${QT_PV}
+ =dev-qt/qtdeclarative-${QT_PV}[qmlls]
+ =dev-qt/qttools-${QT_PV}[assistant,designer,linguist]
+ )
+ uitools? ( =dev-qt/qttools-${QT_PV}[gles2-only=,widgets] )
+ webchannel? ( =dev-qt/qtwebchannel-${QT_PV} )
+ webengine? ( || (
+ =dev-qt/qtwebengine-${QT_PV}[alsa,widgets?]
+ =dev-qt/qtwebengine-${QT_PV}[pulseaudio,widgets?]
+ )
+ )
+ websockets? ( =dev-qt/qtwebsockets-${QT_PV} )
+ webview? ( =dev-qt/qtwebview-${QT_PV} )
+ !dev-python/pyside:0
+ !dev-python/shiboken6
+ !dev-python/pyside6-tool
+"
+
+DEPEND="${RDEPEND}
+ $(llvm_gen_dep '
+ llvm-core/clang:${LLVM_SLOT}
+ llvm-core/llvm:${LLVM_SLOT}
+ ')
+ dev-util/vulkan-headers
+ test? ( =dev-qt/qtbase-${QT_PV}[gui] )
+" # testlib is toggled by the gui flag on qtbase
+
+BDEPEND="
+ dev-build/cmake
+ dev-python/distro[${PYTHON_USEDEP}]
+ dev-util/patchelf
+ doc? (
+ >=dev-libs/libxml2-2.6.32
+ >=dev-libs/libxslt-1.1.19
+ media-gfx/graphviz
+ )
+ numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )
+"
+
+PATCHES=(
+ # Needs porting to newer wheel and setuptools
+ "${FILESDIR}/${PN}-6.8.2-quick-fix-build-wheel.patch"
+ # References files not present in our dev-qt/qtbase
+ "${FILESDIR}/${PN}-6.8.2-no-qtexampleicons.patch"
+)
+
+# Build system duplicates system libraries. TODO: fix
+QA_PREBUILT=(
+ "/usr/lib/python*/site-packages/PySide6/*"
+)
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ # Shiboken6 assumes Vulkan headers live under either "$VULKAN_SDK/include"
+ # or "$VK_SDK_PATH/include" rather than "${EPREFIX}/usr/include/vulkan".
+ sed -i -e "s~\bdetectVulkan(&headerPaths);~headerPaths.append(HeaderPath{QByteArrayLiteral(\"${EPREFIX}/usr/include/vulkan\"), HeaderType::System});~" \
+ sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp || die
+
+ # Shiboken6 assumes the "/usr/lib/clang/${CLANG_NEWEST_VERSION}/include/"
+ # subdirectory provides Clang builtin includes (e.g., "stddef.h") for the
+ # currently installed version of Clang, where ${CLANG_NEWEST_VERSION} is
+ # the largest version specifier that exists under the "/usr/lib/clang/"
+ # subdirectory. This assumption is false in edge cases, including when
+ # users downgrade from newer Clang versions but fail to remove those
+ # versions with "emerge --depclean". See also:
+ # https://github.com/leycec/raiagent/issues/85
+ #
+ # Sadly, the clang-* family of functions exported by the "toolchain-funcs"
+ # eclass are defective, returning nonsensical placeholder strings if the
+ # end user has *NOT* explicitly configured their C++ compiler to be Clang.
+ # PySide6 does *NOT* care whether the end user has done so or not, as
+ # PySide6 unconditionally requires Clang in either case. See also:
+ # https://bugs.gentoo.org/619490
+ sed -e \
+ 's~(findClangBuiltInIncludesDir())~(QStringLiteral("'"${EPREFIX}"'/usr/lib/clang/'"${LLVM_SLOT}"'/include"))~' \
+ -i sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp || die
+}
+
+python_configure_all() {
+ ENABLED_QT_MODULES=()
+
+ # The order matters, dependencies must come first so process
+ # REQUIRED_USE and recursively enable modules
+ enable_qt_mod() {
+ local flag=${1}
+ local modules=${QT_MODULES[${flag}]}
+ if [[ -z ${modules} ]]; then
+ die "incorrect flag=${flag}, not registered"
+ fi
+ local dependencies=${QT_REQUIREMENTS[${flag//+}]}
+ if [[ -n ${dependencies} ]]; then
+ local depflag
+ for depflag in ${dependencies}; do
+ if use ${depflag}; then
+ if [[ -z ${QT_MODULES[${depflag}]} ]]; then
+ depflag=+${depflag}
+ fi
+ enable_qt_mod ${depflag}
+ else
+ die "${depflag} is required but not enabled"
+ fi
+ done
+ fi
+ if [[ "${ENABLED_QT_MODULES[*]}" != *${modules}* ]]; then
+ ENABLED_QT_MODULES+=( ${modules} )
+ fi
+ }
+ # Enable specified qt modules
+ local flag
+ for flag in ${!QT_MODULES[@]}; do
+ if use ${flag//+}; then
+ enable_qt_mod ${flag}
+ fi
+ done
+
+ # Special cases
+ if use widgets; then
+ use multimedia && ENABLED_QT_MODULES+=( MultimediaWidgets )
+ use opengl && ENABLED_QT_MODULES+=( OpenGLWidgets )
+ use pdfium && ENABLED_QT_MODULES+=( PdfWidgets )
+ use quick && ENABLED_QT_MODULES+=( QuickWidgets )
+ use svg && ENABLED_QT_MODULES+=( SvgWidgets )
+ use webengine && ENABLED_QT_MODULES+=( WebEngineWidgets )
+ fi
+ if use quick; then
+ use webengine && ENABLED_QT_MODULES+=( WebEngineQuick )
+ use testlib && ENABLED_QT_MODULES+=( QuickTest )
+ fi
+
+ # Arguments listed in options.py
+ MAIN_DISTUTILS_ARGS=(
+ --cmake="${EPREFIX}/usr/bin/cmake"
+ --ignore-git
+ --limited-api=no
+ --module-subset="$(printf '%s,' "${ENABLED_QT_MODULES[@]}")"
+ --no-strip
+ --no-size-optimization
+ --openssl="${EPREFIX}/usr/bin/openssl"
+ --qt=$(ver_cut 1-3)
+ --qtpaths=$(qt6_get_bindir)/qtpaths
+ --verbose-build
+ $(usex debug "--debug" "--relwithdebinfo")
+ $(usex doc "--build-docs" "--skip-docs")
+ $(usex numpy "--enable-numpy-support" "--disable-numpy-support")
+ $(usex test "--build-tests --use-xvfb" "")
+ $(usex tools "" "--no-qt-tools")
+ )
+}
+
+python_compile() {
+ DISTUTILS_ARGS=(
+ "${MAIN_DISTUTILS_ARGS[@]}"
+ --build-type=shiboken6
+ )
+ distutils-r1_python_compile
+ DISTUTILS_ARGS=(
+ "${MAIN_DISTUTILS_ARGS[@]}"
+ --reuse-build
+ --build-type=shiboken6-generator
+ )
+ distutils-r1_python_compile
+ # If no pyside modules enabled, build just shiboken
+ if [[ ${#ENABLED_QT_MODULES[@]} -gt 0 ]]; then
+ DISTUTILS_ARGS=(
+ "${MAIN_DISTUTILS_ARGS[@]}"
+ --reuse-build
+ --shiboken-target-path="$(find "${BUILD_DIR}/build" -type d -name cmake)/../../"
+ --build-type=pyside6
+ )
+ distutils-r1_python_compile
+ fi
+
+ # Link libraries to the usual location for backwards compatibility
+ pushd "${BUILD_DIR}/install/$(python_get_sitedir)" >/dev/null ||
+ die
+ mkdir -p "${BUILD_DIR}/install/usr/$(get_libdir)" || die
+ local lib
+ for lib in */*.cpython-*.so
+ do
+ local base=${lib##*/}
+ ln -s "${base}" "${lib%/*}/${base%%.*}-${EPYTHON}.so" ||
+ die
+ done
+ for lib in */*.cpython-*.so.$(ver_cut 1-2)
+ do
+ local base=${lib##*/}
+ ln -s "${base}" "${lib%/*}/${base%%.*}-${EPYTHON}.so.$(ver_cut 1-2)" ||
+ die
+ done
+ for lib in */*.so*; do
+ ln -s "../../$(python_get_sitedir)/${lib}" \
+ "${BUILD_DIR}/install/usr/$(get_libdir)/${lib#*/}" || die
+ done
+ popd >/dev/null || die
+
+ # Symlinks for compatibility with pypi wheels
+ local dir
+ if [[ -d ${BUILD_DIR}/install/$(python_get_sitedir)/PySide6 ]]
+ then
+ pushd "${BUILD_DIR}/install/$(python_get_sitedir)/PySide6" \
+ >/dev/null || die
+ mkdir -p "${BUILD_DIR}/install/usr/share/PySide6" || die
+ for dir in doc glue typesystems; do
+ ln -s "../../../$(python_get_sitedir)/PySide6/${dir}" \
+ "${BUILD_DIR}/install/usr/share/PySide6/${dir}" ||
+ die
+ done
+ popd >/dev/null || die
+ fi
+ mkdir -p "${BUILD_DIR}/install/usr/include"
+ for dir in PySide6 shiboken6_generator; do
+ if [[ -d ${BUILD_DIR}/install/$(python_get_sitedir)/${dir}/include ]]
+ then
+ ln -s "../../$(python_get_sitedir)/${dir}/include" \
+ "${BUILD_DIR}/install/usr/include/${dir//_generator}" ||
+ die
+ fi
+ done
+
+ # Install misc files from inner install dir
+ find "${BUILD_DIR}"/build/*/install -type f \
+ -name libPySidePlugin.so -exec \
+ mkdir -p "${BUILD_DIR}/install/$(qt6_get_plugindir)/designer/" \; \
+ -exec \
+ cp "{}" "${BUILD_DIR}/install/$(qt6_get_plugindir)/designer/" \; \
+ || die
+
+ for dir in cmake pkgconfig; do
+ find "${BUILD_DIR}"/build/*/install -type d -name ${dir} \
+ -exec cp -r "{}" "${BUILD_DIR}/install/usr/lib/" \; \
+ || die
+ done
+
+ # Uniquify the pkgconfigs file for the current Python target,
+ # preserving an unversioned "shiboken6.pc" file arbitrarily
+ # associated with the last Python target.
+ if [[ -f ${BUILD_DIR}/install/usr/lib/pkgconfig/shiboken6.pc ]]
+ then
+ sed -e 's~prefix=.*~prefix=/usr~g' \
+ -e 's~exec_prefix=.*~exec_prefix=${prefix}~g' \
+ -e "s~libdir=.*~libdir=$(python_get_sitedir)/shiboken6~g" \
+ -e "s~includedir=.*~includedir=$(python_get_sitedir)/shiboken6_generator/include~g" \
+ -i "${BUILD_DIR}/install/usr/lib/pkgconfig/shiboken6.pc" || die
+ cp "${BUILD_DIR}/install/usr/lib/pkgconfig/"shiboken6{,-${EPYTHON}}.pc || die
+ fi
+ if [[ -f ${BUILD_DIR}/install/usr/lib/pkgconfig/pyside6.pc ]]
+ then
+ sed -e 's~^Requires: shiboken6$~&-'${EPYTHON}'~' \
+ -e 's~prefix=.*~prefix=/usr~g' \
+ -e 's~exec_prefix=.*~exec_prefix=${prefix}~g' \
+ -e "s~libdir=.*~libdir=$(python_get_sitedir)/PySide6~g" \
+ -e "s~includedir=.*~includedir=$(python_get_sitedir)/PySide6/include~g" \
+ -e "s~typesystemdir=.*~typesystemdir=$(python_get_sitedir)/PySide6/typesystems~g" \
+ -e "s~gluedir=.*~gluedir=$(python_get_sitedir)/PySide6/glue~g" \
+ -e "s~pythonpath=.*~pythonpath=$(python_get_sitedir)~g" \
+ -i "${BUILD_DIR}/install/usr/lib/pkgconfig/pyside6.pc" || die
+ cp "${BUILD_DIR}/install/usr/lib/pkgconfig/"pyside6{,-${EPYTHON}}.pc || die
+ fi
+
+ sed \
+ -e "s~/lib/libshiboken6\.cpython~/$(get_libdir)/libshiboken6\.cpython~g" \
+ -e "s~/lib/libpyside6\.cpython~/$(get_libdir)/libpyside6\.cpython~g" \
+ -e "s~/lib/libpyside6qml\.cpython~/$(get_libdir)/libpyside6qml\.cpython~g" \
+ -e "s~libshiboken6\.cpython.*\.so\.$(ver_cut 1-3)~libshiboken6\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -e "s~libpyside6\.cpython.*\.so\.$(ver_cut 1-3)~libpyside6\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -e "s~libpyside6qml\.cpython.*\.so\.$(ver_cut 1-3)~libpyside6qml\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -e "s~libshiboken6\.cpython.*\.so\.$(ver_cut 1-2)~libshiboken6\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -e "s~libpyside6\.cpython.*\.so\.$(ver_cut 1-2)~libpyside6\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -e "s~libpyside6qml\.cpython.*\.so\.$(ver_cut 1-2)~libpyside6qml\${PYTHON_CONFIG_SUFFIX}\.so\.$(ver_cut 1-2)~g" \
+ -i "${BUILD_DIR}/install/usr/lib/cmake/"*/*.cmake || die
+ local file
+ for file in "${BUILD_DIR}/install/usr/lib/cmake/"*/*.cpython-*.cmake
+ do
+ local base=${file##*/}
+ ln -s "${base}" "${file%/*}/${base%%.*}-${EPYTHON}.cmake" ||
+ die
+ done
+}
+
+python_test() {
+ virtx ${EPYTHON} testrunner.py test || die "Tests failed with ${EPYTHON}"
+}