Compare commits

..
5 Commits
Author SHA1 Message Date
nvrl 6f100dbe5e chore(images) updated prompt image 2026-09-28 23:35:53 +02:00
nvrl 7c5ef269cd chore(release): 2.6.1 2026-09-28 23:35:14 +02:00
nvrl f13b6fc0ef feat(gui): add pdfs-prompt --preload for session autostart
--preload registers the resident GTK launcher and realizes its window
without showing it, so the first shortcut opens it as fast as later
ones. When a launcher is already running it exits without activating
it.

The application hold now happens in startup, which only the primary
instance runs. Taken before registration, it also kept every remote
invocation alive after it had forwarded its activation.
2026-09-28 23:35:14 +02:00
nvrl 3d61fc637b ci(release): reuse cached builds from main
The release job never hit a cache: its rust-cache key contained the job
name, tags cannot restore caches of earlier tags, and rpmbuild rebuilt
the whole workspace under its own compiler flags.

CI on main now saves shared debug and release caches that the release
workflow restores. Quality gates and the package build run in parallel,
and the GitHub release is created once both pass. The RPM spec skips
its cargo build when the caller passes --define "prebuilt 1".
2026-09-28 23:26:24 +02:00
Nils Pukropp 889b2aa4a9 chore(aur): update packages to 2.6.0 2026-09-28 21:22:30 +00:00
17 changed files with 229 additions and 51 deletions

No files matched your search

