Files
p2pool-salvium/scripts/release/macos_aarch64/build.sh

35 lines
941 B
Bash
Raw Normal View History

2025-07-03 20:48:58 +02:00
#!/bin/sh
2025-11-13 17:58:52 +00:00
set -eu
2025-07-03 20:48:58 +02:00
2025-07-28 00:05:28 +02:00
# Example usage: ./build.sh v4.9
2025-07-03 20:48:58 +02:00
cd "$(dirname "$0")"
2025-11-13 17:51:14 +00:00
repo_root="$(cd ../../.. && pwd)"
2025-11-13 18:00:19 +00:00
if [ "${2:-}" ]; then
2025-07-28 00:05:28 +02:00
cpu_set="--cpuset-cpus $2"
else
cpu_set=""
fi
2025-12-09 23:32:11 +01:00
cache_args=""
if [ -n "${P2POOL_BUILD_CACHE:-}" ]; then
cache_dir="${P2POOL_BUILD_CACHE%/}/macos_aarch64"
mkdir -p "$cache_dir"
export DOCKER_BUILDKIT=1
cache_args="--build-arg BUILDKIT_INLINE_CACHE=1 --cache-from type=local,src=$cache_dir --cache-to type=local,dest=$cache_dir,mode=max"
fi
2025-11-14 21:45:27 +00:00
docker build $cpu_set \
--build-arg P2POOL_VERSION=$1 \
2025-12-09 23:32:11 +01:00
$cache_args \
2025-11-14 21:45:27 +00:00
-t p2pool_macos_aarch64_build_$1 \
-f Dockerfile "$repo_root"
2025-07-03 20:48:58 +02:00
docker create --name p2pool_macos_aarch64_build_$1_container p2pool_macos_aarch64_build_$1:latest
docker cp p2pool_macos_aarch64_build_$1_container:/p2pool/build/p2pool-$1-macos-aarch64.tar.gz ../p2pool-$1-macos-aarch64.tar.gz
docker rm p2pool_macos_aarch64_build_$1_container
2025-07-03 20:48:58 +02:00
docker image rm -f p2pool_macos_aarch64_build_$1