diff --git a/.github/workflows/build-qt-linux.yml b/.github/workflows/build-qt-linux.yml index c6326fb61..172cbc302 100644 --- a/.github/workflows/build-qt-linux.yml +++ b/.github/workflows/build-qt-linux.yml @@ -191,10 +191,14 @@ jobs: curl -fsSL -o linuxdeploy-plugin-qt \ "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH_TAG}.AppImage" chmod +x linuxdeploy linuxdeploy-plugin-qt - cp packaging/linux/qbz.desktop qbz.desktop + # The desktop file goes in under the MPRIS DesktopEntry basename + # (com.blitzfc.qbz.desktop), so an integrated AppImage resolves the + # media-widget icon like the deb/rpm do. Icon=qbz -> qbz.png. + cp packaging/linux/qbz.desktop com.blitzfc.qbz.desktop cp packaging/icons/256x256.png qbz.png ./linuxdeploy --appimage-extract-and-run --appdir AppDir \ - -e qbz -d qbz.desktop -i qbz.png --plugin qt + -e qbz -d com.blitzfc.qbz.desktop -i qbz.png --plugin qt + scripts/packaging/desktop_entry_check.sh --appdir AppDir # Nothing in the app uses Qt SQL / network-information plugins. rm -rf AppDir/usr/plugins/sqldrivers AppDir/usr/plugins/networkinformation echo "platforms: $(ls AppDir/usr/plugins/platforms | tr '\n' ' ')" diff --git a/.github/workflows/release-linux-aarch64.yml b/.github/workflows/release-linux-aarch64.yml index 65ba4abcf..9368f6981 100644 --- a/.github/workflows/release-linux-aarch64.yml +++ b/.github/workflows/release-linux-aarch64.yml @@ -104,6 +104,12 @@ jobs: exit 1 fi + # The media-widget icon invariant (DesktopEntry == installed .desktop + # basename, Icon= installed) — regressed more than once, so it is a + # gate at the recipe level here and on the built packages below. + - name: Gate — desktop entry / icon invariant (recipes) + run: scripts/packaging/desktop_entry_check.sh + # No workflow may build the frozen Slint binary: same bin name, same # target dir, last build wins the file — a smoke against "the wrong # qbz" is silent. @@ -225,6 +231,16 @@ jobs: -t "dist/qbzd-${VERSION}-1.${RPM_ARCH}.rpm" ls -la dist + # The same invariant on the ARTIFACTS: the deb/rpm must install + # /usr/share/applications/.desktop and its Icon=. + - name: Gate — desktop entry / icon invariant (packages) + run: | + sudo apt-get install -y --no-install-recommends rpm + scripts/packaging/desktop_entry_check.sh \ + --deb "dist/QBZ_${VERSION}_${DEB_ARCH}.deb" \ + --rpm "dist/QBZ-${VERSION}-1.${RPM_ARCH}.rpm" \ + --appdir AppDir + - name: Build AppImage run: | curl -fsSL -o appimagetool \ diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml index 3a07777d9..db18d0455 100644 --- a/.github/workflows/release-linux.yml +++ b/.github/workflows/release-linux.yml @@ -104,6 +104,12 @@ jobs: exit 1 fi + # The media-widget icon invariant (DesktopEntry == installed .desktop + # basename, Icon= installed) — regressed more than once, so it is a + # gate at the recipe level here and on the built packages below. + - name: Gate — desktop entry / icon invariant (recipes) + run: scripts/packaging/desktop_entry_check.sh + # No workflow may build the frozen Slint binary: same bin name, same # target dir, last build wins the file — a smoke against "the wrong # qbz" is silent. @@ -225,6 +231,16 @@ jobs: -t "dist/qbzd-${VERSION}-1.${RPM_ARCH}.rpm" ls -la dist + # The same invariant on the ARTIFACTS: the deb/rpm must install + # /usr/share/applications/.desktop and its Icon=. + - name: Gate — desktop entry / icon invariant (packages) + run: | + sudo apt-get install -y --no-install-recommends rpm + scripts/packaging/desktop_entry_check.sh \ + --deb "dist/QBZ_${VERSION}_${DEB_ARCH}.deb" \ + --rpm "dist/QBZ-${VERSION}-1.${RPM_ARCH}.rpm" \ + --appdir AppDir + - name: Build AppImage run: | curl -fsSL -o appimagetool \ diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index efead6c97..d85f93de8 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -56,8 +56,9 @@ jobs: cxxflags: "-include arm_acle.h" - target: x86_64-apple-darwin # macos-latest is arm64; Intel needs an Intel runner (arm_acle.h - # is ARM-only, so no CXXFLAGS here). - runner: macos-15-intel + # is ARM-only, so no CXXFLAGS here). macos-26-intel so both legs + # carry Xcode 26's actool for the Icon Composer app icon. + runner: macos-26-intel artifact: qbz-macos-x86_64 # Historical dmg naming: intel assets ship as "x64". arch: x64 @@ -165,6 +166,30 @@ jobs: cp "crates/target/${{ matrix.target }}/release/qbz" "$APP/Contents/MacOS/qbz" chmod +x "$APP/Contents/MacOS/qbz" cp packaging/icons/icon.icns "$APP/Contents/Resources/icon.icns" + # The Liquid Glass app icon (packaging/icons/QBZ.icon, Icon Composer + # source, issue #712): compiled by Xcode 26's actool into + # Assets.car + CFBundleIconName=QBZ. macOS 26 renders the layered + # icon; older macOS and a runner without Xcode 26 fall back to + # icon.icns via CFBundleIconFile, which is always written. + ICON_NAME_KEY="" + if xcrun --find actool >/dev/null 2>&1 \ + && [[ "$(xcodebuild -version | head -1 | grep -oE '[0-9]+' | head -1)" -ge 26 ]]; then + xcrun actool packaging/icons/QBZ.icon \ + --compile "$APP/Contents/Resources" \ + --app-icon QBZ \ + --platform macosx --minimum-deployment-target 12.0 \ + --include-all-app-icons \ + --output-partial-info-plist icon-partial.plist \ + --errors --warnings --notices 2>&1 | tee actool.log + test -f "$APP/Contents/Resources/Assets.car" \ + || { echo "::error::actool produced no Assets.car"; exit 1; } + /usr/libexec/PlistBuddy -c 'Print :CFBundleIconName' icon-partial.plist \ + || { echo "::error::actool partial plist has no CFBundleIconName"; exit 1; } + ICON_NAME_KEY='CFBundleIconNameQBZ' + echo "app icon: Icon Composer source compiled (Assets.car)" + else + echo "::warning::Xcode 26 actool not available — shipping icon.icns only" + fi cat > "$APP/Contents/Info.plist" < @@ -176,6 +201,7 @@ jobs: CFBundleDisplayNameQBZ CFBundleExecutableqbz CFBundleIconFileicon + ${ICON_NAME_KEY} CFBundleShortVersionString${VERSION} CFBundleVersion${VERSION} LSMinimumSystemVersion12.0 diff --git a/scripts/packaging/desktop_entry_check.sh b/scripts/packaging/desktop_entry_check.sh new file mode 100755 index 000000000..e724f2992 --- /dev/null +++ b/scripts/packaging/desktop_entry_check.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# scripts/packaging/desktop_entry_check.sh — the MPRIS DesktopEntry / .desktop +# / icon invariant, as a gate (qbz-nix-docs/cicd/2026-08-04-desktop-entry-icon-mismatch.md). +# +# GNOME Shell / Plasma resolve the media widget's application icon ONLY through +# the MPRIS `DesktopEntry` property: they look for `.desktop` in +# the XDG application dirs and read its `Icon=`. If the installed basename +# differs from the constant, or `Icon=` names an icon the same package does not +# install, the widget shows no icon — and nothing else breaks, which is why +# this regressed more than once. Two properties, asserted at the SOURCE +# (recipes) and, when `--deb ` / `--rpm ` / `--appdir ` are +# given, on the ARTIFACT that ships. +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")/../.." + +ENTRY=$(grep -oP 'const DESKTOP_ENTRY: &str = "\K[^"]+' crates/qbz-media-controls/src/linux.rs) +[[ -n "$ENTRY" ]] || { echo "::error::DESKTOP_ENTRY constant not found"; exit 1; } +echo "DesktopEntry = $ENTRY" +fail=0 +say_fail() { echo "::error::$*"; fail=1; } + +icon_of() { grep -m1 '^Icon=' "$1" | cut -d= -f2-; } + +# --- source recipes ----------------------------------------------------- +# nfpm (deb/rpm): the installed basename must be the constant; Icon= must be +# one of the hicolor names nfpm installs. +NFPM=packaging/nfpm/nfpm.yaml +dst=$(grep -oP 'dst: /usr/share/applications/\K[^ ]+\.desktop' "$NFPM" | head -1) +[[ "$dst" == "$ENTRY.desktop" ]] || say_fail "nfpm installs $dst, DesktopEntry is $ENTRY" +src=$(grep -B1 "dst: /usr/share/applications/$dst" "$NFPM" | grep -oP 'src: \K\S+') +icon=$(icon_of "$src") +grep -q "dst: /usr/share/icons/hicolor/[0-9x]*/apps/${icon}\.png" "$NFPM" \ + || say_fail "nfpm: $src has Icon=$icon but installs no hicolor/*/apps/$icon.png" +# StartupWMClass must be the constant too (window <-> launcher association). +for f in $(git ls-files 'packaging/*.desktop' 'flatpak/*.desktop'); do + wm=$(grep -m1 '^StartupWMClass=' "$f" | cut -d= -f2-) + [[ "$wm" == "$ENTRY" ]] || say_fail "$f: StartupWMClass=$wm != $ENTRY" +done +# Recipes that ship a reverse-DNS basename must match the constant exactly. +for f in $(git ls-files 'packaging/*.desktop' 'flatpak/*.desktop' | grep -v '/qbz\.desktop$'); do + base=$(basename "$f" .desktop) + [[ "$base" == "$ENTRY" ]] || say_fail "$f: basename $base != $ENTRY" +done + +# --- artifacts ------------------------------------------------------------ +while [[ $# -gt 0 ]]; do + case "$1" in + --deb) + list=$(dpkg-deb -c "$2" | awk '{print $6}') + grep -qx "./usr/share/applications/$ENTRY.desktop" <<<"$list" \ + || say_fail "$2 does not install /usr/share/applications/$ENTRY.desktop" + grep -q "^./usr/share/icons/hicolor/256x256/apps/${icon}\.png$" <<<"$list" \ + || say_fail "$2 does not install hicolor/256x256/apps/$icon.png" + echo "deb OK: $2"; shift 2 ;; + --rpm) + list=$(rpm -qlp "$2" 2>/dev/null || true) + grep -qx "/usr/share/applications/$ENTRY.desktop" <<<"$list" \ + || say_fail "$2 does not install /usr/share/applications/$ENTRY.desktop" + grep -q "^/usr/share/icons/hicolor/256x256/apps/${icon}\.png$" <<<"$list" \ + || say_fail "$2 does not install hicolor/256x256/apps/$icon.png" + echo "rpm OK: $2"; shift 2 ;; + --appdir) + d="$2" + [[ -f "$d/$ENTRY.desktop" ]] || say_fail "$d has no $ENTRY.desktop at its root" + aicon=$(icon_of "$d/$ENTRY.desktop") + [[ -f "$d/$aicon.png" || -L "$d/$aicon.png" ]] || say_fail "$d: Icon=$aicon but no $aicon.png at the root" + [[ -e "$d/.DirIcon" ]] || say_fail "$d has no .DirIcon" + echo "AppDir OK: $d"; shift 2 ;; + *) echo "unknown arg $1"; exit 2 ;; + esac +done +(( fail == 0 )) && echo "desktop-entry check OK" || exit 1