+40
View File
@@ -32,8 +32,14 @@ jobs:
with:
toolchain: '1.96'
components: rustfmt, clippy
cache: false
# Tags can only restore caches saved on main, so only main saves one. The
# release workflow restores this key for its quality gates.
- uses: swatinem/rust-cache@v2
with:
shared-key: debug
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Formatting
run: cargo fmt --all -- --check
@@ -57,3 +63,37 @@ jobs:
# Real Proton credentials and /dev/fuse deliberately do not run on pull
# requests. Follow docs/TESTING.md on a dedicated test-account runner.
# Keeps the release-profile dependencies cached on main, where the release
# workflow can restore them; a tag cannot reuse the caches of earlier tags.
release-cache:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install native dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libfuse3-dev \
libgtk-4-dev \
libadwaita-1-dev \
libwebkitgtk-6.0-dev \
libsecret-1-dev \
libdbus-1-dev
- name: Install minimum supported Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: '1.96'
cache: false
- uses: swatinem/rust-cache@v2
with:
shared-key: release
- name: Release build
run: cargo build --release --locked
+72 -21
View File
@@ -10,8 +10,60 @@ permissions:
contents: write
jobs:
checks:
name: Release quality gates
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libfuse3-dev \
libgtk-4-dev \
libadwaita-1-dev \
libwebkitgtk-6.0-dev \
libsecret-1-dev \
libdbus-1-dev
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: '1.96'
components: rustfmt, clippy
cache: false
# A tag can read the caches of main but its own caches are useless to the next
# tag, so this only restores what CI saved on main.
- name: Cache Cargo target
uses: swatinem/rust-cache@v2
with:
shared-key: debug
save-if: false
- name: Verify tag and manifest versions
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
tag_version="${GITHUB_REF_NAME#v}"
manifest_version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -n1)"
pkgbuild_version="$(sed -n 's/^pkgver=//p' packaging/PKGBUILD | head -n1)"
test "$tag_version" = "$manifest_version"
test "$tag_version" = "$pkgbuild_version"
- name: Release quality gates
run: |
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --locked
scripts/fuse-acceptance.sh --offline-only
build-release:
name: Build and Release
name: Build packages
runs-on: ubuntu-24.04
environment: 'rpm signing'
@@ -38,27 +90,14 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: '1.96'
components: rustfmt, clippy
cache: false
# Restores the release-profile dependencies that CI builds on main.
- name: Cache Cargo target
uses: swatinem/rust-cache@v2
- name: Verify tag and manifest versions
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
tag_version="${GITHUB_REF_NAME#v}"
manifest_version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -n1)"
pkgbuild_version="$(sed -n 's/^pkgver=//p' packaging/PKGBUILD | head -n1)"
test "$tag_version" = "$manifest_version"
test "$tag_version" = "$pkgbuild_version"
- name: Release quality gates
run: |
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace --locked
scripts/fuse-acceptance.sh --offline-only
with:
shared-key: release
save-if: false
- name: Build release binaries
run: |
@@ -152,6 +191,7 @@ jobs:
--define "_topdir $PWD/rpmbuild" \
--define "_sourcedir $PWD" \
--define "git_dir $PWD" \
--define "prebuilt 1" \
--define "version ${RPM_VERSION}" \
--define "_dbpath $PWD/rpmbuild/db" \
packaging/proton-drive-linux.spec
@@ -190,8 +230,19 @@ jobs:
*.rpm
if-no-files-found: error
publish:
name: Create GitHub Release
needs: [checks, build-release]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
steps:
- name: Download packages
uses: actions/download-artifact@v8
with:
name: proton-drive-linux-builds
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v3
with:
files: |
@@ -205,7 +256,7 @@ jobs:
aur:
name: Publish AUR packages
needs: build-release
needs: publish
if: startsWith(github.ref, 'refs/tags/')
uses: ./.github/workflows/aur.yml
with:
Generated
+4 -4
View File
@@ -3474,7 +3474,7 @@ checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4"
[[package]]
name = "pdfs-cli"
version = "2.6.0"
version = "2.6.1"
dependencies = [
"anyhow",
"clap",
@@ -3489,7 +3489,7 @@ dependencies = [
[[package]]
name = "pdfs-core"
version = "2.6.0"
version = "2.6.1"
dependencies = [
"async-trait",
"dbus-secret-service-keyring-store",
@@ -3513,7 +3513,7 @@ dependencies = [
[[package]]
name = "pdfs-fuse"
version = "2.6.0"
version = "2.6.1"
dependencies = [
"base64 0.23.1",
"fuser",
@@ -3533,7 +3533,7 @@ dependencies = [
[[package]]
name = "pdfs-gui"
version = "2.6.0"
version = "2.6.1"
dependencies = [
"anyhow",
"async-channel",
+1 -1
View File
@@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/pdfs-core", "crates/pdfs-fuse", "crates/pdfs-cli", "crates/pdfs-gui"]
[workspace.package]
version = "2.6.0"
version = "2.6.1"
edition = "2024"
license = "MIT"
authors = ["Nils Pukropp <contact@narl.io>"]
+6
View File
@@ -535,6 +535,12 @@ async fn mounted_target_within(mountpoint: PathBuf, hit: SearchHit) -> Option<Pa
}
impl Ui {
/// `--preload`: create the surface, renderer and style state now, without
/// mapping the window, so the first real summon only has to present it.
pub(crate) fn preload(&self) {
WidgetExt::realize(&self.window);
}
/// Reset and present the resident prompt in response to GApplication
/// activation. A second invocation while a file is materialising merely
/// raises the progress window; it must not make the in-flight open mutable.
+54 -2
View File
@@ -268,6 +268,9 @@ Options:
every keystroke — results appear as you type, unlike
--dmenu. Also settable as \"prompt\": { \"mode\": \"fzf\" }.
--gtk Force the built-in window, overriding that setting.
--preload Start the built-in window hidden and stay resident, so
the first summon opens at once. For session autostart;
does nothing if the prompt is already running.
--menu <COMMAND> Launcher command line for --dmenu, e.g.
--menu 'fuzzel --dmenu --width 60'. Overrides
\"prompt\": { \"menu\": [...] }.
@@ -293,6 +296,8 @@ struct Args {
feed: Option<Option<String>>,
/// `--inner`: we are the process a spawned terminal is running.
inner: bool,
/// `--preload`: become the resident GTK instance without showing it.
preload: bool,
}
fn parse_args(argv: impl Iterator<Item = String>) -> Result<Args, String> {
@@ -302,6 +307,7 @@ fn parse_args(argv: impl Iterator<Item = String>) -> Result<Args, String> {
query: None,
feed: None,
inner: false,
preload: false,
};
let mut argv = argv.peekable();
while let Some(arg) = argv.next() {
@@ -310,6 +316,7 @@ fn parse_args(argv: impl Iterator<Item = String>) -> Result<Args, String> {
"--fzf" => args.mode = Some(PromptMode::Fzf),
"--gtk" => args.mode = Some(PromptMode::Gtk),
"--inner" => args.inner = true,
"--preload" => args.preload = true,
// fzf passes an empty argument for an empty input, so a missing
// value here is that case rather than a user error.
"--feed" => args.feed = Some(argv.next().filter(|text| !text.trim().is_empty())),
@@ -337,6 +344,13 @@ fn parse_args(argv: impl Iterator<Item = String>) -> Result<Args, String> {
other => return Err(format!("unrecognised argument: {other}")),
}
}
// Only the GTK window has a resident process worth warming up.
if args.preload {
if matches!(args.mode, Some(PromptMode::Dmenu | PromptMode::Fzf)) || args.query.is_some() {
return Err("--preload only applies to the built-in window".to_string());
}
args.mode = Some(PromptMode::Gtk);
}
Ok(args)
}
@@ -398,9 +412,31 @@ fn main() -> glib::ExitCode {
// GtkApplication normally remains active while it owns a window, including
// when that window is hidden. Hold it explicitly as well: residency is a
// product requirement here, not an incidental window-lifetime side effect.
let _resident = app.hold();
app.connect_startup(|_| theme::load_resources("/de/nils/protondrivelinux/prompt.css"));
// Only the primary instance runs startup; a hold taken before registration
// would also keep every remote invocation alive after it has forwarded
// its activation.
let resident = Rc::new(RefCell::new(None));
app.connect_startup(move |app| {
*resident.borrow_mut() = Some(app.hold());
theme::load_resources("/de/nils/protondrivelinux/prompt.css");
});
if args.preload {
if let Err(e) = app.register(gtk4::gio::Cancellable::NONE) {
eprintln!("pdfs-prompt: {e}");
return glib::ExitCode::FAILURE;
}
// Another instance is already resident; activating it would show it.
// Dropping a registered application that never ran makes GIO warn
// about the D-Bus registration, so leave it to process exit.
if app.is_remote() {
std::mem::forget(app);
return glib::ExitCode::SUCCESS;
}
}
let prompt: Rc<RefCell<Option<Rc<hud::Ui>>>> = Rc::new(RefCell::new(None));
// The first activation of a preloading instance is its own startup, not a
// summon: build the window but leave it hidden.
let quiet = std::cell::Cell::new(args.preload);
app.connect_activate(move |app| {
let ui = if let Some(ui) = prompt.borrow().clone() {
ui
@@ -411,6 +447,10 @@ fn main() -> glib::ExitCode {
*prompt.borrow_mut() = Some(ui.clone());
ui
};
if quiet.replace(false) {
ui.preload();
return;
}
ui.activate();
});
// GTK must not try to parse our own flags; they were consumed above.
@@ -582,4 +622,16 @@ mod tests {
let args = parse(&["--dmenu", "--query", "tax return 2024"]).unwrap();
assert_eq!(args.query.as_deref(), Some("tax return 2024"));
}
#[test]
fn preload_forces_the_gtk_window_and_rejects_the_launchers() {
let args = parse(&["--preload"]).unwrap();
assert!(args.preload);
assert_eq!(args.mode, Some(PromptMode::Gtk));
assert!(parse(&["--preload", "--dmenu"]).is_err());
assert!(parse(&["--fzf", "--preload"]).is_err());
assert!(parse(&["--preload", "--menu", "fuzzel --dmenu"]).is_err());
assert!(parse(&["--preload", "--query", "tax"]).is_err());
}
}
+14
View File
@@ -11,6 +11,19 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
## [Unreleased]
## [2.6.1] — 2026-09-28
Schema: **35** (unchanged).
### Added
- **`pdfs-prompt --preload`.** Starts the launcher hidden, for session autostart such as
Hyprland's `exec-once`, so the first shortcut opens it as fast as later ones. It does nothing
when the launcher is already running.
### Fixed
- **Launcher invocations no longer pile up.** Each shortcut press after the first used to leave
a `pdfs-prompt` process behind after handing the request to the running launcher. It now exits.
## [2.6.0] — 2026-09-28
The search launcher (`pdfs-prompt`) is rebuilt around a preview pane, and it now looks like the
@@ -1226,6 +1239,7 @@ First stable release: FUSE files-on-demand mount, sync daemon under `proton-driv
- The outstanding FUSE defects tracked in `docs/BUGS.md`, plus a truncate defect, validated
by a new POSIX compliance suite for the filesystem.
[2.6.1]: https://github.com/narrrl/proton-drive-linux/releases/tag/v2.6.1
[2.6.0]: https://github.com/narrrl/proton-drive-linux/releases/tag/v2.6.0
[2.5.0]: https://github.com/narrrl/proton-drive-linux/releases/tag/v2.5.0
[2.4.0]: https://github.com/narrrl/proton-drive-linux/releases/tag/v2.4.0
+9
View File
@@ -235,6 +235,15 @@ The window stays loaded after the first use, so later shortcuts open it instantl
and video open straight from the Proton Drive folder, so players can start before the whole file
downloads. Other Drive files download first, then open.
To make the first shortcut instant as well, start the launcher hidden with your session.
`pdfs-prompt --preload` loads the window without showing it and does nothing if the launcher is
already running. For Hyprland:
```ini
exec-once = pdfs-prompt --preload
bind = SUPER, space, exec, pdfs-prompt
```
### Using your own launcher
`pdfs-prompt --dmenu` shows the results in fuzzel, rofi, wofi, tofi, bemenu or dmenu, whichever is
Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 114 KiB

+1 -1
View File
@@ -9,7 +9,7 @@
# Build + install: cd packaging && makepkg -fi
pkgname=proton-drive-linux
pkgver=2.6.0
pkgver=2.6.1
pkgrel=1
pkgdesc="Unofficial Proton Drive client for Linux: files-on-demand FUSE mount, CLI, GTK4 app + tray"
arch=('x86_64')
@@ -1,6 +1,6 @@
pkgbase = proton-drive-for-linux-bin
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)
pkgver = 2.5.0
pkgver = 2.6.0
pkgrel = 1
url = https://github.com/narrrl/proton-drive-linux
arch = x86_64
@@ -21,21 +21,21 @@ pkgbase = proton-drive-for-linux-bin
optdepends = xdg-utils: "Open folder" action in the tray menu
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
provides = proton-drive-for-linux=2.5.0
provides = proton-drive-linux=2.5.0
provides = proton-drive-for-linux=2.6.0
provides = proton-drive-linux=2.6.0
provides = pdfs
conflicts = proton-drive-linux
conflicts = proton-drive-for-linux
conflicts = proton-drive-for-linux-git
options = !strip
options = !debug
source = proton-drive-linux-2.5.0-x86_64.tar.gz::https://github.com/narrrl/proton-drive-linux/releases/download/v2.5.0/proton-drive-linux-2.5.0-x86_64.tar.gz
source = io.narl.proton-drive-linux.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.5.0/packaging/io.narl.proton-drive-linux.desktop
source = io.narl.proton-drive-linux-tray.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.5.0/packaging/io.narl.proton-drive-linux-tray.desktop
source = io.narl.proton-drive-linux.svg::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.5.0/packaging/io.narl.proton-drive-linux.svg
source = proton-drive.service::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.5.0/packaging/proton-drive.service
source = LICENSE-2.5.0::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.5.0/LICENSE
sha256sums = 44ee9549dc14260de7e882f810911b253aaf5c83dc70537c0aeeae3769d30ce9
source = proton-drive-linux-2.6.0-x86_64.tar.gz::https://github.com/narrrl/proton-drive-linux/releases/download/v2.6.0/proton-drive-linux-2.6.0-x86_64.tar.gz
source = io.narl.proton-drive-linux.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.6.0/packaging/io.narl.proton-drive-linux.desktop
source = io.narl.proton-drive-linux-tray.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.6.0/packaging/io.narl.proton-drive-linux-tray.desktop
source = io.narl.proton-drive-linux.svg::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.6.0/packaging/io.narl.proton-drive-linux.svg
source = proton-drive.service::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.6.0/packaging/proton-drive.service
source = LICENSE-2.6.0::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v2.6.0/LICENSE
sha256sums = 63893c2f9af8d660151a8687d15472602c76e5dd3cca7547999cd0fc0a833a4d
sha256sums = d190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123
sha256sums = 1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0
sha256sums = e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828
@@ -1,7 +1,7 @@
# Maintainer: Nils Pukropp <contact@narl.io>
pkgname=proton-drive-for-linux-bin
pkgver=2.5.0
pkgver=2.6.0
pkgrel=1
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)"
arch=('x86_64')
@@ -31,7 +31,7 @@ source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$url/releases/download/$_tag/
"io.narl.proton-drive-linux.svg::$_raw/packaging/io.narl.proton-drive-linux.svg"
"proton-drive.service::$_raw/packaging/proton-drive.service"
"LICENSE-$pkgver::$_raw/LICENSE")
sha256sums=('44ee9549dc14260de7e882f810911b253aaf5c83dc70537c0aeeae3769d30ce9'
sha256sums=('63893c2f9af8d660151a8687d15472602c76e5dd3cca7547999cd0fc0a833a4d'
'd190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123'
'1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0'
'e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828'
@@ -1,6 +1,6 @@
pkgbase = proton-drive-for-linux-git
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)
pkgver = 2.5.0.r0.g61266fc
pkgver = 2.6.0.r0.g8bd3867
pkgrel = 1
url = https://github.com/narrrl/proton-drive-linux
arch = x86_64
@@ -24,8 +24,8 @@ pkgbase = proton-drive-for-linux-git
optdepends = xdg-utils: "Open folder" action in the tray menu
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
provides = proton-drive-for-linux=2.5.0.r0.g61266fc
provides = proton-drive-linux=2.5.0.r0.g61266fc
provides = proton-drive-for-linux=2.6.0.r0.g8bd3867
provides = proton-drive-linux=2.6.0.r0.g8bd3867
provides = pdfs
conflicts = proton-drive-linux
conflicts = proton-drive-for-linux
@@ -1,7 +1,7 @@
# Maintainer: Nils Pukropp <contact@narl.io>
pkgname=proton-drive-for-linux-git
pkgver=2.5.0.r0.g61266fc
pkgver=2.6.0.r0.g8bd3867
pkgrel=1
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)"
arch=('x86_64')
@@ -1,6 +1,6 @@
pkgbase = proton-drive-for-linux
pkgdesc = Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray
pkgver = 2.5.0
pkgver = 2.6.0
pkgrel = 1
url = https://github.com/narrrl/proton-drive-linux
arch = x86_64
@@ -23,13 +23,13 @@ pkgbase = proton-drive-for-linux
optdepends = xdg-utils: "Open folder" action in the tray menu
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
provides = proton-drive-linux=2.5.0
provides = proton-drive-linux=2.6.0
provides = pdfs
conflicts = proton-drive-linux
conflicts = proton-drive-for-linux-bin
conflicts = proton-drive-for-linux-git
options = !lto
source = proton-drive-for-linux-2.5.0.tar.gz::https://github.com/narrrl/proton-drive-linux/archive/refs/tags/v2.5.0.tar.gz
sha256sums = 2872352325204a9d9af31c12e7a793f4546ea0e5426dfb7b4f14a2b17af7c773
source = proton-drive-for-linux-2.6.0.tar.gz::https://github.com/narrrl/proton-drive-linux/archive/refs/tags/v2.6.0.tar.gz
sha256sums = 6bc29064c23d9cd23158a675a848335a4ec5220c34fdb2b4c8f3d21061f0b516
pkgname = proton-drive-for-linux
@@ -1,7 +1,7 @@
# Maintainer: Nils Pukropp <contact@narl.io>
pkgname=proton-drive-for-linux
pkgver=2.5.0
pkgver=2.6.0
pkgrel=1
pkgdesc="Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray"
arch=('x86_64')
@@ -23,7 +23,7 @@ conflicts=('proton-drive-linux' 'proton-drive-for-linux-bin' 'proton-drive-for-l
# LTO has broken GTK/Rust links for this workspace; the release profile keeps it off.
options=('!lto')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('2872352325204a9d9af31c12e7a793f4546ea0e5426dfb7b4f14a2b17af7c773')
sha256sums=('6bc29064c23d9cd23158a675a848335a4ec5220c34fdb2b4c8f3d21061f0b516')
_srcname="proton-drive-linux-$pkgver"
+6
View File
@@ -60,12 +60,18 @@ test -n "%{?git_dir}" || (echo 'Pass --define "git_dir $PWD" from the repo root'
test -f %{git_dir}/Cargo.toml
cp -a %{git_dir}/LICENSE .
%build
# The release workflow has already built target/release and passes --define "prebuilt 1".
# rpmbuild exports its own compiler flags, which would make cargo rebuild everything.
%if 0%{?prebuilt}
test -x %{git_dir}/target/release/pdfs
%else
cd %{git_dir}
cargo build --release --locked \
--bin pdfs \
--bin pdfs-tray \
--bin pdfs-app \
--bin pdfs-prompt
%endif
%install
rel=%{git_dir}/target/release