This commit is contained in:
Your Name 2025-04-29 20:52:17 +12:00
parent c1f961b96b
commit 11e50eae8c

View File

@ -7,6 +7,10 @@
#!/bin/bash
set -e
# Get current user's UID and GID
USER_ID=$(id -u)
GROUP_ID=$(id -g)
# Create output directory if it doesn't exist
mkdir -p output
@ -17,26 +21,24 @@ if ! docker image inspect dropshell-builder:latest >/dev/null 2>&1; then
fi
# Build x86_64 executable
docker run --rm -v "$(pwd)/..:/src" dropshell-builder:latest bash -c '
docker run --rm -v "$(pwd)/..:/src" -u root dropshell-builder:latest bash -c '
rm -rf build && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make && \
cp dropshell ../packages/output/dropshell-x86_64
cp dropshell ../packages/output/dropshell-x86_64 && \
chown '"$USER_ID:$GROUP_ID"' ../packages/output/dropshell-x86_64
'
# Build arm64 executable
docker run --rm -v "$(pwd)/..:/src" dropshell-builder:latest bash -c '
docker run --rm -v "$(pwd)/..:/src" -u root dropshell-builder:latest bash -c '
rm -rf build && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
-DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
cmake -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
-DCMAKE_BUILD_TYPE=Release .. && \
make && \
cp dropshell ../packages/output/dropshell-arm64
cp dropshell ../packages/output/dropshell-arm64 && \
chown '"$USER_ID:$GROUP_ID"' ../packages/output/dropshell-arm64
'
# Change ownership to current user
chown $(id -u):$(id -g) output/dropshell-*