From 90e0573e1560f668468a57c24752c8a389e19ab4 Mon Sep 17 00:00:00 2001 From: casey langen Date: Wed, 9 Feb 2022 16:58:56 -0800 Subject: [PATCH] Script updates. --- script/bootstrap-static-vendors.sh | 20 +++++++++---- script/stage-static-vendor-libraries.sh | 38 ++++++++++++++++++------- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/script/bootstrap-static-vendors.sh b/script/bootstrap-static-vendors.sh index 43b9dee92..5e03bf980 100755 --- a/script/bootstrap-static-vendors.sh +++ b/script/bootstrap-static-vendors.sh @@ -26,9 +26,9 @@ LAME_VERSION="3.100" # download deps # -wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_${BOOST_VERSION}.tar.bz2 +wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_${BOOST_VERSION}.tar.bz2 wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz -wget https://curl.se/download/${CURL_VERSION}.tar.gz +wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${LIBMICROHTTPD_VERSION}.tar.gz wget https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 wget https://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz @@ -37,21 +37,31 @@ wget https://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSI # boost # +BOOST_CXX_FLAGS="-fPIC" +if [ $OS == "Darwin" ]; then + BOOST_CXX_FLAGS="-fPIC -std=c++14 -stdlib=libc++" +fi + tar xvfj boost_${BOOST_VERSION}.tar.bz2 cd boost_${BOOST_VERSION} ./bootstrap.sh ./b2 headers -./b2 -d -j8 -sNO_LZMA=1 -sNO_ZSTD=1 threading=multi link=shared,static cxxflags="-fPIC -std=c++14 -stdlib=libc++" --prefix=../boost-bin/ install || exit $? +./b2 -d -j8 -sNO_LZMA=1 -sNO_ZSTD=1 threading=multi link=shared,static cxxflags=${BOOST_CXX_FLAGS} --prefix=../boost-bin/ install || exit $? cd .. # # openssl # +OPENSSL_TYPE="linux-${ARCH}" +if [ $OS == "Darwin" ]; then + OPENSSL_TYPE="darwin64-${ARCH}-cc" +fi + rm -rf openssl-bin tar xvfz openssl-${OPENSSL_VERSION}.tar.gz cd openssl-${OPENSSL_VERSION} -perl ./Configure --prefix=`pwd`/output no-ssl3 no-ssl3-method no-zlib "darwin64-${ARCH}-cc" +perl ./Configure --prefix=`pwd`/output no-ssl3 no-ssl3-method no-zlib ${OPENSSL_TYPE} make make install mkdir ../openssl-bin @@ -352,4 +362,4 @@ if [ $OS == "Darwin" ]; then install_name_tool -id "@rpath/libmp3lame.dylib" libmp3lame.dylib install_name_tool -id "@rpath/libmp3lame.0.dylib" libmp3lame.0.dylib cd ../../ -fi \ No newline at end of file +fi diff --git a/script/stage-static-vendor-libraries.sh b/script/stage-static-vendor-libraries.sh index 83b5386a1..6d5ecc64f 100755 --- a/script/stage-static-vendor-libraries.sh +++ b/script/stage-static-vendor-libraries.sh @@ -33,20 +33,24 @@ if [[ "$PLATFORM" == 'Darwin' ]]; then elif [[ "$PLATFORM" == 'Linux' ]]; then echo "[stage-static-vendor-libraries] staging Linux .so files..." - cp vendor/boost-bin/lib/libboost_filesystem.so.1.78.0 ./bin/lib/ - cp vendor/boost-bin/lib/libboost_thread.so.1.78.0 ./bin/lib/ + cp vendor/ffmpeg-bin/lib/libavcodec-musikcube.so.59 ./bin/lib + cp vendor/ffmpeg-bin/lib/libavformat-musikcube.so.59 ./bin/lib + cp vendor/ffmpeg-bin/lib/libavutil-musikcube.so.57 ./bin/lib + cp vendor/ffmpeg-bin/lib/libswresample-musikcube.so.4 ./bin/lib - cp vendor/ffmpeg-bin/lib/libavcodec-musikcube.so.59 ./bin/lib/ - cp vendor/ffmpeg-bin/lib/libavformat-musikcube.so.59 ./bin/lib/ - cp vendor/ffmpeg-bin/lib/libavutil-musikcube.so.57 ./bin/lib/ - cp vendor/ffmpeg-bin/lib/libswresample-musikcube.so.4 ./bin/lib/ + cp vendor/boost-bin/lib/libboost_filesystem.so.1.76.0 ./bin/lib + cp vendor/boost-bin/lib/libboost_thread.so.1.76.0 ./bin/lib - cp vendor/curl-bin/lib/libcurl.so.4 ./bin/lib/ + cp vendor/openssl-bin/lib/libcrypto.so.1.1 ./bin/lib + cp vendor/openssl-bin/lib/libssl.so.1.1 ./bin/lib - cp /lib/x86_64-linux-gnu/libssl.so.1.1 ./bin/lib/ - cp /lib/x86_64-linux-gnu/libcrypto.so.1.1 ./bin/lib/ - cp /lib/x86_64-linux-gnu/libz.so.1 ./bin/lib/ - cp /lib/x86_64-linux-gnu/libmp3lame.so.0 ./bin/lib/ + cp vendor/curl-bin/lib/libcurl.so.4 ./bin/lib + + cp vendor/lame-bin/lib/libmp3lame.so.0 ./bin/lib + + cp vendor/libmicrohttpd-bin/lib/libmicrohttpd.so.12 ./bin/lib + + cp /lib/x86_64-linux-gnu/libz.so.1 ./bin/lib cp /lib/x86_64-linux-gnu/libopenmpt.so.0 ./bin/lib cp /lib/x86_64-linux-gnu/libmpg123.so.0 ./bin/lib cp /lib/x86_64-linux-gnu/libvorbis.so.0 ./bin/lib @@ -56,5 +60,17 @@ elif [[ "$PLATFORM" == 'Linux' ]]; then cp /lib/x86_64-linux-gnu/libpanelw.so.6 ./bin/lib cp /lib/x86_64-linux-gnu/libtinfo.so.6 ./bin/lib + FILES="./bin/lib/*" + for f in $FILES + do + patchelf --set-rpath "\$ORIGIN" "$f" + done + + FILES="./bin/plugins/*.so" + for f in $FILES + do + patchelf --set-rpath "\$ORIGIN:\$ORIGIN/../lib" "$f" + done + chmod -x ./bin/lib/* fi