# We use debian, but GitHub CI is stuck on Ubuntu Bionic, so this must be compatible with both
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')
-# Ubuntu 22.04 (Jammy) doesn't have libwebp6
-LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22.04' && echo 'libwebp7' || echo 'libwebp6')
+# Ubuntu 22.04/22.10 doesn't have libwebp6
+LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
PREFIX=/usr/local
WDIR=/tmp/imagemagick
libwebpmux3 libwebpdemux2 ghostscript libxml2-dev libxml2-utils librsvg2-dev \
libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev
-# Use backports instead of compiling it
-apt -y -q install -t bullseye-backports libheif1 libaom-dev libheif-dev
+# Ubuntu doesn't like `bullseye-backports`
+if cat /etc/issue | grep -qi 'Ubuntu 22'; then
+ apt -y install libheif1 libaom-dev libheif-dev
+else
+ # Use backports instead of compiling it
+ apt -y -q install -t bullseye-backports libheif1 libaom-dev libheif-dev
+fi
mkdir -p $WDIR
cd $WDIR