mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-17 16:36:49 +00:00
40 lines
974 B
Bash
Executable file
40 lines
974 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
WEBP_VERSION="1.5.0"
|
|
WEBP_TAR_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz"
|
|
WEBP_TAR_FILE="/tmp/libwebp-${WEBP_VERSION}.tar.gz"
|
|
WEBP_SRC_DIR="/tmp/libwebp-${WEBP_VERSION}"
|
|
|
|
prepare_source() {
|
|
cd /tmp
|
|
|
|
# Remove old files if they exist
|
|
[ -f "$WEBP_TAR_FILE" ] && rm "$WEBP_TAR_FILE"
|
|
[ -d "$WEBP_SRC_DIR" ] && rm -rf "$WEBP_SRC_DIR"
|
|
|
|
wget "$WEBP_TAR_URL"
|
|
tar -xzf "$WEBP_TAR_FILE"
|
|
cd "$WEBP_SRC_DIR"
|
|
}
|
|
|
|
build_and_install() {
|
|
export MAKEFLAGS=-j$(nproc)
|
|
CONFIG_FLAGS=( --enable-static --disable-shared --enable-threading --prefix="$HOME/.local")
|
|
ARCH=$(arch)
|
|
|
|
if [ "$ARCH" = "x86_64" ]; then
|
|
CONFIG_FLAGS+=( --enable-sse2 )
|
|
elif [ "$ARCH" = "aarch64" ]; then
|
|
CONFIG_FLAGS+=( --enable-neon )
|
|
else
|
|
echo "Unsupported architecture: $ARCH" && exit 1;
|
|
fi
|
|
|
|
./configure "${CONFIG_FLAGS[@]}"
|
|
make install
|
|
}
|
|
|
|
prepare_source
|
|
build_and_install
|