Files
solvecraft/scripts/fetch-smlib.sh
T
jyviko 709191218c Wave 11/509: solidcraft-smlib: SMLib statically linked behind its C API, with a safe wrapper (and 1 more)
2 commits, squashed; the originals stay reachable from tag archive/merge-main-develop.

- c06c3cb2c jyviko: brep: cones narrowing along z, and a linear duplicate-shell check
- 8695af8ac Brennen Herbruck: solidcraft-smlib: SMLib statically linked behind its C API, with a safe wrapper

Co-authored-by: Brennen Herbruck <brennen.herbruck@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
2026-10-20 23:14:39 -04:00

21 lines
983 B
Bash
Executable File

#!/usr/bin/env bash
# Fetches the SMLib sources solidcraft-smlib builds (feature `native`): tangency-labs/smlib at
# the commit in crates/smlib/SMLIB_REV, only the parts the build reads (source/SMLib,
# source/SM_API, capi), into target/smlib-<rev12>. OpenCASCADE is not part of the fork.
set -euo pipefail
root="$(cd "$(dirname "$0")/.." && pwd)"
rev="$(tr -d '[:space:]' < "$root/crates/smlib/SMLIB_REV")"
dest="${SOLIDCRAFT_SMLIB_DIR:-$root/target/smlib-${rev:0:12}}"
if [ -f "$dest/capi/include/smlib.h" ] && [ "$(git -C "$dest" rev-parse HEAD 2>/dev/null)" = "$rev" ]; then
echo "SMLib $rev already at $dest"
exit 0
fi
rm -rf "$dest"
mkdir -p "$dest"
git -C "$dest" init -q
git -C "$dest" remote add origin https://github.com/tangency-labs/smlib.git
git -C "$dest" sparse-checkout set --no-cone /source/SMLib/ /source/SM_API/ /capi/ /LICENSE
git -C "$dest" fetch -q --depth 1 --filter=blob:none origin "$rev"
git -C "$dest" checkout -q FETCH_HEAD
echo "SMLib $rev at $dest"