From 255d41a0e7905cf023842fbbc2b74c90ca3370af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 30 Aug 2024 13:41:34 +0200 Subject: [PATCH] Install oxipng, cleanup magick after install --- manifest.toml | 12 ++++++++++++ scripts/_common.sh | 8 ++++++++ scripts/install | 5 +++-- scripts/upgrade | 5 +++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 00e782c..4e99e5d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -66,6 +66,18 @@ ram.runtime = "1G" autoupdate.strategy = "latest_github_tag" autoupdate.upstream = "https://github.com/ImageMagick/ImageMagick" + [resources.sources.oxipng] + amd64.url = "https://github.com/shssoichiro/oxipng/releases/download/v9.1.2/oxipng-9.1.2-x86_64-unknown-linux-gnu.tar.gz" + amd64.sha256 = "6d47453f623d7d12499e206fe089fe96d76bc6f01a00962b91e4ee3e6845e1a6" + + arm64.url = "https://github.com/shssoichiro/oxipng/releases/download/v9.1.2/oxipng-9.1.2-aarch64-unknown-linux-gnu.tar.gz" + arm64.sha256 = "9716b3aba89e7ed9fa9fa07aef4867a7b65a9dd26516e6b16f8ae5a56006cafa" + + autoupdate.strategy = "latest_github_release" + autoupdate.upstream = "https://github.com/shssoichiro/oxipng" + autoupdate.asset.amd64 = "^oxipng-.*-x86_64-unknown-linux-gnu\\.tar\\.gz$" + autoupdate.asset.arm64 = "^oxipng-.*-aarch64-unknown-linux-gnu\\.tar\\.gz$" + [resources.system_user] [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index b201d92..0ccc74f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -94,6 +94,14 @@ install_imagemagick() { ynh_exec_as "$app" make all -j"$(nproc)" ynh_exec_as "$app" LIBTOOLFLAGS=-Wnone make install popd + ynh_secure_remove --file="$install_dir/imagemagick_source" +} + +install_oxipng() { + ynh_setup_source --source_id="oxipng" --dest_dir="$install_dir/oxipng_source" + mkdir -p "$tools_prefix/bin" + mv "$install_dir/oxipng_source/oxipng" "$tools_prefix/bin/oxipng" + ynh_secure_remove --file="$install_dir/oxipng_source" } ynh_maintenance_mode_ON () { diff --git a/scripts/install b/scripts/install index 6b9ce5e..97283dc 100644 --- a/scripts/install +++ b/scripts/install @@ -41,17 +41,18 @@ ynh_app_setting_set --app="$app" --key=unicorn_workers --value=$unicorn_workers # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing Ruby..." - ynh_exec_warn_less ynh_install_ruby --ruby_version="$ruby_version" ynh_use_ruby 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 +ynh_script_progression --message="Installing Oxipng..." +install_oxipng + #================================================= # CONFIGURE A POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b5c178c..a4d6342 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,6 +72,11 @@ ynh_exec_warn_less ynh_install_ruby --ruby_version="$ruby_version" ynh_script_progression --message="Upgrading NodeJS..." ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_script_progression --message="Building and upgrading ImageMagick v7..." +install_imagemagick + +ynh_script_progression --message="Upgrading Oxipng..." +install_oxipng #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================