diff --git a/.gitmodules b/.gitmodules index 6b463e4..d0650f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -44,10 +44,6 @@ [submodule "libraries/breakpad"] path = libraries/breakpad url = https://chromium.googlesource.com/breakpad/breakpad -[submodule "libraries/mysqlconnector"] - path = libraries/mysqlconnector - url = https://github.com/mysql/mysql-connector-cpp.git - checkout = 8.0.12 [submodule "libraries/boringssl"] path = libraries/boringssl url = https://boringssl.googlesource.com/boringssl @@ -65,3 +61,6 @@ [submodule "Web-Client"] path = Web-Client url = https://github.com/TeaSpeak/TeaWeb.git +[submodule "build-helpers"] + path = build-helpers + url = https://github.com/WolverinDEV/build-helpers.git diff --git a/Jenkinsfile b/Jenkinsfile index b0e0671..528af4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,13 +32,16 @@ pipeline { when { expression { params.target == "x64_debug" || params.target == "x64_release" || params.target == "x64_stable" } } + + environment { + build_os_type="linux" + build_os_type="x64" + } stages { /* first of all we have to update our libraries */ stage ('libraries::update') { steps { - sh 'git reset --hard origin/master;' - sh 'git submodule update --merge' sh './attach_modules.sh' } } @@ -161,13 +164,16 @@ pipeline { when { expression { params.target == "x86_debug" || params.target == "x86_release" || params.target == "x86_stable" } } + + environment { + build_os_type="linux" + build_os_type="x86" + } stages { /* first of all we have to update our libraries */ stage ('libraries::update') { steps { - sh 'git reset --hard origin/master;' - sh 'git submodule update --merge' sh './attach_modules.sh' } } diff --git a/Jenkinsfile.save b/Jenkinsfile.save deleted file mode 100644 index c73ce36..0000000 --- a/Jenkinsfile.save +++ /dev/null @@ -1,209 +0,0 @@ -`pipeline { - agent any - - parameters { - booleanParam(defaultValue: false, description: 'Enabled/disables the building of an optimized build', name: 'build_optimized') - booleanParam(defaultValue: true, description: 'Build the libraries as well', name: 'build_libraries') - booleanParam(defaultValue: true, description: 'Deploy this build', name: 'deploy_build') - choice(choices: ['all', 'x86_debug', 'x64_debug', 'x64_release'], description: 'Which target do you want to build?', name: 'target') - } - - environment { - //General flags - CXX_FLAGS = '' - C_FLAGS = '' - - //CMake specific flags - CMAKE_OPTIONS = '' - CMAKE_MAKE_OPTIONS = '-j 12' - - //Make specific flags - MAKE_OPTIONS = '-j 12' - } - - stages { - stage ('build') { - parallel { - stage ('build::x86::debug') { - agent { - label 'linux && x84 && teaspeak' - } - when { - expression { params.target == "" || params.target == "all" || params.target == "x86_debug" } - } - - stages { - stage ('build::x86::debug::libraries') { - stages { - stage ('build::x86::debug::libraries::update') { - steps { - sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force' - sh 'git submodule update --merge' - sh './attach_modules.sh' - } - } - - stage ('build::x86::debug::libraries::build') { - when { - expression { params.build_libraries } - } - - environment { - CMAKE_BUILD_TYPE="Debug" - } - - steps { - sh 'cd libraries; ./build.sh' - } - } - } - } - - - stage ('build::x86::debug') { - environment { - TEASPEAK_BUILD_TYPE="Debug" - } - environment { - CMAKE_BUILD_TYPE="Debug" - } - - stages { - stage ('build::x86::debug::build') { - steps { - sh './build_teaspeak.sh' - } - } - stage ('build::x86::debug::deploy') { - when { - expression { params.deploy_build } - } - steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/x86' - } - } - } - } - } - } - - stage ('build::amd64::debug') { - agent { - label 'linux && amd64 && teaspeak' - } - when { - expression { params.target == "" || params.target == "all" || params.target == "x64_debug" } - } - - stages { - stage ('build::amd64::debug::libraries') { - stages { - stage ('build::amd64::debug::libraries::update') { - steps { - sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force' - sh 'git submodule update --merge' - sh './attach_modules.sh' - } - } - - stage ('build::amd64::debug::libraries::build') { - when { - expression { params.build_libraries } - } - - environment { - CMAKE_BUILD_TYPE="Debug" - } - - steps { - sh 'cd libraries; ./build.sh' - } - } - } - } - - stage ('build::amd64::debug::build') { - environment { - TEASPEAK_BUILD_TYPE="Debug" - CMAKE_BUILD_TYPE="Debug" - } - - steps { - sh './build_teaspeak.sh' - } - } - - stage ('build::amd64::debug::deploy') { - when { - expression { params.deploy_build } - } - - steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64' - } - } - } - } - - stage ('build::amd64::release::deploy') { - when { - expression { params.target == "all" || params.target == "x64_release" || params.build_optimized } - } - - agent { - label 'linux && amd64 && teaspeak' - } - - stages { - stage ('build::amd64::release::libraries') { - stages { - stage ('build::amd64::release::libraries::update') { - steps { - sh 'git reset --hard origin/master; git submodule update --init --remote --recursive --force' - sh 'git submodule update --merge' - sh './attach_modules.sh' - } - } - - stage ('build::amd64::release::libraries::build') { - when { - expression { params.build_libraries } - } - - environment { - CMAKE_BUILD_TYPE="RelWithDebInfo" - } - - steps { - sh 'cd libraries; ./build.sh' - } - } - } - } - - stage ('build::amd64::release::build') { - environment { - TEASPEAK_BUILD_TYPE="Release" - CMAKE_BUILD_TYPE="RelWithDebInfo" - } - - steps { - sh './build_teaspeak.sh' - } - } - - stage ('build::amd64::release::deploy') { - when { - expression { params.deploy_build } - } - - steps { - sh 'cd TeaSpeak/server/repro/; chmod 400 build_private_key; ./build.sh linux/amd64_optimized' - } - } - } - } - } - } - } -} diff --git a/TeaSpeak b/TeaSpeak index 0a762ee..e39f01b 160000 --- a/TeaSpeak +++ b/TeaSpeak @@ -1 +1 @@ -Subproject commit 0a762eef7671c21984672b866058d15af5bd261f +Subproject commit e39f01bde548b083255ad650619de441361f9200 diff --git a/attach_modules.sh b/attach_modules.sh index ca3b290..441ccbc 100755 --- a/attach_modules.sh +++ b/attach_modules.sh @@ -2,24 +2,17 @@ #General modules should be set to their versions git reset --hard -git submodule foreach -q --recursive 'git reset --hard' -git submodule update --init --recursive --force +#git submodule foreach -q --recursive 'git reset --hard' +#git submodule update --init --recursive --force #git submodule update --init --remote --recursive --force TeaSpeak -#The libs have no need to be attach to the master :) cd TeaSpeak -echo "Resetting TeaSpeak submodule" -git reset --hard origin/head -git pull origin master - +echo "Building TeaSpeak at version $(git rev-parse HEAD)" cd .. -git submodule update --init --remote --recursive --force -git submodule foreach -q --recursive ' -echo "Updating $name"; -BRANCH=$(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master) -if [ -z ${BRANCH} ]; then - BRANCH="master" -fi -git checkout ${BRANCH}; -echo "git pull origin ${BRANCH}" -git pull origin ${BRANCH}' + +echo "uPDATING submodules" +git submodule update --init --recursive +[[ $? -ne 0 ]] && { + echo "Failed to update submodules. Aborting" + exit 1 +} diff --git a/build-helpers b/build-helpers new file mode 160000 index 0000000..0b83e74 --- /dev/null +++ b/build-helpers @@ -0,0 +1 @@ +Subproject commit 0b83e74e2df4b084d256ea3cea0be64e01ef6da3 diff --git a/build_info.txt b/build_info.txt deleted file mode 100644 index a9f4ca2..0000000 --- a/build_info.txt +++ /dev/null @@ -1,20 +0,0 @@ -Improved (Fixed): - Tomcrypt - Tommath - Boringssl - -DataPipes: - -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" - Libraries: - -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" - -StringVariables: -ThreadPool - -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" - -ED255: -EVENT: -JSONCPP: -MYSQLCONNECTOR: -PROTOBUF: --DCMAKE_BUILD_TYPE=RelWithDebInfo diff --git a/cmake-build-debug/CMakeFiles/clion-log.txt b/cmake-build-debug/CMakeFiles/clion-log.txt deleted file mode 100644 index bb08bee..0000000 --- a/cmake-build-debug/CMakeFiles/clion-log.txt +++ /dev/null @@ -1 +0,0 @@ -CMakeLists.txt not found in /home/wolverindev/TeaSpeak diff --git a/libraries/CXXTerminal b/libraries/CXXTerminal index d44e435..31c265f 160000 --- a/libraries/CXXTerminal +++ b/libraries/CXXTerminal @@ -1 +1 @@ -Subproject commit d44e435f1ec8b130df5f9db2868e9abf94ddf9d2 +Subproject commit 31c265f9d15a38689b213fc57f861caa01c2d83b diff --git a/libraries/DataPipes b/libraries/DataPipes index f357bcf..4f199d0 160000 --- a/libraries/DataPipes +++ b/libraries/DataPipes @@ -1 +1 @@ -Subproject commit f357bcfad87dfb25f0bc4941d41506b17ec6d576 +Subproject commit 4f199d074580a6cf591b6300024c09f4e5101326 diff --git a/libraries/StringVariable b/libraries/StringVariable index b4b64d5..6613f64 160000 --- a/libraries/StringVariable +++ b/libraries/StringVariable @@ -1 +1 @@ -Subproject commit b4b64d5b58b5fc2e51c66aca94022e7b8d21b613 +Subproject commit 6613f642a0b78bd850c5774298e5b6c24a673545 diff --git a/libraries/Thread-Pool b/libraries/Thread-Pool index 30e8c6f..ec7b852 160000 --- a/libraries/Thread-Pool +++ b/libraries/Thread-Pool @@ -1 +1 @@ -Subproject commit 30e8c6f36fe246aa8974c9b1748621b19b66c552 +Subproject commit ec7b852f8e25c1e7d7f9d87c19ca7a8d9063a7aa diff --git a/libraries/boringssl b/libraries/boringssl index fdb48f9..6f3e034 160000 --- a/libraries/boringssl +++ b/libraries/boringssl @@ -1 +1 @@ -Subproject commit fdb48f98612e934eab339b4871484b1c987553e2 +Subproject commit 6f3e034fe58ce3bca3c1c32be6d603a6206c89af diff --git a/libraries/breakpad b/libraries/breakpad index 948ce04..db1cda2 160000 --- a/libraries/breakpad +++ b/libraries/breakpad @@ -1 +1 @@ -Subproject commit 948ce04ed74397331c158c13209fd2370c2dbd5a +Subproject commit db1cda26539c711c3da7ed4d410dfe8190e89b8f diff --git a/libraries/build_boringssl.sh b/libraries/build_boringssl.sh index 5193135..f2c1238 100755 --- a/libraries/build_boringssl.sh +++ b/libraries/build_boringssl.sh @@ -5,14 +5,20 @@ if [ ! -d lib ]; then ln -s ../build/crypto/libcrypto.so . cd .. fi -cat include/openssl/opensslv.h | grep "OPENSSL_VERSION_NUMBER" &> /dev/null +cat include/openssl/opensslv.h | grep "OPENSSL_VERSION_TEXT" &> /dev/null if [ $? -ne 0 ]; then - echo "#if false + echo '#if false # define OPENSSL_VERSION_NUMBER 0x1010008fL -#endif" > include/openssl/opensslv.h +#define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1a 20 Nov 2018" +#endif' > include/openssl/opensslv.h fi cd build -sudo apt-get install golang-go + +dpkg -s golang-go &>/dev/null +if [[ $? -ne 0 ]]; then + echo "Installing golang" + sudo apt-get install golang-go +fi if [ "x86" == "${BUILD_ARCH_TARGET}" ]; then echo "Build boring SSL in 32 bit mode!" diff --git a/libraries/build_breakpad.sh b/libraries/build_breakpad.sh index 03164eb..74155a9 100755 --- a/libraries/build_breakpad.sh +++ b/libraries/build_breakpad.sh @@ -1,5 +1,14 @@ cd breakpad/ -git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss +if [[ ! -d src/third_party/lss ]]; then + echo "Closing LSS into breakpad" + git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss + + [[ $? -ne 0 ]] && { + echo "Failed to close LSS. Abort" + exit 1 + } +fi + cd build ../configure make CXXFLAGS="-std=c++11 -I../../boringssl/include/ ${CXX_FLAGS}" CFLAGS="${C_FLAGS}" ${MAKE_OPTIONS} diff --git a/libraries/build_cxxterminal.sh b/libraries/build_cxxterminal.sh index cc51a39..35e3be3 100755 --- a/libraries/build_cxxterminal.sh +++ b/libraries/build_cxxterminal.sh @@ -1,6 +1,5 @@ -cd CXXTerminal/libraries/ -./build_event.sh #TODO test status! -cd ../build/ -cmake .. -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_C_FLAGS="${C_FLAGS}" -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS} +cd CXXTerminal/build/ +event_path=$(realpath ../../event/build) +cmake .. -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_C_FLAGS="${C_FLAGS}" -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DNO_EMBETTED_LIBEVENT=1 -DLibevent_DIR=${event_path} ${CMAKE_OPTIONS} make ${CMAKE_MAKE_OPTIONS} sudo make install diff --git a/libraries/build_event.sh b/libraries/build_event.sh index cf97c0c..b72decd 100755 --- a/libraries/build_event.sh +++ b/libraries/build_event.sh @@ -1,4 +1,4 @@ cd event/build/ -cmake .. -DCMAKE_C_FLAGS="-fPIC -I../../boringssl/include/ ${C_FLAGS}" -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_OPENSSL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS} +cmake .. -DCMAKE_C_FLAGS="-fPIC -I../../boringssl/include/ ${C_FLAGS}" -DEVENT__DISABLE_TESTS=ON -DEVENT__DISABLE_OPENSSL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS} make ${CMAKE_MAKE_OPTIONS} sudo make install diff --git a/libraries/build_jemalloc.sh b/libraries/build_jemalloc.sh index 281e936..42b3115 100755 --- a/libraries/build_jemalloc.sh +++ b/libraries/build_jemalloc.sh @@ -1,25 +1,37 @@ #!/bin/bash -cd jemalloc/ +source ../build-helpers/build_helper.sh || { echo "Failed to include build helper script. Abort"; exit 1; } +library_path=jemalloc +requires_rebuild ${library_path} +[[ $? -eq 0 ]] && exit 0 + +# Generate the configure file +cd jemalloc if ! [ -f configure ]; then autoconf - if [ $? -ne 0 ]; then - echo "Failed to create configure file" - exit 1 - fi + check_err_exit ${library_path} "Failed to create configure file" if ! [ -f configure ]; then - echo "Failed to create configure file" + err_exit ${library_path} "Failed to create configure file" exit 1 fi fi +cd .. -cd build -../configure -if [ $? -ne 0 ]; then - echo "Failed to create makefile" - exit 1 +# Generate the build environment +generate_build_path "${library_path}" +if [[ -d ${build_path} ]]; then + echo "Removing old build directory" + rm -rf ${build_path} fi +mkdir -p ${build_path} +check_err_exit ${library_path} "Failed to create build directory" +cd ${build_path} +check_err_exit ${library_path} "Failed to enter build directory" + +# Building jemalloc +../../configure +check_err_exit ${library_path} "Failed to create makefile" (cat Makefile | sed 's/.*$(CC) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS).*/ $(CXX) $(DSO_LDFLAGS) $(call RPATH,$(RPATH_EXTRA)) $(LDTARGET) $+ $(LDFLAGS) $(LIBS) $(EXTRA_LDFLAGS)/') > tmp rm Makefile @@ -27,17 +39,14 @@ mv tmp Makefile make build_lib_shared -j 12 LIBS="-pthread -static-libgcc -static-libstdc++ -fPIC" CFLAGS="-static-libgcc -static-libstdc++ -fPIC" CXXFLAGS="-static-libgcc -static-libstdc++ -fPIC" #make -j 12 LIBS="-pthread -static-libgcc -static-libstdc++" CFLAGS="-fPIC" CXXFLAGS="-fPIC" #make -j 12 LIBS="-pthread -lm -l/usr/lib/gcc/x86_64-linux-gnu/5/libstdc++.a" ${MAKE_OPTIONS} CFLAGS="-shared -static-libstdc++ -static-libgcc -fPIC" CXXFLAGS="-static-libstdc++ -static-libgcc -shared -fPIC" -if [ $? -ne 0 ]; then - echo "Failed to build jemalloc" - exit 1 -fi +check_err_exit ${library_path} "Failed to build jemalloc" sudo make install &>/dev/null if [ $? -ne 0 ]; then #Workaround because the install fails exit 0 fi +# +cd ../../../ +set_build_successful ${library_path} - - -#make -j 12 LIBS="-pthread -static-libgcc -static-libstdc++" CFLAGS="-fPIC" CXXFLAGS="-fPIC" diff --git a/libraries/build_mysqlconnector.sh b/libraries/build_mysqlconnector.sh deleted file mode 100755 index f36d0d6..0000000 --- a/libraries/build_mysqlconnector.sh +++ /dev/null @@ -1,16 +0,0 @@ -cd mysqlconnector -HEADER=$(cat cdk/foundation/connection_openssl.cc) -if ! [ "${HEADER:0:34}" == "#if !defined(SSL_ERROR_WANT_ASYNC)" ]; then - echo "Creating new one!" - echo "#if !defined(SSL_ERROR_WANT_ASYNC) - #define SSL_ERROR_WANT_ASYNC 0xFFEEDDCC -#endif -#if !defined(SSL_ERROR_WANT_ASYNC_JOB) - #define SSL_ERROR_WANT_ASYNC_JOB 0xFFEECCDD -#endif -`cat cdk/foundation/connection_openssl.cc`" > cdk/foundation/connection_openssl.cc -fi -cd build -cmake .. -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -I../../boringssl/include/ ${CXX_FLAGS}" -DWITH_JDBC=ON -DWITH_SSL="`pwd`/../../boringssl/" -DOPENSSL_ROOT_DIR="`pwd`/../../boringssl/" -DCMAKE_C_FLAGS="${C_FLAGS}" -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS} -make ${CMAKE_MAKE_OPTIONS} -sudo make install diff --git a/libraries/build_protobuf.sh b/libraries/build_protobuf.sh index 693924c..d36ca27 100755 --- a/libraries/build_protobuf.sh +++ b/libraries/build_protobuf.sh @@ -1,5 +1,5 @@ cd protobuf -git checkout 3.5.1.1 +# git checkout 3.5.1.1 cd build cmake ../cmake/ -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_CXX_FLAGS="-std=c++11 -fPIC ${CXX_FLAGS}" -DCMAKE_C_FLAGS="${C_FLAGS}" -DCMAKE_BUILD_TYPE=RelWithDebInfo ${CMAKE_OPTIONS} make ${CMAKE_MAKE_OPTIONS} diff --git a/libraries/ed25519 b/libraries/ed25519 index f810597..cab68d4 160000 --- a/libraries/ed25519 +++ b/libraries/ed25519 @@ -1 +1 @@ -Subproject commit f810597c6ce050233a7c499435c351d38777ef43 +Subproject commit cab68d412f5a720587bce1a6be9f092da9400baa diff --git a/libraries/event b/libraries/event index c3a6fe7..b32a644 160000 --- a/libraries/event +++ b/libraries/event @@ -1 +1 @@ -Subproject commit c3a6fe75e1511a4c7a7a6ef0a5954b1918902933 +Subproject commit b32a644302baf534eb2ff1561041eeb5b97b9fd2 diff --git a/libraries/jemalloc b/libraries/jemalloc index 4c548a6..4094b7c 160000 --- a/libraries/jemalloc +++ b/libraries/jemalloc @@ -1 +1 @@ -Subproject commit 4c548a61c89b0472b9952fcc4090eb00c2a88870 +Subproject commit 4094b7c03fb5e814f6f4c85ff7e93b3228dc4d29 diff --git a/libraries/jsoncpp b/libraries/jsoncpp index 2baad49..2e33c21 160000 --- a/libraries/jsoncpp +++ b/libraries/jsoncpp @@ -1 +1 @@ -Subproject commit 2baad4923e6d9a7e09982cfa4b1c5fd0b67ebd87 +Subproject commit 2e33c218cbd53b8d016e9230c2f600411b6146b8 diff --git a/libraries/mysqlconnector b/libraries/mysqlconnector deleted file mode 160000 index 7abcdc8..0000000 --- a/libraries/mysqlconnector +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7abcdc88c8235f02096e21b5bcd72e8312508f61 diff --git a/libraries/opus b/libraries/opus index 38fca4a..ad8fe90 160000 --- a/libraries/opus +++ b/libraries/opus @@ -1 +1 @@ -Subproject commit 38fca4a203a6759f2c90b86c84c4db087982ca81 +Subproject commit ad8fe90db79b7d2a135e3dfd2ed6631b0c5662ab diff --git a/libraries/yaml-cpp b/libraries/yaml-cpp index 0122697..c9a0077 160000 --- a/libraries/yaml-cpp +++ b/libraries/yaml-cpp @@ -1 +1 @@ -Subproject commit 012269756149ae99745b6dafefd415843d7420bb +Subproject commit c9a00770241b6dfd5e68df4574cf488822cfef14