2020-10-14 17:10:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-14 17:48:53 +00:00
|
|
|
. deps.sh
|
2020-10-14 17:10:31 +00:00
|
|
|
|
|
|
|
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
|
2020-10-14 19:49:21 +00:00
|
|
|
meson compile -C build
|
|
|
|
sudo meson install -C build
|
|
|
|
# DESTDIR=$DESTDIR ninja install
|
|
|
|
cd ..
|
2020-10-14 17:10:31 +00:00
|
|
|
;;
|
|
|
|
cmake)
|
|
|
|
mkdir "${!PACKAGE_DIR}/build"
|
|
|
|
cd "${!PACKAGE_DIR}/build"
|
|
|
|
cmake ..
|
|
|
|
make
|
2020-10-14 17:48:53 +00:00
|
|
|
sudo make install
|
2020-10-14 19:49:21 +00:00
|
|
|
# DESTDIR=$DESTDIR make install
|
2020-10-14 17:10:31 +00:00
|
|
|
cd ../..
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "error: unknown package type ${!PACKAGE_TYPE}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-10-14 19:49:21 +00:00
|
|
|
#DESTDIR=$(realpath .)/.deps
|
|
|
|
#rm -rf .${DESTDIR}
|
|
|
|
#mkdir ${DESTDIR}
|
2020-10-14 17:10:31 +00:00
|
|
|
|
|
|
|
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}
|