Build GSConnect from source and enable it for GNOME
This commit is contained in:
parent
83f9caa2a7
commit
b574d38071
7 changed files with 116 additions and 9 deletions
|
|
@ -117,3 +117,24 @@ reached squashfs creation but ran out of disk space while writing the ISO becaus
|
|||
these reproducible trees were still present. Resume packaging from archiso's
|
||||
completed stages after freeing only those scratch copies; do not delete the live
|
||||
root before its post-build self-check or remove unrelated host workloads.
|
||||
|
||||
## Packages built outside the pinned repositories
|
||||
|
||||
GNOME needs components the Arch repositories do not package, currently
|
||||
`gnome-shell-extension-gsconnect` (D-121). The build never fetches them inside
|
||||
the layer composition:
|
||||
|
||||
1. `infrastructure/pipeline/build-gnome-extension.sh` builds the reviewed recipe
|
||||
`builder/packages/gsconnect/PKGBUILD` in an isolated root copied from the
|
||||
adapter tools, installs the declared dependencies from the same snapshot, and
|
||||
rejects an extension whose `metadata.json` does not declare the snapshot's
|
||||
`gnome-shell` major. The result is cached by recipe checksum.
|
||||
2. `release-cycle.py` passes the archive as `ARCHIPELAGO_GS_CONNECT_PACKAGE`;
|
||||
the Core package step admits only the exact `.PKGINFO` identity
|
||||
(`pkgname`, `pkgver`, `arch`) and signs it into the same local repository that
|
||||
carries `archipelago` and `plasma-setup`.
|
||||
3. The Purpose installs it by name like any repository package, so provenance,
|
||||
signatures and the package cache stay uniform.
|
||||
|
||||
An image whose Purpose lists such a package but whose cycle did not provide the
|
||||
archive fails at the `pacman -S` step instead of silently dropping the feature.
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ if [[ -n ${ARCHIPELAGO_PLASMA_SETUP_PACKAGE:-} ]]; then
|
|||
cp "$ARCHIPELAGO_PLASMA_SETUP_PACKAGE" "$work/plasma-setup.pkg.tar.zst"
|
||||
sha256sum "$work/plasma-setup.pkg.tar.zst" > "$work/plasma-setup-input.sha256"
|
||||
fi
|
||||
if [[ -n ${ARCHIPELAGO_GS_CONNECT_PACKAGE:-} ]]; then
|
||||
cp "$ARCHIPELAGO_GS_CONNECT_PACKAGE" "$work/gnome-extension.pkg.tar.zst"
|
||||
sha256sum "$work/gnome-extension.pkg.tar.zst" > "$work/gnome-extension-input.sha256"
|
||||
fi
|
||||
cat > "$work/image-size.py" <<'ARCHIPELAGO_IMAGE_SIZE'
|
||||
@@IMAGE_SIZE@@
|
||||
ARCHIPELAGO_IMAGE_SIZE
|
||||
|
|
|
|||
|
|
@ -30,7 +30,14 @@ test -f /job/core/usr/share/plymouth/themes/archipelago-bgrt/watermark.png
|
|||
! grep -q 'UseFirmwareBackground=true' /job/core/usr/share/plymouth/themes/archipelago-bgrt/archipelago-bgrt.plymouth
|
||||
cp /job/core/usr/share/archipelago/desktop/toolbox.conf /job/core/etc/containers/toolbox.conf
|
||||
install -Dm644 /job/core/usr/share/archipelago/desktop/toolbox-registries.conf /job/core/etc/containers/registries.conf.d/60-archipelago-toolbox.conf
|
||||
# D-121: the packaged extension must be present and enabled by default. A miss
|
||||
# here means the local repository lost the package, not a user-configuration gap.
|
||||
test -f /job/core/usr/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/metadata.json
|
||||
arch-chroot /job/core glib-compile-schemas /usr/share/glib-2.0/schemas
|
||||
# Read the compiled default instead of the override text: this fails when the
|
||||
# schema, the override or the compile step is wrong.
|
||||
arch-chroot /job/core env GSETTINGS_BACKEND=memory gsettings get org.gnome.shell enabled-extensions |
|
||||
grep -qx "\['gsconnect@andyholmes.github.io'\]"
|
||||
# The composer ignores GIO module caches as generated output; rebuild them
|
||||
# for the final module set instead of inheriting the Core cache.
|
||||
arch-chroot /job/core gio-querymodules /usr/lib/gio/modules
|
||||
|
|
|
|||
|
|
@ -130,3 +130,11 @@ enable switcheroo-control.service
|
|||
enable archipelago-gnome-onboarding.timer
|
||||
disable archipelago-flatpak-defaults.timer
|
||||
EOF
|
||||
# D-121: phone integration is part of the desktop, not an opt-in extra. A
|
||||
# GSettings override enables GSConnect for every user; a user-level dconf value
|
||||
# (Extensions app, `gnome-extensions disable`) still takes precedence.
|
||||
mkdir -p "$pkg/runtime/usr/share/glib-2.0/schemas"
|
||||
cat > "$pkg/runtime/usr/share/glib-2.0/schemas/60-archipelago-gnome.gschema.override" <<'OVERRIDE'
|
||||
[org.gnome.shell]
|
||||
enabled-extensions=['gsconnect@andyholmes.github.io']
|
||||
OVERRIDE
|
||||
|
|
|
|||
|
|
@ -273,18 +273,30 @@ chown -R package-builder:package-builder "$pkg"
|
|||
runuser -u package-builder -- env SOURCE_DATE_EPOCH=0 /bin/bash -ec 'cd /job/package; makepkg --noconfirm'
|
||||
mkdir -p /job/package-repo
|
||||
cp "$pkg"/archipelago-*.pkg.tar.zst /job/package-repo/
|
||||
if [[ -f /job/plasma-setup.pkg.tar.zst ]]; then
|
||||
bsdtar -xOf /job/plasma-setup.pkg.tar.zst .PKGINFO > /job/evidence/plasma-setup.PKGINFO
|
||||
grep -qx 'pkgname = plasma-setup' /job/evidence/plasma-setup.PKGINFO
|
||||
plasma_setup_version=$(sed -n 's/^pkgver = //p' /job/evidence/plasma-setup.PKGINFO)
|
||||
if [[ ! $plasma_setup_version =~ ^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$ ]]; then
|
||||
echo "Invalid plasma-setup pkgver: $plasma_setup_version" >&2
|
||||
# Packages Archipelago builds itself because the pinned mirror has no binary
|
||||
# package for them. Only the exact declared identity is admitted; the archive
|
||||
# joins the same signed local repository as the archipelago package (D-121).
|
||||
add_local_package() {
|
||||
local archive=$1 name=$2 arch=$3
|
||||
local metadata="/job/evidence/$name.PKGINFO" version
|
||||
bsdtar -xOf "$archive" .PKGINFO > "$metadata"
|
||||
grep -qx "pkgname = $name" "$metadata"
|
||||
version=$(sed -n 's/^pkgver = //p' "$metadata")
|
||||
if [[ ! $version =~ ^[0-9][0-9A-Za-z._+~-]*$ ]]; then
|
||||
echo "Invalid $name pkgver: $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -qx 'arch = x86_64' /job/evidence/plasma-setup.PKGINFO
|
||||
cp /job/plasma-setup.pkg.tar.zst "/job/package-repo/plasma-setup-$plasma_setup_version-x86_64.pkg.tar.zst"
|
||||
grep -qx "arch = $arch" "$metadata"
|
||||
cp "$archive" "/job/package-repo/$name-$version-$arch.pkg.tar.zst"
|
||||
}
|
||||
if [[ -f /job/plasma-setup.pkg.tar.zst ]]; then
|
||||
add_local_package /job/plasma-setup.pkg.tar.zst plasma-setup x86_64
|
||||
cp /job/plasma-setup-input.sha256 /job/evidence/
|
||||
fi
|
||||
if [[ -f /job/gnome-extension.pkg.tar.zst ]]; then
|
||||
add_local_package /job/gnome-extension.pkg.tar.zst gnome-shell-extension-gsconnect any
|
||||
cp /job/gnome-extension-input.sha256 /job/evidence/
|
||||
fi
|
||||
# Toolbx comes from the frozen Core package universe in the layered path, so no
|
||||
# probe package is injected here (see builder/LAYERED-GNOME.md).
|
||||
bsdtar -xOf /job/package-repo/archipelago-*.pkg.tar.zst .MTREE | gzip -d > /job/evidence/archipelago.mtree
|
||||
|
|
|
|||
27
packages/gsconnect/PKGBUILD
Normal file
27
packages/gsconnect/PKGBUILD
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Private Archipelago package: GSConnect is an extension, and Arch ships no
|
||||
# binary package for it. Built from the pinned upstream tag; the checksum is the
|
||||
# reviewed tarball, so a changed upstream archive fails the build instead of
|
||||
# silently producing a different image.
|
||||
pkgname=gnome-shell-extension-gsconnect
|
||||
pkgver=74
|
||||
pkgrel=1
|
||||
pkgdesc='KDE Connect implementation with GNOME Shell integration (Archipelago build)'
|
||||
arch=(any)
|
||||
url='https://github.com/GSConnect/gnome-shell-extension-gsconnect'
|
||||
license=(GPL-2.0-or-later MPL-2.0)
|
||||
depends=(gnome-shell)
|
||||
makedepends=(meson ninja gettext)
|
||||
source=("$url/archive/v$pkgver.tar.gz")
|
||||
sha256sums=('7eda214a9d48e3e8f674c4f37d551835d7c10f3695c5830294ff1562f4dbd184')
|
||||
|
||||
build() {
|
||||
# firewalld is not part of any Archipelago image; shipping its service file
|
||||
# would only describe a firewall this system does not run.
|
||||
meson setup build "$pkgname-$pkgver" --prefix=/usr --buildtype=plain \
|
||||
-Dinstalled_tests=false -Dfirewalld=false
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
DESTDIR="$pkgdir" meson install -C build
|
||||
}
|
||||
30
src/lib.rs
30
src/lib.rs
|
|
@ -226,7 +226,9 @@ mod tests {
|
|||
assert!(package.contains("/job/discover-version.txt"));
|
||||
assert!(!package.contains("discover 6.8."));
|
||||
let core_package = include_str!("../adapters/package.sh");
|
||||
assert!(core_package.contains("plasma_setup_version=$(sed -n"));
|
||||
// The version is read from the built archive, never hardcoded here.
|
||||
assert!(core_package.contains("add_local_package /job/plasma-setup.pkg.tar.zst plasma-setup x86_64"));
|
||||
assert!(core_package.contains("version=$(sed -n 's/^pkgver = //p' \"$metadata\")"));
|
||||
assert!(!core_package.contains("plasma-setup-6.8."));
|
||||
}
|
||||
|
||||
|
|
@ -346,4 +348,30 @@ mod tests {
|
|||
assert!(!core_tree.contains("kmsconvt@.service"),
|
||||
"the Core tree must not alias autovt@ to kmscon");
|
||||
}
|
||||
|
||||
/// D-121: both Desktops ship phone integration. KDE takes the repository
|
||||
/// package; GNOME builds the pinned extension because Arch ships none, and
|
||||
/// enables it through the compiled schema default rather than a user action.
|
||||
#[test]
|
||||
fn desktops_ship_phone_integration() {
|
||||
assert!(include_str!("../../purposes/proposals/kde.yaml")
|
||||
.contains("\n - name: kdeconnect\n"));
|
||||
assert!(include_str!("../../purposes/proposals/gnome.yaml")
|
||||
.contains("\n - name: gnome-shell-extension-gsconnect\n"));
|
||||
let iso = build_gnome_probe_script().unwrap();
|
||||
assert!(iso.contains("gnome-extension.pkg.tar.zst"));
|
||||
assert!(iso.contains("gnome-extension-input.sha256"));
|
||||
let package = include_str!("../adapters/package.sh");
|
||||
assert!(package.contains(
|
||||
"add_local_package /job/gnome-extension.pkg.tar.zst gnome-shell-extension-gsconnect any"));
|
||||
assert!(include_str!("../adapters/gnome-package.sh")
|
||||
.contains("enabled-extensions=['gsconnect@andyholmes.github.io']"));
|
||||
let finalize = include_str!("../adapters/gnome-finalize.sh");
|
||||
assert!(finalize.contains("share/gnome-shell/extensions/gsconnect@andyholmes.github.io/metadata.json"));
|
||||
assert!(finalize.contains("gsettings get org.gnome.shell enabled-extensions"));
|
||||
let recipe = include_str!("../packages/gsconnect/PKGBUILD");
|
||||
assert!(recipe.contains("pkgver=74"));
|
||||
assert!(recipe.contains("sha256sums=('"));
|
||||
assert!(recipe.contains("-Dfirewalld=false"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue