client-root/third_party/build.sh

88 lines
2.4 KiB
Bash
Raw Normal View History

2020-04-19 10:34:14 -04:00
#!/bin/bash
# Enter third_party/ directory
cd $(dirname $0)
export build_helper_file="../build-helpers/build_helper.sh"
build_helper_scripts="../build-helpers/libraries"
source ${build_helper_file}
[[ $build_helpers_defined -ne 1 ]] && {
echo "Failed to include build helpers."
exit 1
}
[[ -z "${build_os_type}" ]] && {
echo "Missing build os type. Using \"linux\""
export build_os_type="linux"
}
[[ -z "${build_os_arch}" ]] && {
echo "Missing build os arch. Using \"amd64\""
export build_os_arch="amd64"
}
begin_task "build_third_party" "Building libraries"
function exec_script() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name"
echo -e "Building library with script $color_green${1}$color_normal"
./${1}
_code=$?
if [[ $_code -ne 0 ]]; then
echo "Failed to build library $name. Status code: $_code"
exit 1
fi
#Log the result
end_task "build_$name" "Finished $name"
echo ""
}
function exec_script_external() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
begin_task "build_$name" "Building $name"
echo -e "Building library with script $color_green${1}$color_normal"
_prefix="library_path=\"$2\" ${*:3}"
eval $_prefix ./${build_helper_scripts}/"${1}"
code=$?
if [[ $code -ne 0 ]]; then
echo "Failed to build library $name. Status code: $code"
exit 1
fi
#Log the result
end_task "build_$name" "Finished $name"
echo ""
}
exec_script build_boringssl.sh
[[ ${build_os_type} != "win32" ]] && exec_script build_breakpad.sh #Not required for windows TeaClient
exec_script build_libevent.sh
#exec_script build_cxxterminal.sh #Depends on libevent; Not required for TeaClient
exec_script build_datapipes.sh
exec_script build_ed25519.sh
exec_script build_jsoncpp.sh
#exec_script build_mysqlconnector.sh
exec_script build_opus.sh
exec_script build_libfvad.sh
exec_script build_soxr.sh
exec_script build_portaudio.sh
exec_script_external build_protobuf.sh protobuf
exec_script build_unbound.sh
exec_script build_spdlog.sh
exec_script build_stringvariable.sh
exec_script build_threadpool.sh
exec_script build_soundio.sh
exec_script build_tom.sh
exec_script build_yaml.sh
[[ ${build_os_type} != "win32" ]] && exec_script build_jemalloc.sh #Not required for TeaClient
#Log the result
end_task "build_third_party" "Build all libraries successfully"