From e2b09a9fcd02354d66b2c3376e5ae64fcfb3041d Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:13:09 +0100 Subject: [PATCH] Discourse: build libvips 8.18 for its image worker (#18430) Discourse enabled libvips image processing by default and its worker refuses anything older than 8.18; Debian 13 ships 8.16, so the service failed to boot after an update and on fresh installs. Build the latest libvips release from source like discourse_docker does, on install and on update when a new release is out. --- ct/discourse.sh | 11 +++++++++++ install/discourse-install.sh | 29 ++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/ct/discourse.sh b/ct/discourse.sh index 893f13f14..bec23137f 100644 --- a/ct/discourse.sh +++ b/ct/discourse.sh @@ -58,6 +58,17 @@ function update_script() { $STD git pull origin main msg_ok "Updated Discourse" + if check_for_gh_release "libvips" "libvips/libvips"; then + ensure_dependencies meson ninja-build pkg-config libglib2.0-dev libexpat1-dev libjpeg-dev libpng-dev libwebp-dev libtiff-dev libheif-dev libjxl-dev librsvg2-dev libcgif-dev libexif-dev liblcms2-dev liborc-0.4-dev libimagequant-dev libpango1.0-dev + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "libvips" "libvips/libvips" "prebuild" "latest" "/opt/libvips" "vips-*.tar.xz" + msg_info "Building libvips" + cd /opt/libvips + $STD meson setup build --prefix=/usr/local --libdir=lib --buildtype=release -Dmodules=disabled -Dmagick=disabled -Dexamples=false + $STD ninja -C build install + ldconfig + msg_ok "Built libvips" + fi + msg_info "Updating Dependencies" RUBY_TARGET=$(grep -A1 '^RUBY VERSION' /opt/discourse/Gemfile.lock | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1) RUBY_VERSION="${RUBY_TARGET:-4.0.7}" RUBY_INSTALL_RAILS="false" setup_ruby diff --git a/install/discourse-install.sh b/install/discourse-install.sh index 27c56fd6e..7027784f7 100644 --- a/install/discourse-install.sh +++ b/install/discourse-install.sh @@ -25,9 +25,36 @@ $STD apt install -y \ gsfonts \ brotli \ nginx \ - redis-server + redis-server \ + meson \ + ninja-build \ + pkg-config \ + libglib2.0-dev \ + libexpat1-dev \ + libjpeg-dev \ + libpng-dev \ + libwebp-dev \ + libtiff-dev \ + libheif-dev \ + libjxl-dev \ + librsvg2-dev \ + libcgif-dev \ + libexif-dev \ + liblcms2-dev \ + liborc-0.4-dev \ + libimagequant-dev \ + libpango1.0-dev msg_ok "Installed Dependencies" +fetch_and_deploy_gh_release "libvips" "libvips/libvips" "prebuild" "latest" "/opt/libvips" "vips-*.tar.xz" + +msg_info "Building libvips" +cd /opt/libvips +$STD meson setup build --prefix=/usr/local --libdir=lib --buildtype=release -Dmodules=disabled -Dmagick=disabled -Dexamples=false +$STD ninja -C build install +ldconfig +msg_ok "Built libvips" + msg_info "Cloning Discourse" $STD git clone --depth 1 https://github.com/discourse/discourse.git /opt/discourse msg_ok "Cloned Discourse"