From 4ae4f1f05120a19a913326937aedf0c2beebb0d8 Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Tue, 22 Feb 2022 16:01:38 +0100 Subject: Use AppImage when bundling for Linux to avoid unmet GCC-11 dependencies --- scripts/bundle_linux.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/bundle_linux.sh (limited to 'scripts/bundle_linux.sh') diff --git a/scripts/bundle_linux.sh b/scripts/bundle_linux.sh new file mode 100755 index 000000000..baefafbaa --- /dev/null +++ b/scripts/bundle_linux.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +# Create and change to the directory we'll do all the work in +work_dir=$(dirname $0)/../build/appimage +mkdir -p $work_dir +cd $work_dir + +# First we'll build a filesystem that contains zenserver +mkdir fs + +# Copy the main binary +zs_bin=../linux/x86_64/release/zenserver +mkdir fs/bin +cp $zs_bin fs/bin/ + +# Include the linked C++ library .so - this is required because some LTS distros +# do not include GCC-11 at the time of writing and Zen's uses this for C++20. +mkdir fs/usr +cp $(ldd $zs_bin |sed -nr 's/^.+\s+=>\s+(.+)\s+\(0x0000.+$/\1/p'|grep 'c++') fs/usr/ + +# Download AppImage's bootstrap binary and create .desktop configuratino for it +unlink AppRun-x86_64 2>/dev/null +wget "https://github.com/AppImage/AppImageKit/releases/download/13/AppRun-x86_64" +mv AppRun-x86_64 fs/AppRun +chmod a+x fs/AppRun +echo Exec=zenserver>fs/zenserver.desktop + +# Create the filesystem and concatenate with AppImage's runtime. +mksquashfs fs zenserver.fs -root-owned -noappend + +unlink runtime-x86_64 2>/dev/null +wget "https://github.com/AppImage/AppImageKit/releases/download/13/runtime-x86_64" + +unlink zenserver 2>/dev/null +cat runtime-x86_64 >> zenserver +cat zenserver.fs >> zenserver +chmod a+x zenserver \ No newline at end of file -- cgit v1.2.3