#!/bin/bash # Build h7-glr (egui on GLES 3 / GLR1) with the Path B Rust toolchain. Output: target/wasm32-hwjs-linux-gnu/release/h7-glr set -u P=$HOME/rust-port; cd $P/h7-glr export RUSTUP_HOME=/build/brintos/rust/rustup CARGO_HOME=/build/brintos/rust/cargo PATH=$P/bin:/build/brintos/rust/cargo/bin:$PATH B=/build/brintos/brintium; BASE=/build/brintos/linux-in-the-browser export BRINTIUM_KERNEL_HEADERS=$BASE/distros/common/build/uapi-headers/include BRINTIUM_KERNEL_SRC=$BASE/packages/modified/linux export WASMLD_HWJS=1 WASMLD_DYNAMIC_MAIN=1 WASMLD_DYNAMIC_MODULE=1 WASMLD_RT_IMPORT=1 WASMLD_LIBC_IMPORT=1 HWJS_EH_PRELOWER=1 export WASMLD_LIBC_SO_PATH=$B/sysroot/build/libc-glibc.so WASMLD_HWJS_XMOD_SUSPENDERS=$B/sysroot/build/libc-glibc.so.partition export HWJS_STATUS_CHANNEL=1 HWJS_LANE_ADDRESSED=1 WASMLD_STACK=33554432 export RUST_BRINTLD_CC="$B/libexec/brintcc-glibc -O2 -L$HOME/glr-stage2 -Wl,-rpath,/opt/glr" RUST_BRINTLD_AR=$B/llvm-project/build/bin/llvm-ar RUST_BRINTLD_SUPPORT=$HOME/rust-support RUST_BRINTLD_LOG=$P/h7-glr/rust-brintld.log export RUSTC_BOOTSTRAP=1 RUSTFLAGS="-C linker-plugin-lto" cargo +1.95.0 build --release --target $P/wasm32-hwjs-linux-gnu.json -Zbuild-std=std,panic_abort -Zbuild-std-features= -Zjson-target-spec > build.log 2>&1; rc=$? echo "h7-glr build rc=$rc ($(date -u +%H:%M:%S))"; [ $rc -ne 0 ] && grep -E "^error" -A12 build.log | head -60 [ $rc -eq 0 ] && install -m0755 target/wasm32-hwjs-linux-gnu/release/h7-glr $HOME/h7-glr-rootfs/bin/h7-glr exit $rc