Rewild Your Web
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 54 lines 2.1 kB view raw
1#!/bin/bash 2# SPDX-License-Identifier: AGPL-3.0-or-later 3# 4# Cross-compile Beaver for aarch64-unknown-linux-gnu using Docker. 5# The source tree is bind-mounted — no separate clone needed. 6# 7# The target/ directory uses a Docker named volume because macOS has a 8# case-insensitive filesystem which breaks mozjs (it generates both 9# string.h and String.h system wrappers that collide). 10 11set -e 12 13PROFILE=${1:-"release"} 14IMAGE_NAME="beaver-arm64-builder" 15TARGET_VOLUME="beaver-arm64-target" 16 17# Build Docker image if it doesn't exist yet. 18if ! docker image inspect "$IMAGE_NAME" &>/dev/null; then 19 echo "Building cross-compilation image..." 20 docker build -t "$IMAGE_NAME" -f support/docker/Dockerfile.arm64 . 21fi 22 23echo "Building beaver-shell for aarch64 (profile: ${PROFILE})..." 24 25docker run --rm \ 26 --memory=24g \ 27 -v "$(pwd):/src" \ 28 -v "${TARGET_VOLUME}:/src/target" \ 29 -v "${HOME}/.cargo/registry:/root/.cargo/registry" \ 30 -v "${HOME}/.cargo/git:/root/.cargo/git" \ 31 -e PKG_CONFIG_ALLOW_CROSS=1 \ 32 -e PKG_CONFIG_SYSROOT_DIR="" \ 33 -e PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig" \ 34 -e CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \ 35 -e CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \ 36 -e AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar \ 37 -e CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \ 38 -e BINDGEN_EXTRA_CLANG_ARGS="--target=aarch64-linux-gnu" \ 39 -e CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-8}" \ 40 "$IMAGE_NAME" \ 41 cargo build --target aarch64-unknown-linux-gnu --profile "$PROFILE" \ 42 -p beaver-shell \ 43 --no-default-features \ 44 --features="servo/clipboard,servo/gstreamer,js_jit,max_log_level,native-bluetooth,webgpu" 45 46# Copy the binary out of the Docker volume to the host for deploy. 47echo "Copying binary from Docker volume..." 48docker run --rm \ 49 -v "${TARGET_VOLUME}:/target" \ 50 -v "$(pwd)/dist:/out" \ 51 "$IMAGE_NAME" \ 52 sh -c "mkdir -p /out && cp /target/aarch64-unknown-linux-gnu/${PROFILE}/beavershell /out/" 53 54echo "Build complete: dist/beavershell"