mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-25 02:33:32 +01:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c70995eb7 | ||
|
|
28daffa2b3 | ||
|
|
eb60c8a95b | ||
|
|
73e2d1ec53 |
No files matched your search
@@ -77,7 +77,7 @@ scriptable CLI.
|
||||
| Arch Linux | [`proton-drive-for-linux`](https://aur.archlinux.org/packages/proton-drive-for-linux) (also `-bin` and `-git`) in the AUR |
|
||||
| Debian, Ubuntu 24.04 or newer | `.deb` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest) |
|
||||
| NixOS | The flake in this repository: see [Installation → NixOS](docs/INSTALL.md#nixos-flake) |
|
||||
| Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin) | The COPR repository, layered with `rpm-ostree`: see [Installation → Fedora Atomic](docs/INSTALL.md#fedora-atomic-silverblue-kinoite-bazzite-bluefin) |
|
||||
| Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin) | A home-directory tarball or a COPR package layered with `rpm-ostree`. See [Installation → Fedora Atomic](docs/INSTALL.md#fedora-atomic-silverblue-kinoite-bazzite-bluefin) |
|
||||
| Anything else, immutable ones included | `.tar.gz` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest), installed into your home folder by its `install.sh`: see [Installation → Other distributions](docs/INSTALL.md#other-distributions), or [build from source](docs/INSTALL.md#build-from-source) |
|
||||
|
||||
**Fedora**
|
||||
|
||||
+6
-3
@@ -21,7 +21,7 @@ again.
|
||||
| [Arch Linux](#arch-linux-aur) | `proton-drive-for-linux` in the AUR | With your AUR helper |
|
||||
| [Debian, Ubuntu 24.04 or newer](#debian-and-ubuntu-2404-or-newer) | `.deb` from the release page | Download each release |
|
||||
| [NixOS](#nixos-flake) | The flake in this repository | With `nix flake update` |
|
||||
| [Fedora Atomic](#fedora-atomic-silverblue-kinoite-bazzite-bluefin) (Silverblue, Kinoite, Bazzite, Bluefin) | The COPR repository, layered with `rpm-ostree` | With `rpm-ostree upgrade` |
|
||||
| [Fedora Atomic](#fedora-atomic-silverblue-kinoite-bazzite-bluefin) (Silverblue, Kinoite, Bazzite, Bluefin) | Home-directory tarball or COPR package layered with `rpm-ostree` | Rerun the tarball installer or use `rpm-ostree upgrade` |
|
||||
| [Anything else](#other-distributions), immutable ones included | `.tar.gz` from the release page, installed into your home folder by its `install.sh`, or [build from source](#build-from-source) | Run the new release's `install.sh` |
|
||||
|
||||
Release packages are for x86_64. You also need a Secret Service provider, such as GNOME
|
||||
@@ -142,7 +142,9 @@ it video thumbnails, override the package with `withFfmpeg = false`. The recipe
|
||||
|
||||
### Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin)
|
||||
|
||||
The system is read-only, so layer the COPR package on top of it. It brings its libraries along:
|
||||
To install in your home folder, unpack the x86-64 tarball and run its
|
||||
`install.sh --check` on the host desktop. See [Other distributions](#other-distributions).
|
||||
For installation and updates through the system image, layer the COPR package:
|
||||
|
||||
```bash
|
||||
sudo curl -o /etc/yum.repos.d/proton-drive-linux.repo \
|
||||
@@ -156,10 +158,11 @@ systemctl reboot
|
||||
### Other distributions
|
||||
|
||||
The `.tar.gz` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest)
|
||||
installs into your home folder, without root, so it also works where the system is read-only:
|
||||
installs into your home folder, without root, on hosts that provide its runtime dependencies. Check those before installing:
|
||||
|
||||
```bash
|
||||
tar -xzf proton-drive-linux-*-x86_64.tar.gz
|
||||
proton-drive-linux-*-x86_64/install.sh --check
|
||||
proton-drive-linux-*-x86_64/install.sh
|
||||
```
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@ pdfs sync ignore reset # back to the built-in patterns
|
||||
pdfs sync ignore add 'cache/' --folder ~/Projects # only in ~/Projects/.pdfsignore
|
||||
pdfs sync ignore list --folder ~/Projects
|
||||
pdfs sync ignore check ~/Projects/app/node_modules
|
||||
pdfs sync ignore check ~/Projects/data/cache.db # shows which rule applies
|
||||
```
|
||||
|
||||
The rules apply to folders kept on this computer. Files you save into `~/ProtonDrive` itself or into
|
||||
|
||||
@@ -8,6 +8,7 @@ set -Eeuo pipefail
|
||||
usage() {
|
||||
cat >&2 <<'EOF'
|
||||
usage: ./install.sh [--prefix DIR] [--no-service] [--force]
|
||||
./install.sh --check
|
||||
./install.sh --uninstall [--prefix DIR] [--no-service]
|
||||
|
||||
Installs the app, the tray, the search launcher and the `pdfs` command into
|
||||
@@ -15,6 +16,7 @@ Installs the app, the tray, the search launcher and the `pdfs` command into
|
||||
the tray's login entry into ~/.config/autostart. Run it again from a newer
|
||||
tarball to update; the running service restarts on the new version.
|
||||
|
||||
--check check the binary and host requirements without installing files
|
||||
--prefix DIR install under DIR instead of ~/.local
|
||||
--uninstall remove what an earlier run installed; your settings, cache
|
||||
and the files in Proton Drive stay
|
||||
@@ -26,6 +28,7 @@ EOF
|
||||
}
|
||||
|
||||
prefix=""
|
||||
check=0
|
||||
uninstall=0
|
||||
service=1
|
||||
force=0
|
||||
@@ -33,6 +36,7 @@ while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--prefix) [[ $# -ge 2 ]] || usage; prefix="$2"; shift ;;
|
||||
--prefix=*) prefix="${1#*=}" ;;
|
||||
--check) check=1 ;;
|
||||
--uninstall) uninstall=1 ;;
|
||||
--no-service) service=0 ;;
|
||||
--force) force=1 ;;
|
||||
@@ -41,6 +45,7 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
shift
|
||||
done
|
||||
(( !check || (!uninstall && !force) )) || usage
|
||||
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# The copy kept for --uninstall knows where it was installed.
|
||||
if [[ -z "$prefix" && -f "$here/installed-files" ]]; then
|
||||
@@ -97,15 +102,19 @@ fi
|
||||
|
||||
[[ -x "$here/bin/pdfs" ]] || die "run install.sh from the unpacked tarball (no bin/pdfs next to it)"
|
||||
|
||||
# A package and this install would each bring a service unit, and the one in
|
||||
# ~/.config wins: the two would run different versions against one database.
|
||||
if [[ $force -eq 0 && ( -e /usr/bin/pdfs || -e /usr/lib/systemd/user/$unit ) ]]; then
|
||||
die "a package already installs Proton Drive for Linux (/usr/bin/pdfs). Remove it first, or keep using it."
|
||||
fi
|
||||
|
||||
# Missing libraries would only show when the app does not start.
|
||||
if [[ "$(uname -m)" != x86_64 ]]; then
|
||||
die "this binary tarball requires an x86-64 Linux host"
|
||||
fi
|
||||
command -v ldd >/dev/null || die "ldd is required to check the tarball's shared libraries"
|
||||
missing="$(for exe in pdfs pdfs-app pdfs-tray pdfs-prompt; do
|
||||
ldd "$here/bin/$exe" 2>&1 | grep -E 'not found' || true
|
||||
if output="$(LC_ALL=C ldd "$here/bin/$exe" 2>&1)"; then
|
||||
grep -F 'not found' <<<"$output" || true
|
||||
else
|
||||
# ldd itself failed (not an x86-64 ELF, unreadable, ...): its first
|
||||
# line says why, the rest is noise.
|
||||
printf '%s: %s\n' "$exe" "$(head -n1 <<<"$output")"
|
||||
fi
|
||||
done | sort -u)"
|
||||
if [[ -n "$missing" ]]; then
|
||||
printf '%s\n' "$missing" | sed 's/^[[:space:]]*/ /' >&2
|
||||
@@ -131,6 +140,30 @@ elif [[ ! -u "$fusermount" ]]; then
|
||||
warn "$fusermount is not setuid root; My files may not mount"
|
||||
fi
|
||||
|
||||
# --check only warns about it: the tarball can still be checked on a host that
|
||||
# has the package, it just must not be installed there.
|
||||
package_installed() {
|
||||
[[ -e /usr/bin/pdfs || -e /usr/lib/systemd/user/$unit ]]
|
||||
}
|
||||
|
||||
if [[ $check -eq 1 ]]; then
|
||||
if package_installed; then
|
||||
warn "a package already installs Proton Drive for Linux (/usr/bin/pdfs); remove it before installing this tarball"
|
||||
fi
|
||||
[[ -n "$fusermount" && -u "$fusermount" && "$(stat -Lc %u "$fusermount")" == 0 ]] ||
|
||||
die "the mount requires a setuid-root fusermount3"
|
||||
[[ -c /dev/fuse && -r /dev/fuse && -w /dev/fuse ]] || die "the current user needs access to /dev/fuse"
|
||||
"$here/bin/pdfs" --version
|
||||
say "The binaries load and the FUSE helper is available. Sign-in and mounting require a desktop session."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# A package and this install would each bring a service unit, and the one in
|
||||
# ~/.config wins: the two would run different versions against one database.
|
||||
if [[ $force -eq 0 ]] && package_installed; then
|
||||
die "a package already installs Proton Drive for Linux (/usr/bin/pdfs). Remove it first, or keep using it."
|
||||
fi
|
||||
|
||||
# Where each file of the tarball goes, as "source<TAB>target" lines.
|
||||
targets() {
|
||||
local file rel
|
||||
|
||||
@@ -24,6 +24,30 @@ src="$(find "$work" -mindepth 1 -maxdepth 1 -type d -name 'proton-drive-linux-*'
|
||||
export HOME="$work/home" XDG_CONFIG_HOME="$work/home/.config"
|
||||
mkdir -p "$HOME"
|
||||
prefix="$HOME/.local"
|
||||
# Exercise the failure path independently of this host's own packages.
|
||||
mkdir "$work/tools"
|
||||
cat >"$work/tools/ldd" <<'EOF'
|
||||
#!/bin/sh
|
||||
echo 'libmissing.so => not found'
|
||||
EOF
|
||||
chmod +x "$work/tools/ldd"
|
||||
if PATH="$work/tools:$PATH" "$src/install.sh" --check >"$work/check.log" 2>&1; then
|
||||
fail "compatibility check accepted a missing library"
|
||||
fi
|
||||
grep -q 'libmissing.so' "$work/check.log" || fail "check did not name the missing library"
|
||||
[ -z "$(find "$HOME" -mindepth 1 -print -quit)" ] || fail "compatibility check wrote into HOME"
|
||||
# ldd refusing the binary outright must fail the check too, not pass it.
|
||||
cat >"$work/tools/ldd" <<'EOF'
|
||||
#!/bin/sh
|
||||
echo 'not a dynamic executable' >&2
|
||||
exit 1
|
||||
EOF
|
||||
if PATH="$work/tools:$PATH" "$src/install.sh" --check >"$work/check.log" 2>&1; then
|
||||
fail "compatibility check accepted a binary ldd could not load"
|
||||
fi
|
||||
grep -q 'not a dynamic executable' "$work/check.log" || fail "check did not say why ldd failed"
|
||||
[ -z "$(find "$HOME" -mindepth 1 -print -quit)" ] || fail "compatibility check wrote into HOME"
|
||||
|
||||
"$src/install.sh" --no-service --force >"$work/install.log" 2>&1 ||
|
||||
{ cat "$work/install.log" >&2; fail "install.sh failed"; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user