mirror of
https://github.com/falk-werner/webfused
synced 2024-10-27 20:44:08 +00:00
55 lines
1.1 KiB
Bash
Executable File
55 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
. deps.sh
|
|
|
|
set -e
|
|
|
|
install_package() {
|
|
local PACKAGE="$1"
|
|
local PACKAGE_VERSION="${PACKAGE}_VERSION"
|
|
local PACKAGE_URL="${PACKAGE}_URL"
|
|
local PACKAGE_MD5="${PACKAGE}_MD5"
|
|
local PACKAGE_TYPE="${PACKAGE}_TYPE"
|
|
local PACKAGE_DIR="${PACKAGE}_DIR"
|
|
local FILENAME="${PACKAGE}_${!PACKAGE_VERSION}.tar.gz"
|
|
|
|
wget "${!PACKAGE_URL}" -O "${FILENAME}"
|
|
md5sum -c <(echo "${!PACKAGE_MD5}" "${FILENAME}")
|
|
tar -xf ${FILENAME}
|
|
|
|
case "${!PACKAGE_TYPE}" in
|
|
meson)
|
|
cd "${!PACKAGE_DIR}"
|
|
meson build
|
|
cd build
|
|
ninja
|
|
sudo ninja install
|
|
cd ../..
|
|
;;
|
|
cmake)
|
|
mkdir "${!PACKAGE_DIR}/build"
|
|
cd "${!PACKAGE_DIR}/build"
|
|
cmake ..
|
|
make
|
|
sudo make install
|
|
cd ../..
|
|
;;
|
|
*)
|
|
echo "error: unknown package type ${!PACKAGE_TYPE}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
}
|
|
|
|
|
|
CURRENT_DIR=$(pwd)
|
|
WORKING_DIR=$(mktemp -d /tmp/install_deps_XXXXXX)
|
|
cd ${WORKING_DIR}
|
|
|
|
for package in ${PACKAGES} ; do
|
|
install_package $package
|
|
done
|
|
|
|
cd ${CURRENT_DIR}
|
|
#rm -rf ${WORKING_DIR}
|