1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/photoview_ynh.git synced 2024-09-03 20:05:55 +02:00
This commit is contained in:
Salamandar 2024-06-10 16:30:59 +00:00 committed by GitHub
commit 8e554cba30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 59 deletions

View file

@ -54,14 +54,6 @@ ram.runtime = "200M"
autoupdate.strategy = "latest_github_release" 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.system_user]
[resources.install_dir] [resources.install_dir]
@ -91,33 +83,34 @@ ram.runtime = "200M"
"gpg", "gpg",
"ffmpeg", "ffmpeg",
"exiftool", "exiftool",
"libheif1", "libheif1",
"ca-certificates",
"golang",
"libdlib-dev",
"libblas-dev",
"libatlas-base-dev", "libatlas-base-dev",
"liblapack-dev", "libblas-dev",
"libdlib-dev",
"libjpeg-dev", "libjpeg-dev",
"libheif-dev", # "libjpeg62-turbo-dev",
"build-essential", "liblapack-dev",
"pkg-config",
"autoconf",
"automake",
"libx265-dev",
"libde265-dev",
"libaom-dev",
# "darktable", # "darktable",
"mariadb-server", "mariadb-server",
] ]
packages_from_raw_bash = """ [resources.apt.extras.strukturag_libde265]
if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then repo = "deb https://ppa.launchpadcontent.net/strukturag/libde265/ubuntu focal main"
echo "libdlib19"; key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92"
elif [[ $YNH_DEBIAN_VERSION == "bookworm" ]]; then packages = [
echo "libdlib19.1"; "libde265-0",
fi "libde265-dev",
""" ]
[resources.apt.extras.strukturag_libheif]
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",
"libaom-dev",
"libx265-dev",
]
[resources.apt.extras.yarn] [resources.apt.extras.yarn]
repo = "deb https://dl.yarnpkg.com/debian/ stable main" repo = "deb https://dl.yarnpkg.com/debian/ stable main"

View file

@ -19,25 +19,6 @@ function set_go_vars {
go_shims_path=$goenv_install_dir/shims go_shims_path=$goenv_install_dir/shims
go_path_full="$go_shims_path":"$(sudo -u $app bash -c 'echo $PATH')" 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"
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 { function build_api {
@ -45,11 +26,8 @@ function build_api {
gobuild_env=( gobuild_env=(
"PATH=$go_path_full" "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" "GOENV_VERSION=$go_version"
CGO_ENABLED=1 "CGO_ENABLED=1"
) )
pushd "$install_dir/sources/api" || ynh_die pushd "$install_dir/sources/api" || ynh_die

View file

@ -27,7 +27,6 @@ ynh_install_nodejs --nodejs_version="$node_version"
ynh_script_progression --message="Setting up source files..." --weight=10 ynh_script_progression --message="Setting up source files..." --weight=10
ynh_setup_source --dest_dir="$install_dir/sources" 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} mkdir -p "$install_dir/output/"{data,ui}
@ -37,9 +36,6 @@ chown -R "$app:$app" "$data_dir"
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================
ynh_script_progression --message="Compiling libheif..." --weight=10
build_libheif
ynh_script_progression --message="Compiling Go API..." --weight=10 ynh_script_progression --message="Compiling Go API..." --weight=10
build_api build_api

View file

@ -46,7 +46,6 @@ ynh_install_nodejs --nodejs_version="$node_version"
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
ynh_setup_source --dest_dir="$install_dir/sources" --full_replace=1 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} mkdir -p "$install_dir/output/"{data,ui}
chown -R "$app:$app" "$install_dir" chown -R "$app:$app" "$install_dir"
@ -55,9 +54,6 @@ chown -R "$app:$app" "$data_dir"
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================
ynh_script_progression --message="Compiling libheif..." --weight=70
build_libheif
ynh_script_progression --message="Compiling Go API..." --weight=165 ynh_script_progression --message="Compiling Go API..." --weight=165
build_api build_api