diff --git a/.gitignore b/.gitignore index 6af1670..e68479b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ Sunstone.zip /.flatpak-builder/ # Packaging build artifacts +/dist/ /packaging/arch/*.pkg.tar.zst /packaging/arch/src/ /packaging/arch/pkg/ diff --git a/crates/sunstone-gtk/src/lib.rs b/crates/sunstone-gtk/src/lib.rs index d36eda5..8727438 100644 --- a/crates/sunstone-gtk/src/lib.rs +++ b/crates/sunstone-gtk/src/lib.rs @@ -297,7 +297,7 @@ pub fn apply_css() { /* Solid kind badge hung off a notification avatar's corner. */ .kind-badge { border-radius: 999px; min-width: 20px; min-height: 20px; border: 2px solid #0b0b0c; } - .kind-badge > image, .kind-badge > label { margin: 0 auto; } + .kind-badge > image, .kind-badge > label { margin: 0; } .kind-badge.notif-react { background: #F2557E; color: #ffffff; } .kind-badge.notif-repost { background: #5BD08A; color: #0b0b0c; } .kind-badge.notif-zap { background: #FFC04A; color: #2a1d04; } diff --git a/packaging/arch/build-local.sh b/packaging/arch/build-local.sh new file mode 100755 index 0000000..de6c77a --- /dev/null +++ b/packaging/arch/build-local.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# Build a native Arch package (.pkg.tar.zst) from the current git HEAD, without +# needing a published forge release. Uses the same recipe as ./PKGBUILD but +# sources a tarball of the local checkout instead of downloading from the forge. +# +# Usage: packaging/arch/build-local.sh +# Output: dist/sunstone---x86_64.pkg.tar.zst (in the repo root) +# +# Install the result with: sudo pacman -U dist/sunstone-*.pkg.tar.zst +set -euo pipefail + +repo_root="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)" +pkgbuild="$repo_root/packaging/arch/PKGBUILD" +ver="$(awk -F\" '/^version = / {print $2; exit}' "$repo_root/Cargo.toml")" + +distdir="$repo_root/dist" +workdir="$(mktemp -d)" +trap 'rm -rf "$workdir"' EXIT + +echo ">> Packaging sunstone $ver from $(git -C "$repo_root" rev-parse --short HEAD)" + +# tracked files only, extracted under sunstone/ to match _srcdir in PKGBUILD. +git -C "$repo_root" archive --format=tar.gz --prefix="sunstone/" \ + -o "$workdir/sunstone-$ver.tar.gz" HEAD + +# Local PKGBUILD: pin pkgver + swap the forge source for the local tarball. +sed -e "s|^pkgver=.*|pkgver=$ver|" \ + -e "s|^source=.*|source=(\"sunstone-\$pkgver.tar.gz\")|" \ + "$pkgbuild" > "$workdir/PKGBUILD" + +# --nodeps: skip makepkg's install-check of runtime deps (gst plugins etc.) — +# they're declared in the package but needn't be installed on the build host. +# Build-time libs are checked separately by the compile itself. +( cd "$workdir" && makepkg -f --nodeps ) + +mkdir -p "$distdir" +cp -f "$workdir"/*.pkg.tar.* "$distdir"/ +echo +echo ">> Built:" +ls -1 "$distdir"/*.pkg.tar.*