2022-07-23 13:16:10 +02:00
|
|
|
#!/usr/bin/env bash
|
2022-02-17 13:45:43 +01:00
|
|
|
|
2022-12-12 20:38:44 +01:00
|
|
|
# This installs Darktable on Linux.
|
2022-07-23 13:55:05 +02:00
|
|
|
# bash <(curl -s https://raw.githubusercontent.com/photoprism/photoprism/develop/scripts/dist/install-darktable.sh)
|
|
|
|
|
2022-07-23 13:08:24 +02:00
|
|
|
PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:$PATH"
|
2022-03-23 08:16:01 +01:00
|
|
|
|
2022-12-12 20:38:44 +01:00
|
|
|
# Abort if not executed as root.
|
2022-02-17 13:45:43 +01:00
|
|
|
if [[ $(id -u) != "0" ]]; then
|
2022-02-25 16:33:46 +01:00
|
|
|
echo "Usage: run ${0##*/} as root" 1>&2
|
2022-02-17 13:45:43 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-07-23 13:55:05 +02:00
|
|
|
if [[ $PHOTOPRISM_ARCH ]]; then
|
|
|
|
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
|
|
|
else
|
|
|
|
SYSTEM_ARCH=$(uname -m)
|
|
|
|
fi
|
2022-02-17 13:45:43 +01:00
|
|
|
|
2022-02-25 16:33:46 +01:00
|
|
|
DESTARCH=${2:-$SYSTEM_ARCH}
|
2022-02-18 17:40:58 +01:00
|
|
|
|
2022-07-23 13:55:05 +02:00
|
|
|
set -e
|
|
|
|
|
2022-02-17 13:45:43 +01:00
|
|
|
. /etc/os-release
|
|
|
|
|
2022-02-25 16:33:46 +01:00
|
|
|
echo "Installing Darktable for ${DESTARCH^^}..."
|
2022-02-18 17:40:58 +01:00
|
|
|
|
2022-07-23 13:55:05 +02:00
|
|
|
case $DESTARCH in
|
|
|
|
amd64 | AMD64 | x86_64 | x86-64)
|
2022-09-14 18:46:28 +02:00
|
|
|
if [[ $VERSION_CODENAME == "jammy" ]]; then
|
|
|
|
echo 'deb http://download.opensuse.org/repositories/graphics:/darktable/xUbuntu_22.04/ /' | tee /etc/apt/sources.list.d/graphics:darktable.list
|
|
|
|
curl -fsSL https://download.opensuse.org/repositories/graphics:darktable/xUbuntu_22.04/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 == "bullseye" ]]; then
|
2022-07-23 13:55:05 +02:00
|
|
|
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 (Intel 64-bit) package"
|
|
|
|
apt-get -qq install darktable
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
arm64 | ARM64 | aarch64)
|
|
|
|
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 arm64 (ARM 64-bit) package"
|
|
|
|
apt-get -qq install darktable
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Unsupported Machine Architecture: \"$BUILD_ARCH\"" 1>&2
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "Done."
|