[neon/snap-packaging/kde-pyside6-core-sdk/work.core24.iterate] /: add necessary patches

Carlos De Maine null at kde.org
Wed Aug 27 02:38:16 BST 2025


Git commit 9de7cc392ac7de15380e83129f0e8b137df7fe50 by Carlos De Maine.
Committed on 27/08/2025 at 01:38.
Pushed by carlosdem into branch 'work.core24.iterate'.

add necessary patches

A  +18   -0    debian/patches/0002-disable-qtexampleicons.patch
A  +34   -0    debian/patches/0005-Fix-numpy-header-detection.patch
A  +28   -0    debian/patches/0010-Fix-python-module-paths-in-CMake.patch
A  +33   -0    debian/patches/Always-link-to-python-libraries.patch
A  +4    -0    debian/patches/series
M  +6    -11   snapcraft.yaml

https://invent.kde.org/neon/snap-packaging/kde-pyside6-core-sdk/-/commit/9de7cc392ac7de15380e83129f0e8b137df7fe50

diff --git a/debian/patches/0002-disable-qtexampleicons.patch b/debian/patches/0002-disable-qtexampleicons.patch
new file mode 100644
index 0000000..17f3c1e
--- /dev/null
+++ b/debian/patches/0002-disable-qtexampleicons.patch
@@ -0,0 +1,18 @@
+From: Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>
+Date: Fri, 3 May 2024 16:47:57 +1000
+Subject: disable-qtexampleicons
+
+---
+ sources/pyside6/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sources/pyside6/CMakeLists.txt b/sources/pyside6/CMakeLists.txt
+index f45c071..fbb55a6 100644
+--- a/sources/pyside6/CMakeLists.txt
++++ b/sources/pyside6/CMakeLists.txt
+@@ -42,4 +42,4 @@ endif()
+ 
+ add_subdirectory(doc)
+ 
+-add_subdirectory(qtexampleicons)
++# add_subdirectory(qtexampleicons)
diff --git a/debian/patches/0005-Fix-numpy-header-detection.patch b/debian/patches/0005-Fix-numpy-header-detection.patch
new file mode 100644
index 0000000..c0f5cc9
--- /dev/null
+++ b/debian/patches/0005-Fix-numpy-header-detection.patch
@@ -0,0 +1,34 @@
+From: Stuart Prescott <stuart at debian.org>
+Date: Sun, 16 Feb 2025 01:27:09 +1100
+Subject: Fix numpy header detection
+
+Existing code makes assumptions about site-packages/dist-packages
+and fails to find the headers; numpy has an explicit function for this
+---
+ build_scripts/utils.py | 13 ++-----------
+ 1 file changed, 2 insertions(+), 11 deletions(-)
+
+diff --git a/build_scripts/utils.py b/build_scripts/utils.py
+index 29f2545..d5c1063 100644
+--- a/build_scripts/utils.py
++++ b/build_scripts/utils.py
+@@ -77,17 +77,8 @@ def update_env_path(newpaths):
+ 
+ 
+ def get_numpy_location():
+-    for p in sys.path:
+-        if 'site-' in p:
+-            numpy = Path(p).resolve() / 'numpy'
+-            if numpy.is_dir():
+-                candidate = numpy / '_core' / 'include'  # Version 2
+-                if not candidate.is_dir():
+-                    candidate = numpy / 'core' / 'include'  # Version 1
+-                if candidate.is_dir():
+-                    return os.fspath(candidate)
+-                log.warning(f"Cannot find numpy include dir under {numpy}")
+-    return None
++    import numpy
++    return numpy.get_include()
+ 
+ 
+ def platform_cmake_options(as_tuple_list=False):
diff --git a/debian/patches/0010-Fix-python-module-paths-in-CMake.patch b/debian/patches/0010-Fix-python-module-paths-in-CMake.patch
new file mode 100644
index 0000000..22a1b6d
--- /dev/null
+++ b/debian/patches/0010-Fix-python-module-paths-in-CMake.patch
@@ -0,0 +1,28 @@
+From: Stuart Prescott <stuart at debian.org>
+Date: Tue, 18 Feb 2025 00:50:57 +1100
+Subject: Fix python module paths in CMake
+
+---
+ sources/shiboken6/cmake/ShibokenHelpers.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake
+index 9c47770..fa61aed 100644
+--- a/sources/shiboken6/cmake/ShibokenHelpers.cmake
++++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake
+@@ -125,13 +125,13 @@ macro(shiboken_internal_set_python_site_packages)
+                 if sys.platform == 'win32':
+                     lib_path = sysconfig.get_path('purelib')
+                 else:
+-                    lib_path = sysconfig.get_path('purelib', scheme='posix_prefix')
++                    lib_path = sysconfig.get_path('purelib', scheme='deb_system')
+ 
+                 # /home/qt/dev/env
+                 if sys.platform == 'win32':
+                     data_path = sysconfig.get_path('data')
+                 else:
+-                    data_path = sysconfig.get_path('data', scheme='posix_prefix')
++                    data_path = sysconfig.get_path('data', scheme='deb_system')
+ 
+                 # /lib/python3.9/site-packages
+                 rel_path = lib_path.replace(data_path, '')
diff --git a/debian/patches/Always-link-to-python-libraries.patch b/debian/patches/Always-link-to-python-libraries.patch
new file mode 100644
index 0000000..7e3aa88
--- /dev/null
+++ b/debian/patches/Always-link-to-python-libraries.patch
@@ -0,0 +1,33 @@
+From e9591e27db4ae3412d4504a69a8afebee9a1b83e Mon Sep 17 00:00:00 2001
+From: Christophe Giboudeaux <christophe at krop.fr>
+Date: Tue, 27 Jul 2021 14:54:00 +0200
+Subject: [PATCH] Always link to python libraries.
+
+Change-Id: I687191431adaff55927de353db8f81dfa30ba1b1
+---
+ sources/shiboken6/cmake/ShibokenHelpers.cmake | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake
+index 27ee333..4be2ad1 100644
+--- a/sources/shiboken6/cmake/ShibokenHelpers.cmake
++++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake
+@@ -425,13 +425,9 @@ macro(shiboken_compute_python_libraries)
+         "SHIBOKEN_COMPUTE_LIBS" "shiboken_compute_python_libraries"
+         "IS_CALLED_FROM_EXPORT" "" "" ${ARGN})
+ 
+-    if (NOT SHIBOKEN_PYTHON_LIBRARIES)
+-        set(SHIBOKEN_PYTHON_LIBRARIES "")
+-    endif()
+-
+-    if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES)
+-        set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES})
+-    endif()
++    # Always link to python libraries.
++    message(STATUS "Linking shiboken to ${Python_LIBRARIES}")
++    set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES})
+ 
+     # If the resulting variable
+     # contains a "debug;X;optimized;Y" list like described in shiboken_check_if_limited_api,
+-- 
+2.46.1
\ No newline at end of file
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..f085fba
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+0002-disable-qtexampleicons.patch
+0005-Fix-numpy-header-detection.patch
+0010-Fix-python-module-paths-in-CMake.patch
+Always-link-to-python-libraries.patch
diff --git a/snapcraft.yaml b/snapcraft.yaml
index c2edcd6..d3df05d 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -85,20 +85,15 @@ parts:
       - LLVM_INSTALL_DIR: /snap/kde-qt6-core24-sdk/current/usr/lib/llvm-18
       - PATH: /snap/kde-qt6-core24-sdk/current/usr/bin${PATH:+:$PATH}
       - PKG_CONFIG_PATH: "/snap/kde-qt6-core24-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
-      - PYTHONPATH: ${CRAFT_STAGE}/usr/lib/python3.12/site-packages:${CRAFT_STAGE}/usr/lib/python3/dist-packages
-
+      - PYTHONPATH: ${CRAFT_STAGE}/usr/lib/python3.12:${CRAFT_STAGE}/usr/lib/python3/dist-packages
     prime:
       - -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libcurl*
       - -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libvulkan*
-    # override-pull: |
-    #   craftctl default
-    #   # while read -r PATCHFILE ; do
-    #   #   ls -l
-    #   #   ls -l cmake/
-    #   #   ls -l qtbase/cmake/
-    #   #   pwd
-    #   #   patch -p1 < "$CRAFT_PROJECT_DIR/patches/$PATCHFILE"
-    #   # done < $CRAFT_PROJECT_DIR/patches/series
+    override-pull: |
+      craftctl default
+      while read -r PATCHFILE ; do
+        patch -p1 < "$CRAFT_PROJECT_DIR/patches/$PATCHFILE"
+      done < $CRAFT_PROJECT_DIR/patches/series
     override-build: |
       craftctl default
       mkdir -p $CRAFT_PART_INSTALL/etc/$CRAFT_PART_NAME


More information about the Neon-commits mailing list