From f5f1a8dcee3f32e54c01545ff0ff90ea6604ff16 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Wed, 23 Oct 2019 13:28:52 +0200 Subject: [PATCH] + build & update & install script --- build.sh | 20 ++++++++++ install.sh | 113 +++++++++++++++++++++++++++-------------------------- update.sh | 19 +++++++++ 3 files changed, 97 insertions(+), 55 deletions(-) create mode 100755 build.sh mode change 100644 => 100755 install.sh create mode 100755 update.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..56007cc --- /dev/null +++ b/build.sh @@ -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 \ No newline at end of file diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 0a86ba3..c41912a --- a/install.sh +++ b/install.sh @@ -1,81 +1,84 @@ -#!/usr/bin/env bash +#!/bin/bash -# installing package, $1 = pacman; $2 = apt-get -install() { +debian=false; +arch=false; +mac=false; + +# get operating system +os_info() { declare -A osInfo; - osInfo[/etc/arch-release]=pacman - osInfo[/etc/debian_version]=apt-get + osInfo[/etc/arch-release]=arch + osInfo[/etc/debian_version]=debian + osInfo[/usr/local/Homebrew]=mac for f in ${!osInfo[@]} do if [[ -f $f ]];then - manager = ${osInfo[$f]} - if [[manager == 'pacman']] then - pacman -S $1 - elif [[ manager == 'apt-get' ]]; then - apt-get install $2 + if [[ ${osInfo[$f]} == 'arch' ]]; then + arch=true; + elif [[ ${osInfo[$f]} == 'debian' ]]; then + debian=true; + elif [[ ${osInfo[$f]} == 'mac' ]]; then + mac=true; fi fi 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' -case "$(uname -s)" in - Darwin) - os = 'mac' - ;; +install 'clang' 'clang' 'clang' +install 'make' 'make' 'make' +install 'cmake' 'cmake' 'cmake' +install 'null' 'clang-tidy' 'clang-tidy' +install 'fltk' 'libfltk1.3 libfltk1.3-dev' 'fltk' +install 'catch2' 'null' 'catch2' - Linux) - echo 'Linux' - ;; +if [[ $apt ]]; then - CYGWIN*|MINGW*|MSYS*) - os = 'windows' - ;; + git clone https://github.com/catchorg/Catch2.git + cd Catch2 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install - # Add here more strings to compare - # See correspondence table at the bottom of this answer +fi - *) - echo 'other OS' - ;; -esac +echo "cloning repositories" +cd .. -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' - -# 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 +echo "installation completed" +./build.sh \ No newline at end of file diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..c63d817 --- /dev/null +++ b/update.sh @@ -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 \ No newline at end of file