[neon/snap-packaging/qt-common-themes] /: Rework themes.

Scarlett Moore null at kde.org
Wed Jul 3 09:23:32 BST 2024


Git commit b3b213f3a03b67eecbbd0e22b82ad22c76df0818 by Scarlett Moore.
Committed on 03/07/2024 at 08:23.
Pushed by scarlettmoore into branch 'master'.

Rework themes.

M  +73   -38   snapcraft.yaml

https://invent.kde.org/neon/snap-packaging/qt-common-themes/-/commit/b3b213f3a03b67eecbbd0e22b82ad22c76df0818

diff --git a/snapcraft.yaml b/snapcraft.yaml
index 8890cf7..58012a3 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -12,6 +12,7 @@ compression: lzo
 
 grade: stable
 confinement: strict
+version: 1.0
 
 slots:
   gtk-2-themes:
@@ -30,7 +31,16 @@ slots:
     interface: content
     source:
       read:
-        - "."
+        - $SNAP/usr/share/plasma/desktoptheme/breeze-dark
+        - $SNAP/usr/share/plasma/desktoptheme/breeze-light
+        - $SNAP/usr/share/plasma/desktoptheme/default
+        - $SNAP/usr/share/plasma/desktoptheme/oxygen
+        - $SNAP/usr/share/plasma/look-and-feel
+        - $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
+        - $SNAP/usr/share/QtCurve
+        - $SNAP/usr/share/color-schemes
+        - $SNAP/usr/share/kstyle
+        - $SNAP/usr/share/Kvantum
   icon-themes:
     interface: content
     source:
@@ -59,54 +69,81 @@ slots:
     target: $SNAP/kf6
 
 environment:
-    LD_LIBRARY_PATH: /snap/kf6-core22/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/kde-qt6-core22-sdk/current/usr/lib:$SNAP/usr/lib:$SNAP/lib/:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/usr/lib:/lib
-    QT_PLUGIN_PATH: /snap/kf6-core22/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
+    LD_LIBRARY_PATH: /snap/kf6-core22/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/kf6-core22/current/usr/lib:$SNAP/usr/lib:$SNAP/lib/:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/usr/lib:/lib
+    QT_PLUGIN_PATH: $SNAP/kf6/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
     SNAP_DESKTOP_RUNTIME: $SNAP/kf6
 
 
 parts:
-  version-script:
+  # version-script:
+  #   plugin: nil
+  #   source: .
+  #   build-packages:
+  #     - git
+  #   override-build: |
+  #     craftctl set-version $(git -C $CRAFT_PROJECT_DIR describe --tags 2>/dev/null || echo 0.1)
+  # Breeze: KDE's default theme
+  base:
+    after: [utils]
     plugin: nil
-    source: .
-    build-packages:
-      - git
-    override-build: |
-      craftctl set-version $(git -C $CRAFT_PROJECT_DIR describe --tags 2>/dev/null || echo 0.1)
-
+    build-snaps:
+    - qt-common-themes-sdk
+    stage:
+      - usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
 
-  # Breeze: KDE's default theme
   breeze:
     after: [utils]
     plugin: nil
     build-snaps:
     - qt-common-themes-sdk
     stage:
-      - usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
       - usr/share/QtCurve
-      - usr/share/color-schemes/
-      - usr/share/kstyle/
+      - usr/share/color-schemes/Breeze*
+      - usr/share/kstyle
+      - usr/share/plasma/desktoptheme/default
+      - usr/share/plasma/desktoptheme/breeze-dark
+      - usr/share/plasma/desktoptheme/breeze-light
+    override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/usr $CRAFT_PART_INSTALL
+      craftctl default
+
+  oxygen:
+    after: [utils]
+    plugin: nil
+    build-snaps:
+    - qt-common-themes-sdk
+    stage:
+      - usr/share/color-schemes/Oxygen*
+      - usr/share/plasma/desktoptheme/oxygen
+      - usr/share/plasma/look-and-feel/org.kde.oxygen
+    override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/usr/share/plasma/desktoptheme/oxygen $CRAFT_PART_INSTALL
+      craftctl default
 
   oxygen-icons:
     after: [utils]
     plugin: nil
     build-snaps:
-    - kf6-core22-sdk
+    - kf6-core22
     stage:
       - usr/share/icons/oxygen
     override-build: |
-      snapcraftctl build
-      $SNAPCRAFT_STAGE/update-icon-cache.sh $SNAPCRAFT_PART_INSTALL/share/icons
+      cp -rfv /snap/kf6-core22/current/usr/share/icons/oxygen $CRAFT_PART_INSTALL
+      craftctl default
+      $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
 
