2019-06-29 07:35:32 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o xtrace
|
|
|
|
|
|
|
|
############### Install packages for building
|
|
|
|
apt-get -y install ca-certificates
|
2019-10-10 16:56:08 +08:00
|
|
|
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
|
2019-10-09 01:48:41 +08:00
|
|
|
echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
|
2019-10-09 01:46:11 +08:00
|
|
|
dpkg --add-architecture armhf
|
2019-10-10 16:56:08 +08:00
|
|
|
apt-get update
|
|
|
|
apt-get -y install \
|
2019-10-10 00:48:17 +08:00
|
|
|
bc \
|
|
|
|
bison \
|
2019-10-09 01:46:11 +08:00
|
|
|
ccache \
|
|
|
|
crossbuild-essential-armhf \
|
2019-10-10 00:48:17 +08:00
|
|
|
flex \
|
2019-06-29 07:35:32 +08:00
|
|
|
g++ \
|
2019-10-10 00:48:17 +08:00
|
|
|
gettext \
|
2019-11-05 23:24:35 +08:00
|
|
|
libdrm-dev \
|
2019-10-09 01:46:11 +08:00
|
|
|
libdrm-dev:armhf \
|
|
|
|
libelf-dev \
|
|
|
|
libelf-dev:armhf \
|
|
|
|
libexpat1-dev \
|
|
|
|
libexpat1-dev:armhf \
|
2019-10-10 00:48:17 +08:00
|
|
|
libssl-dev \
|
2019-10-09 01:48:41 +08:00
|
|
|
llvm-7-dev:armhf \
|
|
|
|
llvm-8-dev \
|
2019-10-09 01:46:11 +08:00
|
|
|
meson \
|
2019-06-29 07:35:32 +08:00
|
|
|
pkg-config \
|
|
|
|
python \
|
2019-10-09 01:46:11 +08:00
|
|
|
python3-mako \
|
2019-06-29 07:35:32 +08:00
|
|
|
wget \
|
2019-10-10 00:48:17 +08:00
|
|
|
zlib1g-dev
|
2019-06-29 07:35:32 +08:00
|
|
|
|
2019-10-09 01:46:11 +08:00
|
|
|
############### Generate cross build file for Meson
|
|
|
|
|
|
|
|
cross_file="/cross_file-armhf.txt"
|
|
|
|
/usr/share/meson/debcrossgen --arch armhf -o "$cross_file"
|
|
|
|
# Explicitly set ccache path for cross compilers
|
|
|
|
sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
|
|
|
|
# Don't need wrapper for armhf executables
|
|
|
|
sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
|
2019-06-29 07:35:32 +08:00
|
|
|
|
|
|
|
apt-get purge -y \
|
2019-10-09 01:46:11 +08:00
|
|
|
wget
|
2019-10-10 16:56:08 +08:00
|
|
|
|
|
|
|
apt-get autoremove -y --purge
|