From 96b5ccd17d385f36c1f04c8a7bf64382ad5c8f25 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 16 Feb 2020 14:15:30 +0000 Subject: [PATCH] Update lib build script --- server/repro/generate_libraries.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/repro/generate_libraries.sh b/server/repro/generate_libraries.sh index b2096b1..51219b7 100755 --- a/server/repro/generate_libraries.sh +++ b/server/repro/generate_libraries.sh @@ -18,13 +18,15 @@ build_path="out/${build_os_type}_${build_os_arch}/" function query_system_link() { - data=$(ldd ../../../environment/TeaSpeakServer | grep "$1") + local _binary="$2" + [[ -z "$_binary" ]] && _binary="../../../environment/TeaSpeakServer" + data=$(ldd "$_binary" | grep "$1") # shellcheck disable=SC2206 data=($data) library_path=${data[2]} - [[ -z "${library_path}" ]] && { echo "failed to resolve library path for $1"; exit 1; } - [[ "${library_path}" == "not" ]] && { echo "failed to resolve library path for $1"; exit 1; } + [[ -z "${library_path}" ]] && { echo "failed to resolve library path for $1 in $_binary"; exit 1; } + [[ "${library_path}" == "not" ]] && { echo "failed to resolve library path for $1 in $_binary"; exit 1; } } cd $(dirname $0) || exit 1 @@ -50,6 +52,7 @@ cp "$library_path" . || { echo "failed to copy libcrypto.so"; exit 1; } # Setting up DataPipes library_path=$(realpath "${library_base}//DataPipes/${build_path}/lib/libDataPipes.so") cp "$library_path" . || { echo "failed to copy libDataPipes.so"; exit 1; } +_dp_path="$library_path" # Setting up Sqlite3 query_system_link "libsqlite3.so.0" @@ -82,7 +85,7 @@ if ldd "../../../environment/TeaSpeakServer" | grep -q "libnice.so.10"; then # "libglib-2.0.so.0" (only for web) # Setting up libpcre - query_system_link "libpcre.so.3" + query_system_link "libpcre.so.3" "$_dp_path" cp "${library_path}" . || { echo "failed to copy libpcre.so.3"; exit 1; } fi @@ -94,4 +97,4 @@ for file in *.so*; do patchelf --set-rpath "./libs/:./" "$file" done -echo "All libraries have been copied successfully" \ No newline at end of file +echo "All libraries have been copied successfully"