diff --git a/README.md b/README.md index 470acb7..6f13aa3 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | Package | Upstream | Upstream deliverable | AUR | |---|---|---|---| +| `bottles-opener` | [Felitendo/bottles-opener](https://github.com/Felitendo/bottles-opener) — double-click a file and it opens in its Windows program inside Bottles, with the file types and icons from the bottle's registry | *built from source* | [bottles-opener](https://aur.archlinux.org/packages/bottles-opener) | | `bt-volume-step` | [Felitendo/bt-volume-step](https://github.com/Felitendo/bt-volume-step) — corrects the coarse internal volume grid of Bluetooth audio devices on PipeWire | *built from source* | [bt-volume-step](https://aur.archlinux.org/packages/bt-volume-step) | | `cachy-auto-update` | [Felitendo/cachy-auto-update](https://github.com/Felitendo/cachy-auto-update) — unattended background updates for CachyOS (pacman, AUR, Flatpak, AppImages) | *built from source* | [cachy-auto-update](https://aur.archlinux.org/packages/cachy-auto-update) | | `chiaki-ng-bin` | [streetpea/chiaki-ng](https://github.com/streetpea/chiaki-ng) — PlayStation Remote Play client (Qt6) | AppImage | [chiaki-ng-bin](https://aur.archlinux.org/packages/chiaki-ng-bin) | diff --git a/bottles-opener/.SRCINFO b/bottles-opener/.SRCINFO new file mode 100644 index 0000000..2e2c52f --- /dev/null +++ b/bottles-opener/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = bottles-opener + pkgdesc = Double-click a file and it opens in its Windows program, inside its Bottles bottle + pkgver = 0.1.0 + pkgrel = 1 + url = https://github.com/Felitendo/bottles-opener + install = bottles-opener.install + arch = any + license = GPL-3.0-or-later + makedepends = gettext + makedepends = scdoc + depends = bash + depends = coreutils + depends = gawk + depends = grep + depends = sed + depends = gettext + depends = shared-mime-info + depends = systemd + optdepends = bottles: Bottles itself (the Flatpak works too) + optdepends = python-yaml: read bottles without starting the Bottles Flatpak + optdepends = icoextract: extract file icons without starting the Bottles Flatpak + optdepends = libnotify: report files that could not be opened + optdepends = desktop-file-utils: refresh the desktop database after a change + optdepends = flatpak: open files with the Bottles Flatpak + source = bottles-opener-0.1.0.tar.gz::https://github.com/Felitendo/bottles-opener/archive/refs/tags/v0.1.0.tar.gz + sha256sums = 4120340cacb141feb4cbbd16475a894873bfff3f4b9ba969614918b68ae5ab6c + +pkgname = bottles-opener diff --git a/bottles-opener/PKGBUILD b/bottles-opener/PKGBUILD new file mode 100644 index 0000000..33cce40 --- /dev/null +++ b/bottles-opener/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=bottles-opener +pkgver=0.1.0 +pkgrel=1 +pkgdesc="Double-click a file and it opens in its Windows program, inside its Bottles bottle" +arch=('any') +url="https://github.com/Felitendo/bottles-opener" +license=('GPL-3.0-or-later') +depends=('bash' 'coreutils' 'gawk' 'grep' 'sed' 'gettext' 'shared-mime-info' 'systemd') +makedepends=('gettext' 'scdoc') +optdepends=('bottles: Bottles itself (the Flatpak works too)' + 'python-yaml: read bottles without starting the Bottles Flatpak' + 'icoextract: extract file icons without starting the Bottles Flatpak' + 'libnotify: report files that could not be opened' + 'desktop-file-utils: refresh the desktop database after a change' + 'flatpak: open files with the Bottles Flatpak') +install="${pkgname}.install" +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=('4120340cacb141feb4cbbd16475a894873bfff3f4b9ba969614918b68ae5ab6c') + +build() { + # pass the version being packaged so `bottles-opener --version` cannot drift + # away from pkgver + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" +} + +package() { + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" DESTDIR="$pkgdir" install +} diff --git a/bottles-opener/bottles-opener.install b/bottles-opener/bottles-opener.install new file mode 100644 index 0000000..9ce421e --- /dev/null +++ b/bottles-opener/bottles-opener.install @@ -0,0 +1,28 @@ +post_install() { + cat <<'MSG' + + bottles-opener is installed but not active yet. + + bottles-opener interactive menu + bottles-opener enable set up file opening for your bottles + + Run it as your own user, not with sudo: it only ever writes inside your own + home directory. + +MSG +} + +pre_remove() { + # The changes live in each user's home and cannot be undone from a root-run + # hook, so say so while the command that does it still exists. + cat <<'MSG' + + Before removing this package, run + + bottles-opener disable + + as each user that enabled it. That removes the file types, launchers and + icons it added and puts back the previous default applications. + +MSG +} diff --git a/bottles-opener/pkg.sh b/bottles-opener/pkg.sh new file mode 100644 index 0000000..ef0bf1d --- /dev/null +++ b/bottles-opener/pkg.sh @@ -0,0 +1,25 @@ +# bottles-opener - opens files in their Windows program inside Bottles +# (https://github.com/Felitendo/bottles-opener). +# +# Shell and two small Python scripts, a gettext catalog and a scdoc man page: +# the PKGBUILD runs the upstream Makefile against the release tarball. + +UPSTREAM_REPO="Felitendo/bottles-opener" + +# Installed in CI (pacman) before the makepkg test build. +BUILD_DEPS=(gettext scdoc) + +latest_version() { + gh api "repos/$UPSTREAM_REPO/releases/latest" --jq '.tag_name' | sed 's/^v//' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha + + sha="$(curl -sfL "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + + sed -i "s|^sha256sums=.*|sha256sums=('$sha')|" "$pkgbuild" +}