[neon/snap-packaging/qt-common-themes-sdk] /: Patch cmake file to find schemas.

Scarlett Moore null at kde.org
Thu Jul 4 14:37:25 BST 2024


Git commit 98023f45bacc909fe916b999d8a504431a9f694a by Scarlett Moore.
Committed on 04/07/2024 at 13:36.
Pushed by scarlettmoore into branch 'master'.

Patch cmake file to find schemas.

A  +12   -0    patches/kde-gtk-config/fix_gschemas.patch
A  +1    -0    patches/kde-gtk-config/series
M  +22   -2    snapcraft.yaml

https://invent.kde.org/neon/snap-packaging/qt-common-themes-sdk/-/commit/98023f45bacc909fe916b999d8a504431a9f694a

diff --git a/patches/kde-gtk-config/fix_gschemas.patch b/patches/kde-gtk-config/fix_gschemas.patch
new file mode 100644
index 0000000..5dd5621
--- /dev/null
+++ b/patches/kde-gtk-config/fix_gschemas.patch
@@ -0,0 +1,12 @@
+index 6d70a2e..34865a0 100644
+--- a/cmake/modules/FindGSettingSchemas.cmake
++++ b/cmake/modules/FindGSettingSchemas.cmake
+@@ -3,7 +3,7 @@ find_package(PkgConfig)
+ pkg_check_modules(PC_GLIB2 REQUIRED glib-2.0)
+
+ find_path(GLIB_SCHEMAS_DIR org.gnome.desktop.interface.gschema.xml
+-    HINTS ${PC_GLIB2_PREFIX}/share
++    HINTS /usr/share
+     PATH_SUFFIXES glib-2.0/schemas)
+
+ if (GLIB_SCHEMAS_DIR)
diff --git a/patches/kde-gtk-config/series b/patches/kde-gtk-config/series
new file mode 100644
index 0000000..4663860
--- /dev/null
+++ b/patches/kde-gtk-config/series
@@ -0,0 +1 @@
+fix_gschemas.patch
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 0938766..1bc9e88 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -340,10 +340,30 @@ parts:
         plugin: cmake
         build-packages:
         - gsettings-desktop-schemas-dev
+        - gsettings-desktop-schemas
+        - pkg-config
+        - gir1.2-gdesktopenums-3.0
         stage-packages:
         - gsettings-desktop-schemas
         build-snaps:
         - kf6-core22-sdk
         - kde-qt6-core22-sdk
-        cmake-parameters: *cmakeparameters
-        build-environment: *buildenvironment
+        cmake-parameters:
+        - "-DCMAKE_FIND_ROOT_PATH=$CRAFT_STAGE\\;/snap/kde-qt6-core22-sdk/current\\;/snap/kf6-core22-sdk/current"
+        - "-DCMAKE_PREFIX_PATH=$CRAFT_STAGE\\;/snap/kde-qt6-core22-sdk/current\\;/snap/kf6-core22-sdk/current\\;/usr"
+        build-environment:
+            - PATH: /snap/kde-qt6-core22-sdk/current/usr/bin${PATH:+:$PATH}
+            - PKG_CONFIG_PATH: /snap/kde-qt6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pkgconfig:/snap/kf6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pkgconfig:$CRAFT_STAGE/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pkgconfig:$CRAFT_STAGE/usr/share/pkconfig:${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
+            - XDG_DATA_DIRS: $CRAFT_STAGE/usr/share:/snap/kde-qt6-core22-sdk/current/usr/share:/usr/share:/root/parts/kde-gtk-config/install/usr/share/glib-2.0/schemas:${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}
+            - XDG_CONFIG_HOME: $CRAFT_STAGE/etc/xdg:/snap/kde-qt6-core22-sdk/current/etc/xdg:/etc/xdg${XDG_CONFIG_HOME:+:$XDG_CONFIG_HOME}
+            - LD_LIBRARY_PATH: "/snap/kde-qt6-core22-sdk/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}:/snap/kde-qt6-core22-sdk/current/usr/lib:$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib/:$CRAFT_STAGE/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+            - GSETTINGS_SCHEMA_DIR: $CRAFT_STAGE/usr/share/glib-2.0/schemas
+        override-pull: |
+            craftctl default
+            while read -r PATCHFILE ; do
+                patch -p1 < "$CRAFT_PROJECT_DIR/patches/kde-gtk-config/$PATCHFILE"
+            done < $CRAFT_PROJECT_DIR/patches/kde-gtk-config/series
+        override-build: |
+            mkdir -p $CRAFT_STAGE/usr/share/glib-2.0/schemas
+            cp -rfv /usr/share/glib-2.0/schemas/* $CRAFT_STAGE/usr/share/glib-2.0/schemas/
+            craftctl default


More information about the Neon-commits mailing list