Upstream 4.0 replaced python-webuntis with pyotp for authentication and unconditionally imports libsecret (credential storage) and WebKitGTK 6.0 at startup. Add python-pyotp, libsecret and webkitgtk-6.0 to depends. Stop bundling the webuntis wheel from the next artifact build on; the existing 4.0 artifact is reused as-is (its bundled copy is unused and inert).
45 lines
1.7 KiB
Bash
45 lines
1.7 KiB
Bash
# timetable-bin - prebuilt package of https://codeberg.org/ostfriese4/untis
|
|
# ("Timetable", a GTK4 + LibAdwaita WebUntis client written in Python).
|
|
#
|
|
# Upstream publishes no binary release assets, so build_artifact() builds the
|
|
# app from the release tarball and the resulting install tree is published as
|
|
# a GitHub release asset of this repository, which the PKGBUILD then uses.
|
|
|
|
UPSTREAM_REPO="ostfriese4/untis"
|
|
|
|
# Installed in CI (pacman) before build_artifact runs.
|
|
BUILD_DEPS=(meson ninja glib2 glib2-devel gtk4 libadwaita python python-gobject gettext)
|
|
|
|
latest_version() {
|
|
curl -sf "https://codeberg.org/api/v1/repos/$UPSTREAM_REPO/releases/latest" \
|
|
| jq -r '.tag_name' | sed 's/^v//'
|
|
}
|
|
|
|
# build_artifact <version> <output-file>
|
|
build_artifact() {
|
|
local ver="$1" outfile="$2"
|
|
local workdir destdir
|
|
workdir="$(mktemp -d)"
|
|
destdir="$(mktemp -d)"
|
|
|
|
curl -sfL "https://codeberg.org/$UPSTREAM_REPO/archive/v$ver.tar.gz" | tar -xz -C "$workdir"
|
|
|
|
# Upstream does not maintain the version in meson.build; use the release tag
|
|
# so the About dialog shows the right version.
|
|
sed -i "0,/version:/s/version: *'[^']*'/version: '$ver'/" "$workdir/untis/meson.build"
|
|
|
|
meson setup "$workdir/build" "$workdir/untis" --prefix=/usr --buildtype=release
|
|
meson install -C "$workdir/build" --destdir "$destdir"
|
|
|
|
# These caches are generated by pacman hooks; shipping them would cause
|
|
# file conflicts on install.
|
|
rm -f "$destdir/usr/share/glib-2.0/schemas/gschemas.compiled" \
|
|
"$destdir/usr/share/applications/mimeinfo.cache" \
|
|
"$destdir/usr/share/icons/hicolor/icon-theme.cache"
|
|
|
|
tar --zstd --sort=name --owner=0 --group=0 --numeric-owner --mtime='@0' \
|
|
-cf "$outfile" -C "$destdir" usr
|
|
|
|
rm -rf "$workdir" "$destdir"
|
|
}
|