-  # KDE's Breeze cursor themes
+  # KDE's Breeze icons themes
   breeze-icons:
     after: [utils]
     plugin: nil
     build-snaps:
-    - kf6-core22-sdk
+    - kf6-core22
     stage:
       - usr/share/icons/breeze
       - usr/share/icons/breeze-dark
     override-build: |
+      cp -rfv /snap/kf6-core22/current/usr/share/icons/breeze $CRAFT_PART_INSTALL
+      cp -rfv /snap/kf6-core22/current/usr/share/icons/breeze-dark $CRAFT_PART_INSTALL
       craftctl default
       $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
 
@@ -114,7 +151,7 @@ parts:
     after: [utils]
     plugin: nil
     build-snaps:
-    - kf6-core22-sdk
+    - qt-common-themes-sdk
     stage:
       - usr/share/icons/Breeze_Light
       - usr/share/icons/breeze_cursors
@@ -124,6 +161,8 @@ parts:
       'cursors/Breeze/Breeze_Light/cursors' : 'share/icons/Breeze_Light/cursors'
       'cursors/Breeze/Breeze_Light/index.theme' : 'share/icons/Breeze_Light/index.theme'
     override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/usr/share/icons/Breeze_Light $CRAFT_PART_INSTALL
+      cp -rfv /snap/qt-common-themes-sdk/current/usr/share/icons/breeze_cursors $CRAFT_PART_INSTALL
       craftctl default
       $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
 
@@ -131,7 +170,7 @@ parts:
     after: [utils]
     plugin: nil
     build-snaps:
-    - kf6-core22-sdk
+    - kf6-core22
     stage:
       - usr/share/icons/Oxygen_Black
       - usr/share/icons/Oxygen_Blue
@@ -150,6 +189,7 @@ parts:
       'cursors/Oxygen/Oxygen_Zion/cursors' : 'share/icons/Oxygen_Zion/cursors'
       'cursors/Oxygen/Oxygen_Zion/index.theme' : 'share/icons/Oxygen_Zion/index.theme'
     override-build: |
+      cp -rfv /snap/kf6-core22/current/usr/share/icons $CRAFT_PART_INSTALL
       craftctl default
       $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
 
@@ -159,18 +199,13 @@ parts:
     build-snaps:
     - qt-common-themes-sdk
     stage:
-    - usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
-    - usr/share/color-schemes
-    - usr/share/icons
+    - usr/share/color-schemes/Kv*
+    - usr/share/icons/hicolor
     - usr/share/Kvantum
-
-  qt6gtk2:
-    after: [utils]
-    plugin: nil
-    build-snaps:
-    - qt-common-themes-sdk
-    stage:
-    - usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
+    override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/usr $CRAFT_PART_INSTALL
+      craftctl default
+      ls $CRAFT_STAGE/
 
   #KDE GTK themes
   breeze-gtk:
@@ -187,11 +222,12 @@ parts:
     - share/themes/Breeze-Dark/gtk-2.0/
     - share/themes/Breeze-Dark/gtk-3.0/
     override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/share $CRAFT_PART_INSTALL
       craftctl default
-      $CRAFT_STAGE/split-gtk-theme.sh $CRAFT_STAGE
+      $CRAFT_STAGE/split-gtk-theme.sh $CRAFT_PART_INSTALL
       # Make assets available to both GTK 3 and GTK 2 themes after split
-      cp -a $CRAFT_STAGE/share/themes/Breeze/assets $CRAFT_STAGE/share/gtk2/Breeze/
-      cp -a $CRAFT_STAGE/share/themes/Breeze-Dark/assets $CRAFT_STAGE/share/gtk2/Breeze-Dark/
+      cp -a $CRAFT_PART_INSTALL/share/themes/Breeze/assets $CRAFT_PART_INSTALL/share/gtk2/Breeze/
+      cp -a $CRAFT_PART_INSTALL/share/themes/Breeze-Dark/assets $CRAFT_PART_INSTALL/share/gtk2/Breeze-Dark/
 
   oxygen-gtk:
     after: [utils]
@@ -201,10 +237,9 @@ parts:
     stage:
     - share/themes/oxygen-gtk
     override-build: |
+      cp -rfv /snap/qt-common-themes-sdk/current/share $CRAFT_PART_INSTALL
       craftctl default
-      $CRAFT_STAGE/split-gtk-theme.sh $CRAFT_STAGE
-      # Make assets available to both GTK 3 and GTK 2 themes after split
-      cp -a $CRAFT_STAGE/share/themes/oxygen-gtk/assets $CRAFT_STAGE/share/gtk2/oxygen-gtk/
+      $CRAFT_STAGE/split-gtk-theme.sh $CRAFT_PART_INSTALL
 
   utils:
     plugin: dump


More information about the Neon-commits mailing list