From 653b9bcb3aff4cab90180c920b2a50e773800284 Mon Sep 17 00:00:00 2001 From: sabonerune <102559104+sabonerune@users.noreply.github.com> Date: Fri, 20 Oct 2023 02:49:09 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Linux=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=A9=E3=83=BC=E3=81=A7=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=BC=E3=83=AB=E3=81=99=E3=82=8B=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=8C0.15=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E3=81=AE=E3=81=A8=E3=81=8Dlibsndfile=E3=81=AE?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92=E3=82=B9=E3=82=AD?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=81=99=E3=82=8B=20(#1613)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/installer_linux.sh | 60 +++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/build/installer_linux.sh b/build/installer_linux.sh index 7fea7dd6bd..32da8a810e 100755 --- a/build/installer_linux.sh +++ b/build/installer_linux.sh @@ -123,25 +123,43 @@ EOS fi echo "[-] 7z command: ${COMMAND_7Z}" -echo "[+] Checking runtime prerequisites..." +LATEST_RELEASE_URL=$REPO_URL/releases/latest -PATH=${PATH}:/usr/local/sbin:/usr/sbin:/sbin -if ! command -v ldconfig &> /dev/null; then - cat << EOS && exit 1 +if [ -z "${VERSION}" ]; then + echo "[+] Checking the latest version..." + + # releases/tag/{version} + RELEASE_TAG_URL=$(curl -fsSL -o /dev/null -w '%{url_effective}' "${LATEST_RELEASE_URL}") + + # extract version (release tag name) from URL + VERSION=$(echo "${RELEASE_TAG_URL}" | sed 's/.*\/\(.*\)$/\1/') + echo "[-] Install version: ${VERSION} (latest)" +else + echo "[-] Install version: ${VERSION}" +fi + +IFS=" " read -r -a VERSION_ARRAY <<< "${VERSION//[.+-]/ }" +if [ "${VERSION_ARRAY[0]}" -eq 0 ] && [ "${VERSION_ARRAY[1]}" -le 14 ]; then + # Check when version < 0.15 + echo "[+] Checking runtime prerequisites..." + + PATH=${PATH}:/usr/local/sbin:/usr/sbin:/sbin + if ! command -v ldconfig &> /dev/null; then + cat << EOS && exit 1 [!] Command 'ldconfig' not found Required to check existence of required libraries. You must add a directory of contain ldconfig command to PATH environment variable. EOS -fi + fi -if { ldconfig -p | grep 'libsndfile\.so';} &>/dev/null; then - echo "[-] libsndfile: OK" -elif [ -d /usr/local/Cellar/libsndfile ]; then - echo "[-] libsndfile: OK" -else - cat << 'EOS' + if { ldconfig -p | grep 'libsndfile\.so';} &>/dev/null; then + echo "[-] libsndfile: OK" + elif [ -d /usr/local/Cellar/libsndfile ]; then + echo "[-] libsndfile: OK" + else + cat << 'EOS' [!] libsndfile: not found Required to run VOICEVOX ENGINE @@ -160,26 +178,12 @@ Arch Linux MacOS: brew install libsndfile EOS - if [ "${IGNORE_RTCOND}" != "1" ]; then - exit 1 + if [ "${IGNORE_RTCOND}" != "1" ]; then + exit 1 + fi fi fi -LATEST_RELEASE_URL=$REPO_URL/releases/latest - -if [ -z "${VERSION}" ]; then - echo "[+] Checking the latest version..." - - # releases/tag/{version} - RELEASE_TAG_URL=$(curl -fsSL -o /dev/null -w '%{url_effective}' "${LATEST_RELEASE_URL}") - - # extract version (release tag name) from URL - VERSION=$(echo "${RELEASE_TAG_URL}" | sed 's/.*\/\(.*\)$/\1/') - echo "[-] Install version: ${VERSION} (latest)" -else - echo "[-] Install version: ${VERSION}" -fi - RELEASE_URL=${REPO_URL}/releases/download/${VERSION} ARCHIVE_LIST_URL=${RELEASE_URL}/${NAME}.7z.txt