1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/discourse_ynh.git synced 2024-09-03 18:26:18 +02:00

Install imagemagick v7

This commit is contained in:
Félix Piédallu 2024-08-29 13:56:11 +02:00
parent 19ad49c184
commit 846bb31d43
4 changed files with 47 additions and 1 deletions

View file

@ -14,7 +14,7 @@ Environment=RAILS_ENV=production
Environment=UNICORN_SIDEKIQS=1
Environment=LD_PRELOAD=__LIBJEMALLOC__
Environment=UNICORN_LISTENER=__INSTALL_DIR__/discourse/tmp/sockets/unicorn.sock
Environment="__YNH_RUBY_LOAD_PATH__"
Environment="__YNH_RUBY_LOAD_PATH__:__MAGICK_PREFIX__/bin"
ExecStart=__INSTALL_DIR__/discourse/bin/bundle exec unicorn --config config/unicorn.conf.rb -E production
Restart=always
RestartSec=10

View file

@ -59,6 +59,13 @@ ram.runtime = "1G"
autoupdate.strategy = "latest_github_tag"
autoupdate.upstream = "https://github.com/jonmbake/discourse-ldap-auth"
[resources.sources.imagemagickv7]
url = "https://github.com/ImageMagick/ImageMagick/archive/7.1.0-62.tar.gz"
sha256 = "d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef884a"
autoupdate.strategy = "latest_github_tag"
autoupdate.upstream = "https://github.com/ImageMagick/ImageMagick"
[resources.system_user]
[resources.install_dir]

View file

@ -55,6 +55,42 @@ check_memory_requirements_upgrade() {
fi
}
magick_prefix="$install_dir/imagemagick"
# See https://github.com/discourse/discourse_docker/blob/main/image/base/install-imagemagick
install_imagemagick() {
ynh_setup_source --source_id="imagemagickv7" --dest_dir="$install_dir/imagemagick_source"
mkdir -p "$magick_prefix"
chown -R "$app:$app" "$install_dir/imagemagick_source" "$magick_prefix"
pushd "$install_dir/imagemagick_source"
ynh_exec_as "$app" CFLAGS="-O2 -I$magick_prefix/include -Wno-deprecated-declarations" \
./configure \
--prefix="$magick_prefix" \
--enable-static \
--enable-bounds-checking \
--enable-hdri \
--enable-hugepages \
--with-threads \
--with-modules \
--with-quantum-depth=16 \
--without-magick-plus-plus \
--with-bzlib \
--with-zlib \
--without-autotrace \
--with-freetype \
--with-jpeg \
--without-lcms \
--with-lzma \
--with-png \
--with-tiff \
--with-heic \
--with-rsvg \
--with-webp
ynh_exec_as "$app" make all -j"$(nproc)"
ynh_exec_as "$app" LIBTOOLFLAGS=-Wnone make install
popd
}
ynh_maintenance_mode_ON () {
# Create an html to serve as maintenance notice
echo "<!DOCTYPE html>

View file

@ -49,6 +49,9 @@ ynh_script_progression --message="Installing NodeJS..."
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_script_progression --message="Building and installing ImageMagick v7..."
install_imagemagick
#=================================================
# CONFIGURE A POSTGRESQL DATABASE
#=================================================