tdlight-java-natives/.github/workflows/scripts/install_deps_linux_armhf_ss...

34 lines
2.2 KiB
Bash
Raw Normal View History

2023-05-12 01:34:32 +02:00
#!/bin/bash -ex
# Ubuntu 22.04
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture armhf
2023-08-26 10:05:41 +02:00
sed 's/deb http/deb \[arch=amd64,i386\] http/' -i /etc/apt/sources.list
sed 's/deb mirror/deb \[arch=amd64,i386\] mirror/' -i /etc/apt/sources.list
2023-08-25 22:58:05 +02:00
[ -d "/etc/apt/sources.list.d" ] && find /etc/apt/sources.list.d -name "*.list" -type f -exec sed 's/deb http/deb \[arch=amd64,i386\] http/' -i {} \;
2023-05-12 01:34:32 +02:00
echo "# tdlight multiarch" > /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs) main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs)-updates main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
echo "deb [arch=arm64,armhf,ppc64el,riscv64,s390x] http://ports.ubuntu.com/ $(lsb_release -cs)-security main universe restricted multiverse" >> /etc/apt/sources.list.d/tdlight-multiarch.list
apt-get --assume-yes update
# Install and bypass a bug in the cross-platform libc++ packages
2023-05-14 00:54:41 +02:00
apt-get --assume-yes autoremove "libc++-14-dev:*" "libc++abi-14-dev:*" "libc++1-14:*" "libc++abi1-14:*" "libunwind-14-dev:*" "libunwind-14:*" || true
2023-08-26 10:25:13 +02:00
apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install libc++-14-dev:armhf libc++abi-14-dev:armhf libunwind-14-dev:armhf libunwind-14:armhf
# shellcheck disable=SC2016
2023-05-14 11:48:06 +02:00
find /usr/lib/ -path "*-linux-*" -lname "*llvm*" -print0 | xargs -0 -I{} sh -c 'cp --remove-destination $(realpath "{}") "{}"'
2023-05-14 13:49:35 +02:00
find /usr/lib/ -maxdepth 1 -path "*-linux-*" -type d -print0 | xargs -0 -I{} sh -c 'ln -s "{}/libunwind.so.1" "{}/libunwind.so" || true'
find /usr/lib/ -maxdepth 1 -path "*-linux-*" -type d -print0 | xargs -0 -I{} sh -c 'ln -s "{}/libc++.so.1" "{}/libc++.so" || true'
2023-08-26 10:25:13 +02:00
apt-get --assume-yes -o Dpkg::Options::="--force-overwrite" install clang-14 libc++-14-dev libc++abi-14-dev libunwind-14-dev libunwind-14
2023-05-12 01:34:32 +02:00
# End libc++ packages bugfix
# Add armhf common files
2023-05-14 01:19:06 +02:00
apt-get download libclang-common-14-dev:armhf
dpkg-deb -xv libclang-common-14-dev_*_armhf.deb /
2023-05-12 01:34:32 +02:00
# Install dependencies
2023-05-12 01:51:21 +02:00
apt-get --assume-yes install libssl-dev:armhf zlib1g-dev:armhf openjdk-17-jdk-headless:armhf libgcc-12-dev:armhf libc6-dev:armhf