2022-02-17 13:45:43 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# abort if the user is not root
|
|
|
|
if [[ $(id -u) != "0" ]]; then
|
|
|
|
echo "Usage: run install-darktable.sh as root" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-02-18 17:40:58 +01:00
|
|
|
SYSTEM_ARCH=$("$(dirname "$0")/arch.sh")
|
|
|
|
INSTALL_ARCH=${2:-$SYSTEM_ARCH}
|
|
|
|
|
2022-02-17 13:45:43 +01:00
|
|
|
. /etc/os-release
|
|
|
|
|
2022-02-18 17:40:58 +01:00
|
|
|
echo "Installing Darktable for ${INSTALL_ARCH^^}..."
|
|
|
|
|
|
|
|
if [[ $INSTALL_ARCH == "amd64" ]]; then
|
2022-02-17 13:45:43 +01:00
|
|
|
if [[ $VERSION_CODENAME == "bullseye" ]]; then
|
|
|
|
echo 'deb http://download.opensuse.org/repositories/graphics:/darktable/Debian_11/ /' | tee /etc/apt/sources.list.d/graphics:darktable.list
|
|
|
|
curl -fsSL https://download.opensuse.org/repositories/graphics:darktable/Debian_11/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null
|
|
|
|
apt-get update
|
|
|
|
apt-get -qq install darktable
|
|
|
|
elif [[ $VERSION_CODENAME == "buster" ]]; then
|
|
|
|
echo 'deb http://download.opensuse.org/repositories/graphics:/darktable/Debian_10/ /' | tee /etc/apt/sources.list.d/graphics:darktable.list
|
|
|
|
curl -fsSL https://download.opensuse.org/repositories/graphics:darktable/Debian_10/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/graphics_darktable.gpg > /dev/null
|
|
|
|
apt-get update
|
|
|
|
apt-get -qq install darktable
|
|
|
|
else
|
|
|
|
echo "install-darktable: installing standard amd64 (Intel 64-bit) package"
|
|
|
|
apt-get -qq install darktable
|
|
|
|
fi
|
2022-02-19 15:32:52 +01:00
|
|
|
echo "Done."
|
2022-02-18 17:40:58 +01:00
|
|
|
elif [[ $INSTALL_ARCH == "arm64" ]]; then
|
2022-02-17 13:45:43 +01:00
|
|
|
if [[ $VERSION_CODENAME == "bullseye" ]]; then
|
|
|
|
apt-get update
|
|
|
|
apt-get -qq install -t bullseye-backports darktable
|
|
|
|
elif [[ $VERSION_CODENAME == "buster" ]]; then
|
|
|
|
apt-get update
|
|
|
|
apt-get -qq install -t buster-backports darktable
|
|
|
|
else
|
|
|
|
echo "install-darktable: installing standard amd64 (ARM 64-bit) package"
|
|
|
|
apt-get -qq install darktable
|
|
|
|
fi
|
2022-02-19 15:32:52 +01:00
|
|
|
echo "Done."
|
2022-02-17 13:45:43 +01:00
|
|
|
else
|
2022-02-18 17:40:58 +01:00
|
|
|
echo "Unsupported Machine Architecture: $INSTALL_ARCH"
|
2022-02-17 13:45:43 +01:00
|
|
|
fi
|