Files
proton-drive-linux/packaging/aur/proton-drive-for-linux-git/PKGBUILD
T
nvrl f25c2459a0 feat(cli,core): shell completions with live values from the service
`pdfs completions <shell>` prints a completion script for bash, zsh, fish,
elvish or PowerShell, built on clap_complete's dynamic engine: on Tab the
shell calls `pdfs` back, which completes commands and options and also the
values the running service knows, each with a description: paths in My
files, synced-folder and queue ids, computers, trash, albums, items shared
with me, invitations, bookmarks, conflict copies, and a file's versions or
a share's members and public link once its path is typed.

A completer that gets no answer from the service within two seconds offers
nothing rather than hanging the prompt. Listings that ask Proton are kept
for 30 s in $XDG_RUNTIME_DIR (0600), so repeated Tabs do not wait again.
Completion is triggered by PDFS_COMPLETE rather than clap's generic
COMPLETE, because the same binary runs the daemon.

Share roles are now checked by the CLI before the request. The package
recipes install the bash, zsh and fish scripts via packaging/completions.sh.
2026-11-12 11:43:53 +01:00

93 lines
3.5 KiB
Bash

# Maintainer: Nils Pukropp <contact@narl.io>
pkgname=proton-drive-for-linux-git
pkgver=3.7.0.r0.g7ab14bb
pkgrel=1
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)"
arch=('x86_64')
url="https://proton-drive.narl.io"
_repo="https://github.com/narrrl/proton-drive-linux"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'dbus' 'gcc-libs' 'glibc'
'hicolor-icon-theme')
makedepends=('cargo' 'git' 'gettext')
optdepends=('perl-image-exiftool: thumbnails for camera RAW files'
'ffmpeg: video thumbnails'
'iso-codes: country names in your language under Places'
'gnome-keyring: credential storage over the Secret Service API'
'kwallet: credential storage over the Secret Service API'
'xdg-utils: "Open folder" action in the tray menu'
'fzf: search-as-you-type launcher (pdfs-prompt --fzf)'
'foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding')
provides=("${pkgname%-git}=$pkgver" "proton-drive-linux=$pkgver" 'pdfs')
conflicts=('proton-drive-linux' 'proton-drive-for-linux' 'proton-drive-for-linux-bin')
# LTO has broken GTK/Rust links for this workspace; the release profile keeps it off.
options=('!lto')
# Stops the running daemon before removal, so the mount stops mirroring deletes.
install=proton-drive.install
source=("$pkgname::git+$_repo.git")
sha256sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --long --abbrev=7 --tags 2>/dev/null |
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
printf '0.0.0.r%s.g%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
prepare() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release \
--bin pdfs \
--bin pdfs-tray \
--bin pdfs-app \
--bin pdfs-prompt
}
check() {
cd "$pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo test --frozen --workspace
}
package() {
cd "$pkgname"
install -Dm755 target/release/pdfs "$pkgdir/usr/bin/pdfs"
install -Dm755 target/release/pdfs-tray "$pkgdir/usr/bin/pdfs-tray"
install -Dm755 target/release/pdfs-app "$pkgdir/usr/bin/pdfs-app"
install -Dm755 target/release/pdfs-prompt "$pkgdir/usr/bin/pdfs-prompt"
install -Dm644 packaging/io.narl.proton-drive-linux.desktop \
"$pkgdir/usr/share/applications/io.narl.proton-drive-linux.desktop"
install -Dm644 packaging/io.narl.proton-drive-linux-tray.desktop \
"$pkgdir/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
install -Dm644 packaging/io.narl.proton-drive-linux.svg \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
# systemd user unit for the auto-mount daemon; enabled per user, not by pacman.
install -Dm644 packaging/proton-drive.service \
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
# Translations: compiled from po/ into /usr/share/locale.
po/build.sh "$pkgdir/usr/share/locale"
# Shell completion for bash, zsh and fish.
packaging/completions.sh target/release/pdfs "$pkgdir/usr/share"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
# pacman brings new releases, so the app never checks for them itself.
install -Dm644 /dev/null "$pkgdir/usr/share/proton-drive-linux/managed-updates"
}