# bottles-bin - prebuilt package of https://github.com/bottlesdevs/Bottles # (GTK4 + LibAdwaita wine/proton prefix manager written in Python). # # Upstream only supports Flatpak officially and publishes no usable binary # assets, so build_artifact() builds from the release tarball, carrying the # same de-flatpak patch the AUR source package uses (upstream's meson refuses # to configure outside a Flatpak sandbox and the code hard-requires the # portal). UPSTREAM_REPO="bottlesdevs/Bottles" # 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) latest_version() { gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' } # build_artifact build_artifact() { local ver="$1" outfile="$2" local pkgdir workdir destdir srctree pkgdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" workdir="$(mktemp -d)" destdir="$(mktemp -d)" curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/$ver.tar.gz" | tar -xz -C "$workdir" srctree="$workdir/Bottles-$ver" patch -d "$srctree" -p1 < "$pkgdir/remove-flatpak-checks.patch" meson setup "$workdir/build" "$srctree" --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" }