Files
rose-ash/artdag/core/scripts/install-ffglitch.sh
giles 1a74d811f7
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m33s
Incorporate art-dag-mono repo into artdag/ subfolder
Merges full history from art-dag/mono.git into the monorepo
under the artdag/ directory. Contains: core (DAG engine),
l1 (Celery rendering server), l2 (ActivityPub registry),
common (shared templates/middleware), client (CLI), test (e2e).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

git-subtree-dir: artdag
git-subtree-mainline: 1a179de547
git-subtree-split: 4c2e716558
2026-02-27 09:07:23 +00:00

83 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Install ffglitch for datamosh effects
# Usage: ./install-ffglitch.sh [install_dir]
set -e
FFGLITCH_VERSION="0.10.2"
INSTALL_DIR="${1:-/usr/local/bin}"
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
URL="https://ffglitch.org/pub/bin/linux64/ffglitch-${FFGLITCH_VERSION}-linux-x86_64.zip"
ARCHIVE="ffglitch.zip"
;;
aarch64)
URL="https://ffglitch.org/pub/bin/linux-aarch64/ffglitch-${FFGLITCH_VERSION}-linux-aarch64.7z"
ARCHIVE="ffglitch.7z"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
echo "Installing ffglitch ${FFGLITCH_VERSION} for ${ARCH}..."
# Create temp directory
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
# Download
echo "Downloading from ${URL}..."
curl -L -o "$ARCHIVE" "$URL"
# Extract
echo "Extracting..."
if [[ "$ARCHIVE" == *.zip ]]; then
unzip -q "$ARCHIVE"
elif [[ "$ARCHIVE" == *.7z ]]; then
# Requires p7zip
if ! command -v 7z &> /dev/null; then
echo "7z not found. Install with: apt install p7zip-full"
exit 1
fi
7z x "$ARCHIVE" > /dev/null
fi
# Find and install binaries
echo "Installing to ${INSTALL_DIR}..."
find . -name "ffgac" -o -name "ffedit" | while read bin; do
chmod +x "$bin"
if [ -w "$INSTALL_DIR" ]; then
cp "$bin" "$INSTALL_DIR/"
else
sudo cp "$bin" "$INSTALL_DIR/"
fi
echo " Installed: $(basename $bin)"
done
# Cleanup
cd /
rm -rf "$TMPDIR"
# Verify
echo ""
echo "Verifying installation..."
if command -v ffgac &> /dev/null; then
echo "ffgac: $(which ffgac)"
else
echo "Warning: ffgac not in PATH. Add ${INSTALL_DIR} to PATH."
fi
if command -v ffedit &> /dev/null; then
echo "ffedit: $(which ffedit)"
else
echo "Warning: ffedit not in PATH. Add ${INSTALL_DIR} to PATH."
fi
echo ""
echo "Done! ffglitch installed."