From e8320a2b93c17463b3353b368ee3b0f9156fa280 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Fri, 24 Jan 2020 20:17:29 +0100 Subject: [PATCH] Improved some scripts --- TeaSpeak | 2 +- build-helpers | 2 +- build_nice.md | 30 +++++++++++++++++++++++++++ build_teaspeak.sh | 32 +++++++++++++++++++---------- libraries/build_datapipes.sh | 9 +++++---- setup_arm | 39 ++++++++++++++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 17 deletions(-) create mode 100644 build_nice.md create mode 100644 setup_arm diff --git a/TeaSpeak b/TeaSpeak index 268dfb5..9e41b82 160000 --- a/TeaSpeak +++ b/TeaSpeak @@ -1 +1 @@ -Subproject commit 268dfb5bcf445802992d665a74834b875df698ae +Subproject commit 9e41b825c04999bb78411df23cb491dadeb02a18 diff --git a/build-helpers b/build-helpers index cf286a9..f5de1c7 160000 --- a/build-helpers +++ b/build-helpers @@ -1 +1 @@ -Subproject commit cf286a9673832c9febbe50c925ccb25aa1b3911e +Subproject commit f5de1c73285fc8e1c67c8e93af15d12f02597d14 diff --git a/build_nice.md b/build_nice.md new file mode 100644 index 0000000..a8eef66 --- /dev/null +++ b/build_nice.md @@ -0,0 +1,30 @@ +# Dependencies +## Python 3.6 +```shell script +wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz && \ +tar -xvf Python-3.6.3.tgz && \ +cd Python-3.6.3 && \ +sudo ./configure --enable-optimizations && \ +make -j32 && \ +sudo make install + +pip3.6 install --upgrade pip +``` + +## Ninja +```shell script +sudo apt install ninja +``` + +## Meson +```shell script +pip3.6 install meson +``` + +# Building GLIB2.0 +```shell script +git clone https://github.com/GNOME/glib.git && \ +cd glib && \ +git checkout glib-2-62 && \ +meson _build -Dlibmount=false +``` \ No newline at end of file diff --git a/build_teaspeak.sh b/build_teaspeak.sh index 72135ec..c603f27 100755 --- a/build_teaspeak.sh +++ b/build_teaspeak.sh @@ -1,5 +1,14 @@ +#!/bin/bash _build_helper_dir="$(pwd)/build-helpers" +# shellcheck disable=SC2154 +if [[ "$no_web" == "1" ]]; then + echo "Disabling web support" + export datapipes_webrtc=0 + _web_flag="OFF" +else + _web_flag="ON" +fi cd TeaSpeak || exit 1 if [ -d build ]; then @@ -8,26 +17,27 @@ fi mkdir build && cd build || exit 1 echo "Build type: ${TEASPEAK_BUILD_TYPE}" -cmake .. -DCMAKE_BUILD_TYPE="${TEASPEAK_BUILD_TYPE}" -DCMAKE_CXX_FLAGS=" ${CXX_FLAGS}" -DBUILD_INCLUDE_FILE="$_build_helper_dir"/cmake/config/tearoot-server.cmake -DCMAKE_MODULE_PATH="$_build_helper_dir"/cmake/ -DDISABLE_QT=1 -DDISABLE_CUSTOM_OUTPUT=ON -DDISABLE_QT=ON $TEASPEAK_DEPLOY_TYPE_SPECIFIER -if [[ $? -ne 0 ]]; then +cmake .. -DCMAKE_BUILD_TYPE="${TEASPEAK_BUILD_TYPE}" -DCMAKE_CXX_FLAGS=" ${CXX_FLAGS}" -DBUILD_INCLUDE_FILE="$_build_helper_dir"/cmake/config/tearoot-server.cmake -DCMAKE_MODULE_PATH="$_build_helper_dir"/cmake/ -DDISABLE_QT=1 -DDISABLE_CUSTOM_OUTPUT=ON -DDISABLE_QT=ON -DCOMPILE_WEB_CLIENT="$_web_flag" $TEASPEAK_DEPLOY_TYPE_SPECIFIER +_code=$? +if [[ $_code -ne 0 ]]; then echo "Failed to run CMAKE project" exit 1 fi -cmake --build "$(pwd)" --target ProviderFFMpeg -- -j 12 -if [[ $? -ne 0 ]]; then - echo "Failed to build ffmpeg" +cmake --build "$(pwd)" --target ProviderFFMpeg -- -j 12; _code=$? +if [[ $_code -ne 0 ]]; then + echo "Failed to build ffmpeg ($_code)" exit 1 fi -cmake --build "$(pwd)" --target ProviderYT -- -j 12 -if [[ $? -ne 0 ]]; then - echo "Failed to build YT" +cmake --build "$(pwd)" --target ProviderYT -- -j 12; _code=$? +if [[ $_code -ne 0 ]]; then + echo "Failed to build YT ($_code)" exit 1 fi -cmake --build "$(pwd)" --target TeaSpeakServer -- -j 12 -if [[ $? -ne 0 ]]; then - echo "Failed to build server" +cmake --build "$(pwd)" --target TeaSpeakServer -- -j 12; _code=$? +if [[ $_code -ne 0 ]]; then + echo "Failed to build server ($_code)" exit 1 fi diff --git a/libraries/build_datapipes.sh b/libraries/build_datapipes.sh index 552733f..0fcee45 100755 --- a/libraries/build_datapipes.sh +++ b/libraries/build_datapipes.sh @@ -11,7 +11,10 @@ source ${build_helper_file} requires_rebuild ${library_path} [[ $? -eq 0 ]] && exit 0 -if [[ ${build_os_type} != "win32" ]]; then +[[ -z "${datapipes_webrtc}" ]] && datapipes_webrtc=1 +[[ "${datapipes_webrtc}" -eq 1 ]] && _datapipes_webrtc="ON" || datapipes_webrtc="OFF" + +if [[ ${build_os_type} != "win32" && "${_datapipes_webrtc}" == "ON" ]]; then cd ${library_path} #echo "Testing for libnice" @@ -34,12 +37,10 @@ if [[ ${build_os_type} != "win32" ]]; then cd .. fi -[[ -z "${datapipes_webrtc}" ]] && datapipes_webrtc=1 -[[ "${datapipes_webrtc}" -eq 1 ]] && _datapipes_webrtc="ON" || datapipes_webrtc="OFF" _cxx_options="" [[ ${build_os_type} != "win32" ]] && _cxx_options="-fPIC -static-libgcc -static-libstdc++" [[ ${build_os_type} == "win32" ]] && _cxx_options="-DWIN32" -cmake_build ${library_path} -DCrypto_ROOT_DIR="`pwd`/boringssl/" -DCRYPTO_TYPE="boringssl" -DCMAKE_CXX_FLAGS="-fPIC -static-libgcc -static-libstdc++ ${CXX_FLAGS}" -DBUILD_TESTS=OFF -DCMAKE_C_FLAGS="${C_FLAGS} -fPIC" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" ${CMAKE_OPTIONS} -DLIBNICE_PREBUILD_PATH="../libnice/linux_${build_os_arch}" -DGLIBC_PREBUILD_PATH="../glibc/linux_${build_os_arch}" -DBUILD_STATIC=0 -DBUILD_SHARED=1 +cmake_build ${library_path} -DCrypto_ROOT_DIR="`pwd`/boringssl/" -DCRYPTO_TYPE="boringssl" -DCMAKE_CXX_FLAGS="-fPIC -static-libgcc -static-libstdc++ ${CXX_FLAGS}" -DBUILD_TESTS=OFF -DCMAKE_C_FLAGS="${C_FLAGS} -fPIC" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" ${CMAKE_OPTIONS} -DLIBNICE_PREBUILD_PATH="../libnice/linux_${build_os_arch}" -DGLIBC_PREBUILD_PATH="../glibc/linux_${build_os_arch}" -DBUILD_STATIC=0 -DBUILD_SHARED=1 -DBUILD_WEBRTC=${_datapipes_webrtc} check_err_exit ${library_path} "Failed to build DataPipes!" set_build_successful ${library_path} diff --git a/setup_arm b/setup_arm new file mode 100644 index 0000000..dad4804 --- /dev/null +++ b/setup_arm @@ -0,0 +1,39 @@ +sudo apt-get update && \ +sudo apt-get install build-essential software-properties-common -y && \ +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ +sudo apt-get update + +sudo apt-get install gcc-9 g++-9 -y && \ +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 && \ +sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-9 60 --slave /usr/bin/c++ c++ /usr/bin/c++-9 + +apt-get install autoconf git wget libssl-dev realpath + +wget https://github.com/Kitware/CMake/releases/download/v3.16.3/cmake-3.16.3.tar.gz && tar xvf cmake-3.16.3.tar.gz +cd cmake-3.16.3 && ./configure --parallel=16 +make -j16 && make install +cd .. + +git config --global credential.helper store + +# Patchelf +wget http://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2 +tar xf patchelf-0.10.tar.bz2 +cd patchelf-0.10 +./configure +make install + +# Create TeaSpeak +git clone https://git.did.science/WolverinDEV/TeaSpeak-Parent.git server && cd server && \ +git submodule update --init --recursive +./libraries/build.sh + + + + +# -------- Troubleshooting ---------- +If go raises an error/crashes install a newer version: +$ sudo add-apt-repository ppa:gophers/archive +$ sudo apt-get update +$ sudo apt-get install golang-1.11-go +sudo update-alternatives --install /usr/bin/go go /usr/lib/go-1.11/bin/go 1 \ No newline at end of file