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

Fix missing libffi.so.7

This commit is contained in:
ewilly 2022-02-21 21:33:31 +01:00
parent c14b0e58b7
commit b6bf749927
3 changed files with 28 additions and 1 deletions

View file

@ -41,6 +41,26 @@ myynh_create_dir () {
[ -d "$1" ] || mkdir -p "$1"
}
myynh_compile_libffi () {
ynh_print_info --message="Building libffi..."
# Create a temp direcotry
tmpdir="$(mktemp --directory)"
cd "$tmpdir"
# Download
wget "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"
# Extract
tar zxf libffi-3.3.tar.gz
# Install
cd libffi-3.3
./configure
make install
ldconfig
}
# Install specific python version
# usage: myynh_install_python --python="3.8.6"
# | arg: -p, --python= - the python version to install
@ -123,7 +143,7 @@ myynh_install_python () {
# Save python version in settings
ynh_app_setting_set --app=$app --key=python --value="$python"
}
# Install/Upgrade Homeassistant in virtual environement
myynh_install_homeassistant () {
ynh_exec_as $app -H -s /bin/bash -c " \

View file

@ -70,6 +70,10 @@ ynh_app_setting_set --app=$app --key=port --value="$port"
ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
# Install libffi-3.3 if libffi.so.7 is missing (buster)
[[ $(ldconfig -p | grep libffi.so.7) ]] || myynh_compile_libffi
myynh_install_python --python="$py_required_version"
#=================================================

View file

@ -153,6 +153,9 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
# Install libffi-3.3 if libffi.so.7 is missing (buster)
[[ $(ldconfig -p | grep libffi.so.7) ]] || myynh_compile_libffi
#=================================================
# UPDATE A CONFIG FILE
#=================================================