33set -ex
44
55if ! command -v apk; then
6- echo " This script should be run in an Alpine container "
6+ echo " This script should be run in an Alpine chroot environment "
77 exit 1
88fi
99
10- apk update
11- apk add alpine-sdk util-linux strace file autoconf automake libtool xz bash
12-
13- # Build static libfuse3 with patch for https://github.com/AppImage/type2-runtime/issues/10
14- apk add eudev-dev gettext-dev linux-headers meson # From https://git.alpinelinux.org/aports/tree/main/fuse3/APKBUILD
15- wget -c -q " https://github.com/libfuse/libfuse/releases/download/fuse-3.15.0/fuse-3.15.0.tar.xz"
16- echo " 70589cfd5e1cff7ccd6ac91c86c01be340b227285c5e200baa284e401eea2ca0 fuse-3.15.0.tar.xz" | sha256sum -c
17- tar xf fuse-3.* .tar.xz
18- cd fuse-3.* /
19- patch -p1 < ../patches/libfuse/mount.c.diff
20- mkdir build
21- cd build
22- meson setup --prefix=/usr ..
23- meson configure --default-library static
24- ninja install
25- cd ../../
10+ find /scripts
2611
27- # Minimize binary size
28- export CFLAGS=" -ffunction-sections -fdata-sections -Os"
29-
30- # Build static squashfuse
31- apk add zstd-dev zlib-dev zlib-static # fuse3-dev fuse3-static fuse-static fuse-dev
32- find / -name " libzstd.*" 2> /dev/null || true
33- wget -c -q " https://github.com/vasi/squashfuse/archive/e51978c.tar.gz"
34- echo " f544029ad30d8fbde4e4540c574b8cdc6d38b94df025a98d8551a9441f07d341 e51978c.tar.gz" | sha256sum -c
35- tar xf e51978c.tar.gz
36- cd squashfuse-* /
37- ./autogen.sh
38- ./configure --help
39- ./configure CFLAGS=" ${CFLAGS} -no-pie" LDFLAGS=-static
40- make -j" $( nproc) "
41- make install
42- /usr/bin/install -c -m 644 ./* .h ' /usr/local/include/squashfuse' # ll.h
43- cd -
12+ apk update
13+ apk add alpine-sdk util-linux strace file autoconf automake libtool xz bash \
14+ eudev-dev gettext-dev linux-headers meson \
15+ zstd-dev zlib-dev zlib-static # fuse3-dev fuse3-static fuse-static fuse-dev
4416
45- # Build static AppImage runtime
46- GIT_COMMIT=" $( cat src/runtime/version) "
47- export GIT_COMMIT
48- cd src/runtime
49- make runtime -j" $( nproc) "
50- file runtime
51- objcopy --only-keep-debug runtime runtime.debug
52- strip runtime
53- ls -lh runtime runtime.debug
54- echo -ne ' AI\x02' | dd of=runtime bs=1 count=3 seek=8 conv=notrunc # magic bytes, always do AFTER strip
55- cd -
17+ /scripts/common/install-dependencies.sh
18+ /scripts/build-runtime.sh
0 commit comments