From b6bf749927dc06f2e558eb0a145e0c9da64b501a Mon Sep 17 00:00:00 2001 From: ewilly Date: Mon, 21 Feb 2022 21:33:31 +0100 Subject: [PATCH 1/5] Fix missing libffi.so.7 --- scripts/_common.sh | 22 +++++++++++++++++++++- scripts/install | 4 ++++ scripts/upgrade | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 681b58f..6d6262a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 " \ diff --git a/scripts/install b/scripts/install index bcaf8c3..4f2a7bb 100644 --- a/scripts/install +++ b/scripts/install @@ -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" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8e51c99..4c261fa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #================================================= From b32b4877bc67054b97cb95b0da06d4b80e680603 Mon Sep 17 00:00:00 2001 From: ewilly Date: Tue, 22 Feb 2022 08:07:45 +0100 Subject: [PATCH 2/5] Fix myynh_compile_libffi --- scripts/_common.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 24debdc..8d05e0e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -44,12 +44,8 @@ myynh_create_dir () { 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" + wget "https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" 2>&1 # Extract tar zxf libffi-3.3.tar.gz From 60ec7b06b4b5842c025b1349c3182ea57e0e3f69 Mon Sep 17 00:00:00 2001 From: ewilly Date: Tue, 22 Feb 2022 20:45:29 +0100 Subject: [PATCH 3/5] Fix myynh_compile_libffi --- scripts/_common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8d05e0e..8e8e36b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -53,8 +53,11 @@ myynh_compile_libffi () { # Install cd libffi-3.3 ./configure - make install + ynh_exec_warn_less make install ldconfig + + #Exit + cd .. } # Install specific python version From df4cb376729f63ac225cc29376c3466a629338e0 Mon Sep 17 00:00:00 2001 From: ewilly Date: Wed, 23 Feb 2022 07:01:34 +0100 Subject: [PATCH 4/5] Update package version --- manifest.json | 2 +- scripts/_common.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 79a4d7c..c583e82 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Home automation platform", "fr": "Plateforme domotique" }, - "version": "2022.2.9~ynh1", + "version": "2022.2.9~ynh2", "url": "https://github.com/home-assistant/home-assistant", "upstream": { "license": "Apache-2.0", diff --git a/scripts/_common.sh b/scripts/_common.sh index 8e8e36b..445377b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -52,7 +52,7 @@ myynh_compile_libffi () { # Install cd libffi-3.3 - ./configure + ynh_exec_warn_less ./configure ynh_exec_warn_less make install ldconfig From e6d359c96e661ff98cccb34083ec4be29806a824 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Wed, 23 Feb 2022 06:01:46 +0000 Subject: [PATCH 5/5] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71789ea..71db09d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Home automation platform -**Shipped version:** 2022.2.9~ynh1 +**Shipped version:** 2022.2.9~ynh2 **Demo:** https://demo.home-assistant.io diff --git a/README_fr.md b/README_fr.md index 92c18ff..564cf6c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Plateforme domotique -**Version incluse :** 2022.2.9~ynh1 +**Version incluse :** 2022.2.9~ynh2 **Démo :** https://demo.home-assistant.io