#!/bin/sh # PURE Donor installer for macOS and Linux: https://purepure.app/deltag # Usage: curl -fsSL https://fleet.purepure.app/deltag/install.sh | sh # Without the browser lane (pages that need JavaScript; less disk and memory): # curl -fsSL https://fleet.purepure.app/deltag/install.sh | sh -s -- --no-browser # Everything goes in ~/.pure-donor plus one start-up file; "pure-donor # uninstall" removes both. The whole script is one function, so a download cut # short runs nothing. set -eu pure_donor_install() { MASTER="${PURE_WORK_MASTER_URL:-https://fleet.purepure.app}" HOME_DIR="${PURE_DONOR_HOME:-$HOME/.pure-donor}" UV_VERSION="0.13.5" if [ "$(id -u)" = "0" ] && [ "${PURE_DONOR_ALLOW_ROOT:-0}" != "1" ]; then echo "Kør installationen som din almindelige bruger, ikke som root eller med sudo." >&2 echo "(På en server kan du bruge Docker-udgaven: se $MASTER/deltag)" >&2 exit 1 fi if ! curl -fsS "$MASTER/deltag/manifest.json" >/dev/null 2>&1; then echo "PURE Donor åbner snart. Se $MASTER/deltag" >&2 exit 1 fi machine="$(uname -m)" # A Terminal running under Rosetta reports x86_64 on Apple silicon. if [ "$(uname -s)" = Darwin ] && [ "$(sysctl -n hw.optional.arm64 2>/dev/null || echo 0)" = 1 ]; then machine=arm64 fi case "$(uname -s)-$machine" in Darwin-arm64) asset=aarch64-apple-darwin ;; Darwin-x86_64) asset=x86_64-apple-darwin ;; Linux-x86_64) asset=x86_64-unknown-linux-gnu ;; Linux-aarch64|Linux-arm64) asset=aarch64-unknown-linux-gnu ;; *) echo "PURE Donor understøtter ikke denne computer ($(uname -sm))." >&2; exit 1 ;; esac case "$asset" in aarch64-apple-darwin) sum=743f85035a1996ecb350659e01cd9faea9709829be09b1b4b03c73eaf3c9cd73 ;; x86_64-apple-darwin) sum=b0f52b0e3945b4107d89024ea38e625683011fbfc05a0d98f9fa2d6dcee28c66 ;; x86_64-unknown-linux-gnu) sum=f68d291c75783122dad58ab77def0e13f3233f358731db5d6d7e8715603b928f ;; aarch64-unknown-linux-gnu) sum=4bb69cf95ed13f23713bb7bc09f241896ea0c75b7c557e615a20604b82f9c403 ;; esac mkdir -p "$HOME_DIR/bin" "$HOME_DIR/downloads" chmod 700 "$HOME_DIR" echo "==> Henter installationsværktøjet uv $UV_VERSION" archive="$HOME_DIR/downloads/uv-$asset.tar.gz" curl -fsSL "https://github.com/astral-sh/uv/releases/download/$UV_VERSION/uv-$asset.tar.gz" -o "$archive" if command -v sha256sum >/dev/null 2>&1; then got="$(sha256sum "$archive" | cut -d ' ' -f 1)" else got="$(shasum -a 256 "$archive" | cut -d ' ' -f 1)" fi if [ "$got" != "$sum" ]; then echo "Værktøjet kunne ikke verificeres; intet er installeret." >&2 rm -f "$archive"; exit 1 fi tar -xzf "$archive" -C "$HOME_DIR/downloads" mv "$HOME_DIR/downloads/uv-$asset/uv" "$HOME_DIR/bin/uv" rm -rf "$archive" "$HOME_DIR/downloads/uv-$asset" # Python, uv's cache and nothing else outside the donor home. export UV_PYTHON_INSTALL_DIR="$HOME_DIR/python" UV_CACHE_DIR="$HOME_DIR/cache" export UV_MANAGED_PYTHON=1 UV_NO_CONFIG=1 echo "==> Henter Python 3.12" "$HOME_DIR/bin/uv" python install --quiet --no-bin 3.12 python="$("$HOME_DIR/bin/uv" python find 3.12)" echo "==> Henter PURE Donor" curl -fsSL "$MASTER/deltag/launcher.py" -o "$HOME_DIR/launcher.py" browser="" [ "${PURE_DONOR_BROWSER:-1}" = "0" ] && browser="--no-browser" PURE_DONOR_HOME="$HOME_DIR" PURE_WORK_MASTER_URL="$MASTER" \ "$python" "$HOME_DIR/launcher.py" install $browser "$@" } pure_donor_install "$@"