Skip to content

Commit

Permalink
feat: Linuxインストーラーでインストールするバージョンが0.15以上のときlibsndfileのチェックをスキップする (#1613)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune authored Oct 19, 2023
1 parent bc1d6ab commit 653b9bc
Showing 1 changed file with 32 additions and 28 deletions.
60 changes: 32 additions & 28 deletions build/installer_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 653b9bc

Please sign in to comment.