build: update install-static-libs.sh

This commit is contained in:
Marcus Holland-Moritz 2025-03-18 09:07:45 +01:00
parent 542a84ddf3
commit 8a8f32e55f
2 changed files with 23 additions and 18 deletions

View File

@ -8,6 +8,7 @@ RUN apt install -y gnupg wget software-properties-common
# RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main'
RUN apt install -y \
bash-completion \
curl \
vim \
less
RUN apt install -y \
@ -72,7 +73,8 @@ RUN apt install -y \
nlohmann-json3-dev \
python3-mistletoe
COPY install-static-libs.sh /usr/local/bin/install-static-libs.sh
RUN bash /usr/local/bin/install-static-libs.sh
# TODO: gcc-14 cannot build the current version of libunwind
RUN bash /usr/local/bin/install-static-libs.sh gcc-13 clang-18
ARG ARCH
# upx-4.2.2 is broken for arm64 (https://github.com/upx/upx/issues/758)
RUN wget -O - https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-$(bash -c "echo \${0//v8/}" $ARCH)_linux.tar.xz | tar -xJf - -C /usr/local/bin --strip-components=1 --wildcards "*/upx"

View File

@ -6,30 +6,33 @@ cd "$HOME"
mkdir pkgs
cd pkgs
# TODO: move to gcc-14 once libunwind compiles with it
GCC_VERSION=13
CLANG_VERSION=18
GCC="${1:-gcc}"
CLANG="${2:-clang}"
FILE_VERSION=5.45
FILE_SHA512=12611a59ff766c22a55db4b4a9f80f95a0a2e916a1d8593612c6ead32c247102a8fdc23693c6bf81bda9b604d951a62c0051e91580b1b79e190a3504c0efc20a
echo "Using $GCC and $CLANG"
FILE_VERSION=5.46
FILE_SHA512=a6cb7325c49fd4af159b7555bdd38149e48a5097207acbe5e36deb5b7493ad6ea94d703da6e0edece5bb32959581741f4213707e5cb0528cd46d75a97a5242dc
BZIP2_VERSION=1.0.8
LIBARCHIVE_VERSION=3.7.7
FLAC_VERSION=1.4.3
FLAC_VERSION=1.5.0
# TODO: https://github.com/libunwind/libunwind/issues/702
LIBUNWIND_VERSION=1.7.2
BENCHMARK_VERSION=1.9.0
OPENSSL_VERSION=3.0.15
CPPTRACE_VERSION=0.7.2
BENCHMARK_VERSION=1.9.1
OPENSSL_VERSION=3.0.16
CPPTRACE_VERSION=0.8.2
RETRY=0
while true; do
rm -f file-${FILE_VERSION}.tar.gz
wget ftp://ftp.astron.com/pub/file/file-${FILE_VERSION}.tar.gz
if echo "${FILE_SHA512} file-${FILE_VERSION}.tar.gz" | sha512sum -c; then
file_=file-${FILE_VERSION}.tar.gz
rm -f "$file_"
curl -o "$file_" "ftp://ftp.astron.com/pub/file/$file_"
if echo "${FILE_SHA512} $file_" | sha512sum -c; then
break
fi
RETRY=$((RETRY+1))
if [ $RETRY -gt 10 ]; then
echo "Failed to download file-${FILE_VERSION}.tar.gz"
echo "Failed to download $file_"
exit 1
fi
done
@ -44,11 +47,11 @@ wget https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v${CPPTRACE_VER
for COMPILER in clang gcc; do
if [[ "$COMPILER" == "clang" ]]; then
export CC=clang-$CLANG_VERSION
export CXX=clang++-$CLANG_VERSION
export CC="$CLANG"
export CXX="${CLANG/clang/clang++}"
elif [[ "$COMPILER" == "gcc" ]]; then
export CC=gcc-$GCC_VERSION
export CXX=g++-$GCC_VERSION
export CC="$GCC"
export CXX="${GCC/gcc/g++}"
else
echo "Unknown compiler: $COMPILER"
exit 1