gearlever-bin, bottles-bin: bundle AUR-only dependencies
gearlever-bin: ship ftputil + desktop-entry-lib inside /usr/share/gearlever (pinned via upstream requirements.txt) instead of depending on the AUR packages. bottles-bin: build the fvs2 CLI (with its core library) from source and bundle it under /usr/lib/bottles (Bottles patched to use that path), and ship patool, pathvalidate and vkbasalt-cli in /usr/share/bottles. vkbasalt becomes an optdepend. Installing either package now needs no AUR builds.
This commit is contained in:
1 parent
4c008fd3e4
commit
8c0d79f9c0
5 files changed
+53
-15
No files matched your search
+33
-1
@@ -9,12 +9,18 @@
|
||||
|
||||
UPSTREAM_REPO="bottlesdevs/Bottles"
|
||||
|
||||
# fvs-lab/fvs2 (+ its core library) is AUR-only, so the binary is built here
|
||||
# and bundled under /usr/lib/bottles. Versions pinned to the combination the
|
||||
# AUR fvs2 package ships; bump on new fvs2 releases.
|
||||
FVS2_VERSION=0.8.1
|
||||
FVS2_CORE_VERSION=0.1.1
|
||||
|
||||
# Installed in CI (pacman) before build_artifact runs. blueprint-compiler
|
||||
# resolves Gtk/Adw/GtkSource imports via their typelibs, hence the GUI libs.
|
||||
BUILD_DEPS=(meson ninja blueprint-compiler gobject-introspection
|
||||
desktop-file-utils appstream-glib gettext glib2-devel
|
||||
python python-gobject gtk4 libadwaita gtksourceview5
|
||||
libportal-gtk4)
|
||||
libportal-gtk4 go python-pip)
|
||||
|
||||
latest_version() {
|
||||
gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//'
|
||||
@@ -33,9 +39,35 @@ build_artifact() {
|
||||
|
||||
patch -d "$srctree" -p1 < "$pkgdir/remove-flatpak-checks.patch"
|
||||
|
||||
# the bundled fvs2 lives outside $PATH; point Bottles at it
|
||||
grep -q 'return "fvs2"' "$srctree/bottles/fvs/repo.py" \
|
||||
|| { echo "fvs2 path hook not found in bottles/fvs/repo.py" >&2; return 1; }
|
||||
sed -i 's|return "fvs2"|return "/usr/lib/bottles/fvs2"|' "$srctree/bottles/fvs/repo.py"
|
||||
|
||||
meson setup "$workdir/build" "$srctree" --prefix=/usr --buildtype=release
|
||||
meson install -C "$workdir/build" --destdir "$destdir"
|
||||
|
||||
# Build the fvs2 CLI (Go) and bundle it. Its "core" library is a sibling
|
||||
# repository that go.mod expects next to the source tree.
|
||||
mkdir -p "$workdir/fvs" "$destdir/usr/lib/bottles"
|
||||
curl -sfL "https://github.com/fvs-lab/fvs2/archive/refs/tags/v$FVS2_VERSION.tar.gz" | tar -xz -C "$workdir/fvs"
|
||||
curl -sfL "https://github.com/fvs-lab/core/archive/refs/tags/v$FVS2_CORE_VERSION.tar.gz" | tar -xz -C "$workdir/fvs"
|
||||
ln -s "core-$FVS2_CORE_VERSION" "$workdir/fvs/core"
|
||||
(cd "$workdir/fvs/fvs2-$FVS2_VERSION" && \
|
||||
GOPATH="$workdir/gopath" \
|
||||
GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" \
|
||||
go build -o "$destdir/usr/lib/bottles/fvs2" ./cmd/fvs2)
|
||||
|
||||
# patool, pathvalidate and vkbasalt-cli are AUR-only pure-python libs;
|
||||
# bundle them into the app's module dir, which the launcher puts on
|
||||
# sys.path. patool/pathvalidate pinned via upstream's requirements.txt.
|
||||
grep -E '^(patool|pathvalidate)==' "$srctree/requirements.txt" > "$workdir/bundle-reqs.txt"
|
||||
[[ "$(wc -l < "$workdir/bundle-reqs.txt")" -eq 2 ]] || { echo "expected patool+pathvalidate pins in requirements.txt" >&2; return 1; }
|
||||
echo 'vkbasalt-cli' >> "$workdir/bundle-reqs.txt"
|
||||
python -m pip install --isolated --no-deps --target "$destdir/usr/share/bottles" \
|
||||
-r "$workdir/bundle-reqs.txt"
|
||||
rm -rf "$destdir/usr/share/bottles/bin"
|
||||
|
||||
# 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" \
|
||||
|
||||
Reference in new issue
Block a user