From ba2ac2c212b70377d72801ad196bd5691b31f73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 11:16:29 +0100 Subject: [PATCH 01/10] do not build libheif --- manifest.toml | 3 +++ scripts/_common.sh | 15 +++++++++------ scripts/install | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/manifest.toml b/manifest.toml index fff4f6f..423ded9 100644 --- a/manifest.toml +++ b/manifest.toml @@ -87,6 +87,9 @@ ram.runtime = "200M" [resources.apt] packages = [ + # "cmake", + # "ninja", + "curl", "gpg", "ffmpeg", diff --git a/scripts/_common.sh b/scripts/_common.sh index 1ce2711..0f972f0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,15 +19,18 @@ function set_go_vars { go_shims_path=$goenv_install_dir/shims go_path_full="$go_shims_path":"$(sudo -u $app bash -c 'echo $PATH')" - heif_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LIBRARY_PATH')" - heif_ld_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LD_LIBRARY_PATH')" - heif_cgo_cflags="-I$install_dir/local/include" + # heif_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LIBRARY_PATH')" + # heif_ld_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LD_LIBRARY_PATH')" + # heif_cgo_cflags="-I$install_dir/local/include" } function build_libheif { export GOPATH="$install_dir/build/go" export GOCACHE="$install_dir/build/.cache" + cmake -S "$install_dir/libheif" -B "$install_dir/libheif/build" -DCMAKE_BUILD_TYPE=RELEASE -GNinja + cmake --build "$install_dir/libheif/build" + pushd "$install_dir/libheif" || ynh_die # mkdir -p "$install_dir/local" # chown -R $app:$app "$install_dir/local" @@ -45,9 +48,9 @@ function build_api { gobuild_env=( "PATH=$go_path_full" - "LIBRARY_PATH=$heif_lib_path" - "LD_LIBRARY_PATH=$heif_ld_lib_path" - "CGO_CFLAGS=$heif_cgo_cflags" + # "LIBRARY_PATH=$heif_lib_path" + # "LD_LIBRARY_PATH=$heif_ld_lib_path" + # "CGO_CFLAGS=$heif_cgo_cflags" "GOENV_VERSION=$go_version" CGO_ENABLED=1 ) diff --git a/scripts/install b/scripts/install index 0db6ebf..0209700 100755 --- a/scripts/install +++ b/scripts/install @@ -37,8 +37,8 @@ chown -R "$app:$app" "$data_dir" #================================================= # BUILD APP #================================================= -ynh_script_progression --message="Compiling libheif..." --weight=10 -build_libheif +# ynh_script_progression --message="Compiling libheif..." --weight=10 +# build_libheif ynh_script_progression --message="Compiling Go API..." --weight=10 build_api From 274407ef22c0a269c780cff6f9fb89862a1c254e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:12:40 +0100 Subject: [PATCH 02/10] Use ppas for libheif --- manifest.toml | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/manifest.toml b/manifest.toml index 423ded9..b029acb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -87,29 +87,19 @@ ram.runtime = "200M" [resources.apt] packages = [ - # "cmake", - # "ninja", - "curl", "gpg", "ffmpeg", "exiftool", - "libheif1", - "ca-certificates", - "golang", - "libdlib-dev", - "libblas-dev", + "libatlas-base-dev", - "liblapack-dev", + "libblas-dev", + "libdlib-dev", + "libdlib19", "libjpeg-dev", - "libheif-dev", - "build-essential", - "pkg-config", - "autoconf", - "automake", - "libx265-dev", - "libde265-dev", - "libaom-dev", + "libjpeg-turbo8-dev", + "liblapack-dev", + # "darktable", "mariadb-server", ] @@ -122,6 +112,22 @@ ram.runtime = "200M" fi """ + [resources.apt.extras.strukturag_libheif] + repo = "deb https://ppa.launchpadcontent.net/strukturag/libheif/ubuntu jammy main" + key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" + packages = [ + "libheif-dev", + "libaom-dev", + "libx265-dev", + ] + + [resources.apt.extras.strukturag_libde265] + repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" + key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" + packages = [ + "libde256-dev", + ] + [resources.apt.extras.yarn] repo = "deb https://dl.yarnpkg.com/debian/ stable main" key = "https://dl.yarnpkg.com/debian/pubkey.gpg" From 7d553cdf25a607d205d757e3c20c03ca5fb1c53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:17:29 +0100 Subject: [PATCH 03/10] cleanup traces of libheif --- manifest.toml | 8 -------- scripts/_common.sh | 27 +-------------------------- scripts/install | 4 ---- scripts/upgrade | 4 ---- 4 files changed, 1 insertion(+), 42 deletions(-) diff --git a/manifest.toml b/manifest.toml index b029acb..8a5a679 100644 --- a/manifest.toml +++ b/manifest.toml @@ -54,14 +54,6 @@ ram.runtime = "200M" autoupdate.strategy = "latest_github_release" - [resources.sources.libheif] - url = "https://github.com/strukturag/libheif/releases/download/v1.12.0/libheif-1.12.0.tar.gz" - sha256 = "e1ac2abb354fdc8ccdca71363ebad7503ad731c84022cf460837f0839e171718" - - autoupdate.strategy = "latest_github_release" - autoupdate.upstream = "https://github.com/strukturag/libheif" - autoupdate.asset = ".*\\.tar\\.gz" - [resources.system_user] [resources.install_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 0f972f0..5229d35 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,28 +19,6 @@ function set_go_vars { go_shims_path=$goenv_install_dir/shims go_path_full="$go_shims_path":"$(sudo -u $app bash -c 'echo $PATH')" - # heif_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LIBRARY_PATH')" - # heif_ld_lib_path="$install_dir/local/lib":"$(sudo -u $app bash -c 'echo $LD_LIBRARY_PATH')" - # heif_cgo_cflags="-I$install_dir/local/include" -} - -function build_libheif { - export GOPATH="$install_dir/build/go" - export GOCACHE="$install_dir/build/.cache" - - cmake -S "$install_dir/libheif" -B "$install_dir/libheif/build" -DCMAKE_BUILD_TYPE=RELEASE -GNinja - cmake --build "$install_dir/libheif/build" - - pushd "$install_dir/libheif" || ynh_die - # mkdir -p "$install_dir/local" - # chown -R $app:$app "$install_dir/local" - ynh_exec_as "$app" ./autogen.sh 2>&1 - ynh_exec_as "$app" ./configure --prefix="$install_dir/local" --disable-gdk-pixbuf 2>&1 - ynh_exec_as "$app" make clean 2>&1 - ynh_exec_as "$app" make 2>&1 - ynh_exec_as "$app" make install 2>&1 - ynh_exec_as "$app" make clean 2>&1 - popd || ynh_die } function build_api { @@ -48,11 +26,8 @@ function build_api { gobuild_env=( "PATH=$go_path_full" - # "LIBRARY_PATH=$heif_lib_path" - # "LD_LIBRARY_PATH=$heif_ld_lib_path" - # "CGO_CFLAGS=$heif_cgo_cflags" "GOENV_VERSION=$go_version" - CGO_ENABLED=1 + "CGO_ENABLED=1" ) pushd "$install_dir/sources/api" || ynh_die diff --git a/scripts/install b/scripts/install index 0209700..ca64ac0 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,6 @@ ynh_install_nodejs --nodejs_version="$node_version" ynh_script_progression --message="Setting up source files..." --weight=10 ynh_setup_source --dest_dir="$install_dir/sources" -ynh_setup_source --source_id=libheif --dest_dir="$install_dir/libheif" mkdir -p "$install_dir/output/"{data,ui} @@ -37,9 +36,6 @@ chown -R "$app:$app" "$data_dir" #================================================= # BUILD APP #================================================= -# ynh_script_progression --message="Compiling libheif..." --weight=10 -# build_libheif - ynh_script_progression --message="Compiling Go API..." --weight=10 build_api diff --git a/scripts/upgrade b/scripts/upgrade index d2ae849..703c6ac 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,7 +46,6 @@ ynh_install_nodejs --nodejs_version="$node_version" ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 -ynh_setup_source --source_id=libheif --dest_dir="$install_dir/libheif" --full_replace=1 mkdir -p "$install_dir/output/"{data,ui} chown -R "$app:$app" "$install_dir" @@ -55,9 +54,6 @@ chown -R "$app:$app" "$data_dir" #================================================= # BUILD APP #================================================= -ynh_script_progression --message="Compiling libheif..." --weight=70 -build_libheif - ynh_script_progression --message="Compiling Go API..." --weight=165 build_api From 7b8f871d4791e3c7ec7e3e6e64c0e185572b723d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:19:08 +0100 Subject: [PATCH 04/10] libjpeg-dev provides libjpeg62-turbo already --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 8a5a679..ca15dae 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,7 +89,7 @@ ram.runtime = "200M" "libdlib-dev", "libdlib19", "libjpeg-dev", - "libjpeg-turbo8-dev", + # "libjpeg62-turbo-dev", "liblapack-dev", # "darktable", From d9680e58b80d7e243e3b63701f9095120bc3e405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:25:23 +0100 Subject: [PATCH 05/10] fix deps --- manifest.toml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/manifest.toml b/manifest.toml index ca15dae..8b8bf45 100644 --- a/manifest.toml +++ b/manifest.toml @@ -84,6 +84,7 @@ ram.runtime = "200M" "ffmpeg", "exiftool", + "libheif1", "libatlas-base-dev", "libblas-dev", "libdlib-dev", @@ -96,13 +97,12 @@ ram.runtime = "200M" "mariadb-server", ] - packages_from_raw_bash = """ - if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then - echo "libdlib19"; - elif [[ $YNH_DEBIAN_VERSION == "bookworm" ]]; then - echo "libdlib19.1"; - fi - """ + [resources.apt.extras.strukturag_libde265] + repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" + key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" + packages = [ + "libde256-dev", + ] [resources.apt.extras.strukturag_libheif] repo = "deb https://ppa.launchpadcontent.net/strukturag/libheif/ubuntu jammy main" @@ -113,13 +113,6 @@ ram.runtime = "200M" "libx265-dev", ] - [resources.apt.extras.strukturag_libde265] - repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" - key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" - packages = [ - "libde256-dev", - ] - [resources.apt.extras.yarn] repo = "deb https://dl.yarnpkg.com/debian/ stable main" key = "https://dl.yarnpkg.com/debian/pubkey.gpg" From b682dd0e42fb727ad9ea868157e534de74e24465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:29:59 +0100 Subject: [PATCH 06/10] fix dep again --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 8b8bf45..360f4fd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -101,7 +101,7 @@ ram.runtime = "200M" repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" packages = [ - "libde256-dev", + "libde265-dev", ] [resources.apt.extras.strukturag_libheif] From 5eb8cac348e5b57d974dbc4e7ea31d8ae4b5f364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 12:34:15 +0100 Subject: [PATCH 07/10] fix dep again --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 360f4fd..33bcb86 100644 --- a/manifest.toml +++ b/manifest.toml @@ -101,6 +101,7 @@ ram.runtime = "200M" repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" packages = [ + "libde265-0", "libde265-dev", ] From 5786c58043c474d2213e1b34055917c8a747bd2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 14:13:14 +0100 Subject: [PATCH 08/10] remove libde265-dev --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 33bcb86..b93596c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -102,7 +102,7 @@ ram.runtime = "200M" key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" packages = [ "libde265-0", - "libde265-dev", + # "libde265-dev", ] [resources.apt.extras.strukturag_libheif] From 165112f8feacd5ae179f196d6b0c50b69dafd115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Tue, 12 Mar 2024 14:19:39 +0100 Subject: [PATCH 09/10] use focal repons --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index b93596c..d19acb7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -98,15 +98,15 @@ ram.runtime = "200M" ] [resources.apt.extras.strukturag_libde265] - repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu jammy main" + repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu focal main" key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" packages = [ "libde265-0", - # "libde265-dev", + "libde265-dev", ] [resources.apt.extras.strukturag_libheif] - repo = "deb https://ppa.launchpadcontent.net/strukturag/libheif/ubuntu jammy main" + repo = "deb https://ppa.launchpadcontent.net/strukturag/libheif/ubuntu focal main" key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92" packages = [ "libheif-dev", From 09de36b0495e537fb9138130dd81f290484ca8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 2 May 2024 23:33:23 +0200 Subject: [PATCH 10/10] Update manifest.toml --- manifest.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index d19acb7..6d85b43 100644 --- a/manifest.toml +++ b/manifest.toml @@ -88,11 +88,9 @@ ram.runtime = "200M" "libatlas-base-dev", "libblas-dev", "libdlib-dev", - "libdlib19", "libjpeg-dev", # "libjpeg62-turbo-dev", "liblapack-dev", - # "darktable", "mariadb-server", ]