-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·53 lines (34 loc) · 946 Bytes
/
build.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
#!/bin/bash
#######################################
ARCH=arm64v8
#ARCH=x86
#######################################
set -e
echo "Building py-pingu static executable - arch: $ARCH"
ORIG=$PWD
register_binformat() {
if [ ! -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ]; then
echo "Q-Emu Bin Format for AARCH64 in not registered."
echo " Please run: "
echo " docker run --rm --privileged hypriot/qemu-register"
exit 1
fi
}
if [[ $ARCH == "arm64v8" ]]; then
register_binformat
fi
if [ -z $1 ]; then
OUTPUT_PATH="../out/"
else
OUTPUT_PATH="$1"
fi
echo "OUTPUT_PATH: $PWD/$OUTPUT_PATH"
cd devops/
rm -rf out/
rm -rf src/
mkdir -p out
cp -rfp ../src/ .
DOCKER_IMAGE_NAME=py-pingu-$ARCH
docker build -t $DOCKER_IMAGE_NAME . -f Dockerfile-$ARCH
docker run -it -v $PWD/$OUTPUT_PATH:/output $DOCKER_IMAGE_NAME
echo "Statically linked exectable generated in $PWD/${OUTPUT_PATH}py-pingu"