aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-02-22 16:01:38 +0100
committerMartin Ridgers <[email protected]>2022-02-22 16:03:18 +0100
commit4ae4f1f05120a19a913326937aedf0c2beebb0d8 (patch)
tree87f94dd14a520d7cf79893be7f246cdb372ae006
parentzenserver-test zcache.rpc.allpolicies: Fix incorrect ValueId in GetCacheChunk... (diff)
downloadzen-4ae4f1f05120a19a913326937aedf0c2beebb0d8.tar.xz
zen-4ae4f1f05120a19a913326937aedf0c2beebb0d8.zip
Use AppImage when bundling for Linux to avoid unmet GCC-11 dependencies
-rw-r--r--scripts/bundle.lua4
-rwxr-xr-xscripts/bundle_linux.sh37
2 files changed, 40 insertions, 1 deletions
diff --git a/scripts/bundle.lua b/scripts/bundle.lua
index 5ae7cef0d..90fb13657 100644
--- a/scripts/bundle.lua
+++ b/scripts/bundle.lua
@@ -159,9 +159,11 @@ local function main_linux()
"crashpad_handler")
--]]
+ _exec("scripts/bundle_linux.sh")
+
_zip(
"build/zenserver-linux.zip",
- "build/linux/x86_64/release/zenserver",
+ "build/appimage/zenserver",
crashpad_handler_path)
end
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