[neon/snap-packaging/icon-theme-breeze-snap] /: Initial attempt.
Scarlett Moore
null at kde.org
Wed Jul 31 00:56:26 BST 2024
Git commit 0c12f59f034144db4a8e7350e8301a5f5f1f1bd8 by Scarlett Moore.
Committed on 30/07/2024 at 23:56.
Pushed by scarlettmoore into branch 'master'.
Initial attempt.
A +8 -0 debian/.gitlab-ci-neon.yml
A +84 -0 snapcraft.yaml
A +21 -0 utils/split-gtk-theme.sh
A +17 -0 utils/update-icon-cache.sh
https://invent.kde.org/neon/snap-packaging/icon-theme-breeze-snap/-/commit/0c12f59f034144db4a8e7350e8301a5f5f1f1bd8
diff --git a/debian/.gitlab-ci-neon.yml b/debian/.gitlab-ci-neon.yml
new file mode 100644
index 0000000..ab2589a
--- /dev/null
+++ b/debian/.gitlab-ci-neon.yml
@@ -0,0 +1,8 @@
+# SPDX-FileCopyrightText: none
+# SPDX-License-Identifier: CC0-1.0
+
+include:
+ - project: sysadmin/ci-utilities
+ file:
+# - /gitlab-templates/snap-snapcraft-destructive.yml
+ - /gitlab-templates/snap-snapcraft-lxd.yml
diff --git a/snapcraft.yaml b/snapcraft.yaml
new file mode 100644
index 0000000..332f635
--- /dev/null
+++ b/snapcraft.yaml
@@ -0,0 +1,84 @@
+name: icon-theme-breeze
+architectures:
+ - build-on: amd64
+ run-on: all
+version: '1.0'
+summary: Breeze is the default theme for KDE plasma;
+description: |
+ Snap of the Breeze icon theme.
+
+# We build against Ubuntu 22.04 packages, but use the "bare" base as
+# we don't want to force installation of a large base snap.
+build-base: core22
+base: bare
+
+grade: stable
+confinement: strict
+
+slots:
+ icon-themes:
+ interface: content
+ source:
+ read:
+ - $SNAP/usr/share/icons/breeze_cursors
+ - $SNAP/usr/share/icons/Breeze_Light
+ - $SNAP/usr/share/icons/breeze
+ - $SNAP/usr/share/icons/breeze-dark
+
+parts:
+ base:
+ after: [utils]
+ plugin: nil
+ stage-snaps:
+ - qt-common-themes-sdk/latest/stable
+ stage:
+ - -usr/lib/*/libdrm*
+ - -usr/share/doc/libdrm*
+ override-prime: |
+ set -eux
+ craftctl default
+ cd $CRAFT_PRIME
+ find . -type f,l -name "*.h" -exec bash -c "rm -f {}*" \;
+
+ # KDE's Breeze icons themes
+ breeze-icons:
+ after: [utils]
+ plugin: nil
+ build-snaps:
+ - kf6-core22
+ stage:
+ - usr/share/icons/breeze
+ - usr/share/icons/breeze-dark
+ override-build: |
+ mkdir -p $CRAFT_PART_INSTALL/usr/share/icons/
+ cp -rfv /snap/kf6-core22/current/usr/share/icons/breeze $CRAFT_PART_INSTALL/usr/share/icons/
+ cp -rfv /snap/kf6-core22/current/usr/share/icons/breeze-dark $CRAFT_PART_INSTALL/usr/share/icons/
+ craftctl default
+ $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
+
+ breeze-cursors:
+ after: [utils]
+ plugin: nil
+ build-snaps:
+ - qt-common-themes-sdk
+ stage:
+ - usr/share/icons/Breeze_Light
+ - usr/share/icons/breeze_cursors
+ organize:
+ 'cursors/Breeze/Breeze/cursors' : 'share/icons/breeze_cursors/cursors'
+ 'cursors/Breeze/Breeze/index.theme' : 'share/icons/breeze_cursors/index.theme'
+ '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 $CRAFT_PART_INSTALL
+ craftctl default
+ $CRAFT_STAGE/update-icon-cache.sh $CRAFT_PART_INSTALL/share/icons
+
+ utils:
+ plugin: dump
+ source: utils
+ prime:
+ - -*
+ build-packages:
+ - try: [gtk-update-icon-cache]
+ - else: [libgtk-3-bin]
diff --git a/utils/split-gtk-theme.sh b/utils/split-gtk-theme.sh
new file mode 100755
index 0000000..73a1175
--- /dev/null
+++ b/utils/split-gtk-theme.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -eux
+
+basedir="$1"
+gtk2dir="$basedir/share/gtk2"
+themesdir="$basedir/share/themes"
+
+for theme in "$themesdir"/*; do
+ if [ ! -d "$theme" ]; then
+ continue
+ fi
+ themename="$(basename "$theme")"
+ for subdir in "$theme"/gtk-2*; do
+ if [ -d "$subdir" ]; then
+ mkdir -p "$gtk2dir/$themename"
+ mv "$subdir" "$gtk2dir/$themename/"
+ fi
+ done
+done
+
diff --git a/utils/update-icon-cache.sh b/utils/update-icon-cache.sh
new file mode 100755
index 0000000..38061eb
--- /dev/null
+++ b/utils/update-icon-cache.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -eux
+
+basedir="$1"
+
+# Don't include panel icons to reduce size as they aren't
+# generally useful in the snap.
+if [ -d "$basedir" ]; then
+ find "$basedir" -name panel -exec rm -rf {} +
+fi
+
+for dir in "$basedir"/*/; do
+ if [ -f "$dir/index.theme" ]; then
+ gtk-update-icon-cache -q "$dir"
+ fi
+done
More information about the Neon-commits
mailing list