+ build & update & install script

This commit is contained in:
Johannes Theiner 2019-10-23 13:28:52 +02:00
parent 7654c1f577
commit f5f1a8dcee
3 changed files with 97 additions and 55 deletions

20
build.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
echo 'building all components'
cd ..
for d in */; do
cd "$d"
FILE=build
if [ -f $FILE ]; then
echo 'building component ' + $d
cd build
cmake ..
make
make test
cd ..
fi
cd ..
done

113
install.sh Normal file → Executable file
View File

@ -1,81 +1,84 @@
#!/usr/bin/env bash #!/bin/bash
# installing package, $1 = pacman; $2 = apt-get debian=false;
install() { arch=false;
mac=false;
# get operating system
os_info() {
declare -A osInfo; declare -A osInfo;
osInfo[/etc/arch-release]=pacman osInfo[/etc/arch-release]=arch
osInfo[/etc/debian_version]=apt-get osInfo[/etc/debian_version]=debian
osInfo[/usr/local/Homebrew]=mac
for f in ${!osInfo[@]} for f in ${!osInfo[@]}
do do
if [[ -f $f ]];then if [[ -f $f ]];then
manager = ${osInfo[$f]} if [[ ${osInfo[$f]} == 'arch' ]]; then
if [[manager == 'pacman']] then arch=true;
pacman -S $1 elif [[ ${osInfo[$f]} == 'debian' ]]; then
elif [[ manager == 'apt-get' ]]; then debian=true;
apt-get install $2 elif [[ ${osInfo[$f]} == 'mac' ]]; then
mac=true;
fi fi
fi fi
done done
} }
# check operating system # installing package, $1 = pacman; $2 = apt-get, $3 = homebrew
install() {
if [ $debian == true ] && [ $2 != 'null' ]; then
sudo apt-get install $2
elif [ $arch == true ] && [ $1 != 'null' ]; then
sudo pacman -S $1
elif [ $mac == true ] && [ $3 != 'null' ]; then
sudo brew install $3
fi
}
os_info
os = 'unknown' install 'clang' 'clang' 'clang'
case "$(uname -s)" in install 'make' 'make' 'make'
Darwin) install 'cmake' 'cmake' 'cmake'
os = 'mac' install 'null' 'clang-tidy' 'clang-tidy'
;; install 'fltk' 'libfltk1.3 libfltk1.3-dev' 'fltk'
install 'catch2' 'null' 'catch2'
Linux) if [[ $apt ]]; then
echo 'Linux'
;;
CYGWIN*|MINGW*|MSYS*) git clone https://github.com/catchorg/Catch2.git
os = 'windows' cd Catch2
;; cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
# Add here more strings to compare fi
# See correspondence table at the bottom of this answer
*) echo "cloning repositories"
echo 'other OS' cd ..
;;
esac
echo $os git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/library.git
mkdir library/build
# install git git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/shared-memory.git
mkdir shared-memory/build
install 'git' 'git' git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/text-renderer.git
mkdir text-renderer/build
# install g++/clang git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/gui.git
mkdir gui/build
install 'g++' 'g++' git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/terminal.git
mkdir terminal/build
# install make git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/simple-draw.git
mkdir simple-draw/build
install 'make' 'make' git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/demo.git
mkdir demo/build
# install cmake cd Scripts
install 'cmake' 'cmake' echo "installation completed"
./build.sh
# install fltk
install 'fltk-dev' 'libfltk1.3 libfltk1.3-dev'
# install catch2
install 'catch2' 'catch'
# clone rendering
git clone https://gitea.joethei.xyz/vKVM/Rendering.git
# clone library
git clone https://gitea.joethei.xyz/vKVM/Library.git
# clone clients

19
update.sh Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
echo 'updating all components'
cd ..
for d in */; do
cd "$d"
FILE=build
if [ -f $FILE ]; then
echo 'updating componenent ' + $d
git pull
fi
cd ..
done
cd
./build.sh