security-audit-v3 #15. download_file already had a verify branch; no caller used it and every *_SHA256 in versions.sh was a commented placeholder, so a tampered mirror tarball flowed straight into configure/make and the shipped WASM. - versions.sh: 13 pins (cross-checked against Homebrew/Buildroot/nixpkgs/ FreeBSD/vcpkg/boost.org/curl PGP; glm .zip is TOFU), boost/curl/libgit2 versions moved beside their pins. - all 13 download_file call sites pass "${NAME_SHA256}". - download_file refuses an empty or malformed pin (PCBJAM_ALLOW_UNPINNED=1 to bootstrap a new dep); file_sha256 prefers sha256sum, falls back to shasum. - scripts/deps/check-pins.sh: static 3-arg check + offline file:// enforcement test; runs in wasm-build.yml before the deps cache, on cache hits too. Expect one cold --build-deps run: the deps-cache key hashes versions.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GcsgJZ77bhZatLAVU8R84H
57 lines
1.4 KiB
Shell
Executable file
57 lines
1.4 KiB
Shell
Executable file
#!/bin/bash
|
|
# Install GLM headers for WebAssembly
|
|
# GLM is a header-only math library
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/../common/env.sh"
|
|
source "${SCRIPT_DIR}/../common/versions.sh"
|
|
source "${SCRIPT_DIR}/../common/functions.sh"
|
|
|
|
GLM_DIR="${DEPS_ROOT}/glm-${GLM_VERSION}"
|
|
GLM_STAMP="${BUILD_ROOT}/stamps/glm.stamp"
|
|
|
|
# Parse arguments
|
|
CLEAN=0
|
|
for arg in "$@"; do
|
|
case $arg in
|
|
--clean)
|
|
CLEAN=1
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ $CLEAN -eq 1 ]; then
|
|
log_info "Cleaning GLM install..."
|
|
rm -rf "${GLM_STAMP}"
|
|
fi
|
|
|
|
# Check if already installed
|
|
if check_stamp "${GLM_STAMP}"; then
|
|
log_info "GLM already installed, skipping..."
|
|
exit 0
|
|
fi
|
|
|
|
# Download if needed
|
|
if [ ! -d "${GLM_DIR}" ]; then
|
|
log_info "Downloading GLM ${GLM_VERSION}..."
|
|
mkdir -p "${DEPS_ROOT}"
|
|
cd "${DEPS_ROOT}"
|
|
|
|
GLM_URL="https://github.com/g-truc/glm/releases/download/${GLM_VERSION}/glm-${GLM_VERSION}.zip"
|
|
download_file "${GLM_URL}" "glm-${GLM_VERSION}.zip" "${GLM_SHA256}"
|
|
unzip -q "glm-${GLM_VERSION}.zip"
|
|
mv glm "glm-${GLM_VERSION}"
|
|
rm "glm-${GLM_VERSION}.zip"
|
|
fi
|
|
|
|
log_info "Installing GLM ${GLM_VERSION} headers..."
|
|
|
|
# GLM is header-only, just copy headers
|
|
mkdir -p "${SYSROOT}/include"
|
|
cp -r "${GLM_DIR}/glm" "${SYSROOT}/include/"
|
|
|
|
create_stamp "${GLM_STAMP}"
|
|
log_info "GLM install complete!"
|