Files
proton-drive-linux/packaging/PKGBUILD
T
nvrl 9fa88ff397 feat(core,cli,gui): support two-password accounts without storing the mailbox password
A two-password account signed in with its login password as the mailbox
password, so the key chain never unlocked and the daemon retried forever.

Login now asks for the mailbox password and checks it against the account
(proton-sdk 0.8 `unlock`), so a typo is a retry. The password is never
stored: the keyring blob keeps the per-key passphrases instead, and for a
two-password account only when the user opts in (`--remember`, or the
"Keep unlocked on this computer" switch). By default they live in the
kernel keyring for the login session and the account is locked after a
reboot until `pdfs unlock` or the app supplies them again.

- core: kernelkey module, Error::Locked / WrongMailboxPassword, unlock,
  lock, key_state, ready; blobs written by 3.0.x are migrated on first
  start; token refresh updates only the tokens in the stored blob
- cli: `pdfs unlock [--remember]`, `pdfs lock [--forget]`; status and
  diagnose report the key state; the daemon waits while locked and is
  marked non-dumpable
- gui: mailbox password dialog at sign-in and on open, locked tray state
- po: all catalogs translated
- bump to 3.1.0, depend on proton-sdk and proton-drive-rs 0.8.0

Refs #26.
2026-10-07 08:17:50 +02:00

83 lines
3.1 KiB
Bash

# Maintainer: Nils Pukropp <contact@narl.io>
#
# Local-build PKGBUILD. Builds the proton-drive-linux workspace from the
# checkout this file lives in: this is NOT a source-fetch package, it compiles
# the working tree in place. The Proton SDK is unpublished and comes from its
# GitHub repo (pinned by Cargo.lock), so the build needs network access — no
# sibling checkout required any more.
#
# Build + install: cd packaging && makepkg -fi
pkgname=proton-drive-linux
pkgver=3.1.0
pkgrel=1
pkgdesc="Unofficial Proton Drive client for Linux: files-on-demand FUSE mount, CLI, GTK4 app + tray"
arch=('x86_64')
url="https://proton-drive.narl.io"
license=('MIT')
depends=('fuse3' 'gtk4' 'libadwaita' 'webkitgtk-6.0' 'perl-image-exiftool')
makedepends=('cargo' 'git' 'gettext')
provides=('pdfs')
# Files-on-demand mount + keyring need these at runtime.
optdepends=('gnome-keyring: credential storage via Secret Service'
'ffmpeg: video thumbnails'
'iso-codes: country names in your language under Places'
'xdg-utils: "Open folder" action from the tray'
'fzf: live search-as-you-type launcher (pdfs-prompt --fzf)'
'foot: terminal for pdfs-prompt --fzf started from a keybinding')
options=('!lto' '!debug')
# Built in place from the checkout; nothing to fetch or checksum.
source=()
sha256sums=()
# Absolute path to the workspace root (packaging/ lives directly under it).
_workspace="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
pkgver() {
cd "$_workspace"
local v
v=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
printf '%s' "${v:-0.1.0}"
}
build() {
cd "$_workspace"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR="$_workspace/target"
# `--locked` not `--frozen`: the lock is authoritative, but cargo must still be
# allowed to fetch the git-sourced SDK.
cargo build --release --locked \
--bin pdfs \
--bin pdfs-tray \
--bin pdfs-app \
--bin pdfs-prompt
}
package() {
cd "$_workspace"
local rel="target/release"
install -Dm755 "$rel/pdfs" "$pkgdir/usr/bin/pdfs"
install -Dm755 "$rel/pdfs-tray" "$pkgdir/usr/bin/pdfs-tray"
install -Dm755 "$rel/pdfs-app" "$pkgdir/usr/bin/pdfs-app"
install -Dm755 "$rel/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 service that runs the auto-mount daemon. Enabled per-user by
# the GUI on login (`systemctl --user enable --now proton-drive.service`).
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"
install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}