Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No libheif #38

Open
wants to merge 10 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 21 additions & 28 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -91,33 +83,34 @@ ram.runtime = "200M"
"gpg",
"ffmpeg",
"exiftool",

"libheif1",
"ca-certificates",
"golang",
"libdlib-dev",
"libblas-dev",
"libatlas-base-dev",
"liblapack-dev",
"libblas-dev",
"libdlib-dev",
"libjpeg-dev",
"libheif-dev",
"build-essential",
"pkg-config",
"autoconf",
"automake",
"libx265-dev",
"libde265-dev",
"libaom-dev",
# "libjpeg62-turbo-dev",
"liblapack-dev",
# "darktable",
"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 focal main"
key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xc6610628a707a7e5e391d27a9641080a705c2b92"
packages = [
"libde265-0",
"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]
repo = "deb https://dl.yarnpkg.com/debian/ stable main"
Expand Down
24 changes: 1 addition & 23 deletions scripts/_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,15 @@ 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"

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 {
set_go_vars

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
Expand Down
4 changes: 0 additions & 4 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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

Expand Down
4 changes: 0 additions & 4 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down