From cdbc2f0d58eefdb4c1fe351d66cb40414dcee61a Mon Sep 17 00:00:00 2001 From: Vomitblood Date: Wed, 7 Aug 2024 04:53:54 +0800 Subject: [PATCH] added build.sh to build appimage with older glibc --- build.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..9afe1a6 --- /dev/null +++ b/build.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +IMAGE_NAME="ubuntu:22.04" +HOST_PROJECT_DIR="$PWD" +CONTAINER_PROJECT_DIR="/app" +HOST_OUTPUT_DIR="$PWD/src-tauri/target/release/bundle/appimage" +CONTAINER_OUTPUT_DIR="$CONTAINER_PROJECT_DIR/src-tauri/target/release/bundle/appimage" +USER_ID=$(id -u) +GROUP_ID=$(id -g) + +docker pull $IMAGE_NAME + +# run the docker image and remove on completion +docker run --rm -it \ + -v "$HOST_PROJECT_DIR":$CONTAINER_PROJECT_DIR \ + $IMAGE_NAME \ + /bin/bash -c " + apt-get update && apt-get upgrade -y && \ + apt-get install -y cargo libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev && \ + + install -dm 755 /etc/apt/keyrings && \ + wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null && \ + echo 'deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main' | tee /etc/apt/sources.list.d/mise.list && \ + apt-get update && \ + apt-get install -y mise && \ + + cd $CONTAINER_PROJECT_DIR && \ + mise install && \ + mise settings set experimental true && \ + mise exec bun --command \"bun run tauri build\" + + chown -R $USER_ID:$GROUP_ID $CONTAINER_PROJECT_DIR + " + +echo "Build complete. Output available in $HOST_OUTPUT_DIR"