-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathxbuild-debianBW-arm64.sh
89 lines (77 loc) · 1.73 KB
/
xbuild-debianBW-arm64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# phiola: cross-build on Linux for Debian-bookworm ARM64
IMAGE_NAME=phiola-debianbw-arm64-builder
CONTAINER_NAME=phiola_debianBW_arm64_build
ARGS=${@@Q}
set -xe
if ! test -d "../phiola" ; then
exit 1
fi
if ! podman container exists $CONTAINER_NAME ; then
if ! podman image exists $IMAGE_NAME ; then
# Create builder image
cat <<EOF | podman build -t $IMAGE_NAME -f - .
FROM debian:bookworm-slim
RUN apt update && \
apt install -y \
make
RUN apt install -y \
zstd zip unzip bzip2 xz-utils \
perl \
cmake \
patch \
dos2unix \
curl
RUN apt install -y \
autoconf libtool libtool-bin \
gettext \
pkg-config
RUN apt install -y \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
RUN dpkg --add-architecture arm64 && \
apt update && \
apt install -y \
libasound2-dev:arm64 libpulse-dev:arm64 libjack-dev:arm64 \
libdbus-1-dev:arm64
RUN apt install -y \
libgtk-3-dev:arm64
EOF
fi
# Create builder container
podman create --attach --tty \
-v `pwd`/..:/src \
--name $CONTAINER_NAME \
$IMAGE_NAME \
bash -c 'cd /src/phiola && source ./build_linux.sh'
fi
# Prepare build script
cat >build_linux.sh <<EOF
set -xe
mkdir -p ../ffpack/_linux-arm64
make -j8 zstd \
-C ../ffpack/_linux-arm64 \
-f ../Makefile \
-I .. \
CPU=arm64 \
CROSS_PREFIX=aarch64-linux-gnu-
mkdir -p alib3/_linux-arm64
make -j8 \
-C alib3/_linux-arm64 \
-f ../Makefile \
-I .. \
CPU=arm64 \
CROSS_PREFIX=aarch64-linux-gnu-
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
mkdir -p _linux-arm64
make -j8 \
-C _linux-arm64 \
-f ../Makefile \
ROOT_DIR=../.. \
PHI_HTTP_SSL=0 \
CFLAGS_USER=-fno-diagnostics-color \
CPU=arm64 \
CROSS_PREFIX=aarch64-linux-gnu- \
$ARGS
EOF
# Build inside the container
podman start --attach $CONTAINER_NAME