From 474b50ba16ff1657809cc626613e4154f236841a Mon Sep 17 00:00:00 2001 From: chrysos349 Date: Tue, 21 May 2024 11:12:14 +0300 Subject: [PATCH] New package: python3-pyside6-6.7.2 closes: #50452 --- common/shlibs | 3 + srcpkgs/libpyside6 | 1 + srcpkgs/libpyside6-devel | 1 + srcpkgs/libshiboken6 | 1 + srcpkgs/libshiboken6-devel | 1 + srcpkgs/python3-pyside6-webengine | 1 + .../python3-pyside6/patches/fix-build.patch | 14 ++ .../patches/no-python-suffix.patch | 60 ++++++++ srcpkgs/python3-pyside6/template | 136 ++++++++++++++++++ srcpkgs/python3-pyside6/update | 3 + srcpkgs/python3-shiboken6 | 1 + srcpkgs/shiboken6 | 1 + 12 files changed, 223 insertions(+) create mode 120000 srcpkgs/libpyside6 create mode 120000 srcpkgs/libpyside6-devel create mode 120000 srcpkgs/libshiboken6 create mode 120000 srcpkgs/libshiboken6-devel create mode 120000 srcpkgs/python3-pyside6-webengine create mode 100644 srcpkgs/python3-pyside6/patches/fix-build.patch create mode 100644 srcpkgs/python3-pyside6/patches/no-python-suffix.patch create mode 100644 srcpkgs/python3-pyside6/template create mode 100644 srcpkgs/python3-pyside6/update create mode 120000 srcpkgs/python3-shiboken6 create mode 120000 srcpkgs/shiboken6 diff --git a/common/shlibs b/common/shlibs index 8503c3e4bb7..828c6aa855e 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4542,3 +4542,6 @@ libsfdo-desktop-file.so.0 libsfdo-0.1.3_1 libsfdo-icon.so.0 libsfdo-0.1.3_1 libKMahjongg6.so.6 libkmahjongg-24.08.2_1 libflashrom.so.1 flashrom-1.4.0_1 +libpyside6.so.6.7 libpyside6-6.7.2_1 +libpyside6qml.so.6.7 libpyside6-6.7.2_1 +libshiboken6.so.6.7 libshiboken6-6.7.2_1 diff --git a/srcpkgs/libpyside6 b/srcpkgs/libpyside6 new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/libpyside6 @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/libpyside6-devel b/srcpkgs/libpyside6-devel new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/libpyside6-devel @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/libshiboken6 b/srcpkgs/libshiboken6 new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/libshiboken6 @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/libshiboken6-devel b/srcpkgs/libshiboken6-devel new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/libshiboken6-devel @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/python3-pyside6-webengine b/srcpkgs/python3-pyside6-webengine new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/python3-pyside6-webengine @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/python3-pyside6/patches/fix-build.patch b/srcpkgs/python3-pyside6/patches/fix-build.patch new file mode 100644 index 00000000000..bb3f763ef0d --- /dev/null +++ b/srcpkgs/python3-pyside6/patches/fix-build.patch @@ -0,0 +1,14 @@ +diff --git a/sources/pyside6/qtexampleicons/CMakeLists.txt b/sources/pyside6/qtexampleicons/CMakeLists.txt +index 1562f7b27..58ecc7c17 100644 +--- a/sources/pyside6/qtexampleicons/CMakeLists.txt ++++ b/sources/pyside6/qtexampleicons/CMakeLists.txt +@@ -32,6 +32,9 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release") + target_compile_definitions(QtExampleIcons PRIVATE "-DNDEBUG") + endif() + ++get_property(SHIBOKEN_PYTHON_LIBRARIES GLOBAL PROPERTY shiboken_python_libraries) ++get_property(SHIBOKEN_PYTHON_INCLUDE_DIRS GLOBAL PROPERTY shiboken_python_include_dirs) ++ + target_include_directories(QtExampleIcons PRIVATE ${SHIBOKEN_PYTHON_INCLUDE_DIRS}) + + get_property(SHIBOKEN_PYTHON_LIBRARIES GLOBAL PROPERTY shiboken_python_libraries) diff --git a/srcpkgs/python3-pyside6/patches/no-python-suffix.patch b/srcpkgs/python3-pyside6/patches/no-python-suffix.patch new file mode 100644 index 00000000000..d7f2072d012 --- /dev/null +++ b/srcpkgs/python3-pyside6/patches/no-python-suffix.patch @@ -0,0 +1,60 @@ +no python suffix like ".cpython-36m-x86_64-linux-gnu": provides a consistent +naming across architecture. + +Also don't overwrite the "real" cmake file with the generic wrapper's one: they +have the same name if no python suffix. + +--- a/sources/shiboken6/cmake/ShibokenSetup.cmake.ORIG ++++ b/sources/shiboken6/cmake/ShibokenSetup.cmake +@@ -73,6 +73,11 @@ + "PYTHON_CONFIG_SUFFIX is empty. It should never be empty. Please file a bug report.") + endif() + ++# no suffix like '.cpython-36m-x86_64-linux-gnu' ++set(PYTHON_EXTENSION_SUFFIX "") ++set(PYTHON_CONFIG_SUFFIX "") ++set(PYTHON_SHARED_LIBRARY_SUFFIX "") ++ + message(STATUS "PYTHON_EXTENSION_SUFFIX: ${PYTHON_EXTENSION_SUFFIX}") + message(STATUS "PYTHON_CONFIG_SUFFIX: ${PYTHON_CONFIG_SUFFIX}") + message(STATUS "PYTHON_SHARED_LIBRARY_SUFFIX: ${PYTHON_SHARED_LIBRARY_SUFFIX}") +--- a/sources/shiboken6/data/CMakeLists.txt.ORIG ++++ b/sources/shiboken6/data/CMakeLists.txt +@@ -36,16 +36,11 @@ + PATH_VARS SHIBOKEN_PYTHON_MODULE_DIR SHIBOKEN_SHARED_LIBRARY_DIR + ) + +-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken6Config.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/Shiboken6Config.cmake" @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Shiboken6ConfigVersion.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/Shiboken6ConfigVersion.cmake" @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken6.pc.in" + "${CMAKE_CURRENT_BINARY_DIR}/shiboken6${shiboken6_SUFFIX}.pc" @ONLY) + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Shiboken6Config.cmake" +- DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken6") +- + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/Shiboken6Config${PYTHON_CONFIG_SUFFIX}.cmake" + DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken6") + +--- a/sources/pyside6/libpyside/CMakeLists.txt ++++ b/sources/pyside6/libpyside/CMakeLists.txt +@@ -166,8 +166,6 @@ + PATH_VARS PYSIDE_PYTHONPATH PYSIDE_TYPESYSTEMS PYSIDE_GLUE + ) + +-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySide6Config.cmake.in" +- "${CMAKE_CURRENT_BINARY_DIR}/PySide6Config.cmake" @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySide6ConfigVersion.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/PySide6ConfigVersion.cmake" @ONLY) + +@@ -184,9 +182,6 @@ + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside6${pyside6_SUFFIX}.pc" + DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") + +-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySide6Config.cmake" +- DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide6") +- + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/PySide6Config${SHIBOKEN_PYTHON_CONFIG_SUFFIX}.cmake" + DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide6") + diff --git a/srcpkgs/python3-pyside6/template b/srcpkgs/python3-pyside6/template new file mode 100644 index 00000000000..2ca7efaaffa --- /dev/null +++ b/srcpkgs/python3-pyside6/template @@ -0,0 +1,136 @@ +# Template file for 'python3-pyside6' +# NOTE: keep in sync with Qt6 +pkgname=python3-pyside6 +version=6.7.2 +revision=1 +build_style=cmake +configure_args="-DBUILD_TESTS=OFF -DFORCE_LIMITED_API=no -DNO_QT_TOOLS=yes + -DNUMPY_INCLUDE_DIR=/${py3_sitelib}/numpy/_core/include + -DPYTHON_EXECUTABLE=/usr/bin/python3 -Wno-dev" +hostmakedepends="python3-numpy python3-setuptools qt6-base" +makedepends="libedit-devel libxslt-devel llvm17-devel python3-devel qt6-3d-devel + qt6-base-private-devel qt6-charts-devel qt6-connectivity-devel + qt6-declarative-private-devel qt6-location-devel qt6-multimedia-devel + qt6-networkauth-devel qt6-position-devel qt6-quick3d-devel + qt6-remoteobjects-devel qt6-scxml-devel qt6-sensors-devel qt6-serialport-devel + qt6-shadertools-devel qt6-speech-devel qt6-speech-plugin-flite + qt6-speech-plugin-mock qt6-speech-plugin-speechd qt6-svg-devel qt6-tools-devel + qt6-webchannel-devel qt6-websockets-devel $(vopt_if pdf qt6-pdf-devel) + $(vopt_if webengine qt6-webengine-devel)" +depends="python3-shiboken6" +short_desc="Python bindings of Qt6-based libraries" +maintainer="chrysos349 " +license="LGPL-3.0-only, GPL-2.0-only" +homepage="https://doc.qt.io/qtforpython-6" +distfiles="https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-${version}-src/pyside-setup-everywhere-src-${version}.tar.xz" +checksum=3a2b0d0d6e78c9aa5ddc7f06ca4b6f11a3fe14560baeb148eea53b5d98e368c7 +conflicts="pyside2-tools" + +build_options="pdf webengine" + +subpackages="libpyside6 libpyside6-devel libshiboken6 libshiboken6-devel python3-shiboken6" + +case "$XBPS_TARGET_MACHINE" in + armv5*|armv6*) build_options_default="" ;; + *) build_options_default="pdf" ;; +esac + +export LLVM_INSTALL_DIR=${XBPS_CROSS_BASE}/usr +export PYTHONPATH=$PYTHONPATH:${XBPS_BUILDDIR}/${pkgname}-${version}/build/sources + +if [ "$XBPS_WORDSIZE$XBPS_WORDSIZE" = "64$XBPS_TARGET_WORDSIZE" ]; then + build_options_default+=" webengine" + subpackages+=" python3-pyside6-webengine" +fi + +if [ "$CROSS_BUILD" ]; then + hostmakedepends+=" libglvnd-devel libshiboken6-devel shiboken6" + + case "$XBPS_TARGET_MACHINE" in + x86_64*|aarch64*) makedepends+=" libomp-devel" ;; + esac + + configure_args+=" + -DQFP_PYTHON_HOST_PATH=/usr/bin/python3 + -DQFP_PYTHON_SITE_PACKAGES=/${py3_sitelib}" +else + subpackages+=" shiboken6" +fi + +post_patch() { + if [ "$CROSS_BUILD" ]; then + # fix pkg-config file on cross + vsed -i sources/shiboken6/data/shiboken6.pc.in \ + -e "s/Python_EXECUTABLE/QFP_PYTHON_HOST_PATH/" + fi +} + +post_install() { + # remove extraneous scripts/files + find "$DESTDIR"/usr/bin -not -name shiboken6 -type f -delete +} + +libpyside6_package() { + short_desc+=" - shared library" + pkg_install() { + vmove "usr/lib/libpyside*.so.*" + } +} + +libpyside6-devel_package() { + depends="libpyside6-${version}_${revision} python3-pyside6-${version}_${revision} + libshiboken6-devel-${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove "usr/lib/cmake/PySide*" + vmove "usr/lib/libpyside*.so" + vmove usr/lib/qt6 + vmove usr/include/PySide6 + vmove usr/lib/pkgconfig/pyside6.pc + vmove usr/share + } +} + +libshiboken6_package() { + short_desc="CPython bindings generator for C++ libraries - shared library" + pkg_install() { + vmove "usr/lib/libshiboken6.so.*" + } +} + +libshiboken6-devel_package() { + depends="libshiboken6-${version}_${revision} python3-shiboken6-${version}_${revision}" + short_desc="CPython bindings generator for C++ libraries - development files" + pkg_install() { + vmove "usr/lib/cmake/Shiboken*" + vmove usr/include/shiboken6 + vmove usr/lib/libshiboken6.so + vmove usr/lib/pkgconfig/shiboken6.pc + } +} + +python3-shiboken6_package() { + short_desc="Python shiboken6 bindings" + depends="python3" + pkg_install() { + vmove ${py3_sitelib}/shiboken6 + } +} + +shiboken6_package() { + short_desc="CPython bindings generator for C++ libraries" + depends="python3" + conflicts="shiboken2" + pkg_install() { + vmove "usr/bin/shiboken*" + vmove ${py3_sitelib}/shiboken6_generator + } +} + +python3-pyside6-webengine_package() { + depends="python3-pyside6-${version}_${revision}" + short_desc+=" - WebEngine component" + pkg_install() { + vmove "${py3_sitelib}/PySide6/QtWebEngine*" + } +} diff --git a/srcpkgs/python3-pyside6/update b/srcpkgs/python3-pyside6/update new file mode 100644 index 00000000000..38f0b57b82d --- /dev/null +++ b/srcpkgs/python3-pyside6/update @@ -0,0 +1,3 @@ +pkgname=pyside-setup-everywhere +vdprefix=PySide6- +vdsuffix=-src diff --git a/srcpkgs/python3-shiboken6 b/srcpkgs/python3-shiboken6 new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/python3-shiboken6 @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file diff --git a/srcpkgs/shiboken6 b/srcpkgs/shiboken6 new file mode 120000 index 00000000000..6491748d6ac --- /dev/null +++ b/srcpkgs/shiboken6 @@ -0,0 +1 @@ +python3-pyside6 \ No newline at end of file