omtex
aien-dev/omtex
Brought by drakestapleton
| 1 | # pin.sh -- sourced by the tools. The one Omega compiler omtex is built and checked with. |
| 2 | OMTEX_OMEGA_REPO=https://github.com/aien-dev/omega-mv.git |
| 3 | OMTEX_OMEGA_COMMIT=91b3c9326919faf1491e29ae9276929e8349b8c7 |
| 4 | OMTEX_OMC_SHA256=189ada82e00bb440cb41351bd252cc68c54a1b1050051cc42a1df700081c3b54 |
| 5 | : "${OMTEX_HOME:=$here}" |
| 6 | : "${OMC:=$OMTEX_HOME/build/omega-mv/seed/out/omc}" |
| 7 | |
| 8 | # Fetch the pinned omega-mv commit (read-only use of its committed seed/out/omc) when OMC is absent. |
| 9 | omtex_fetch_omc() { |
| 10 | d=$OMTEX_HOME/build/omega-mv |
| 11 | if [ ! -d "$d/.git" ]; then |
| 12 | git init -q "$d" |
| 13 | git -C "$d" remote add origin "$OMTEX_OMEGA_REPO" |
| 14 | fi |
| 15 | git -C "$d" fetch -q --depth 1 origin "$OMTEX_OMEGA_COMMIT" |
| 16 | git -C "$d" checkout -q --detach FETCH_HEAD |
| 17 | } |
| 18 | |
| 19 | omtex_check_omc() { |
| 20 | [ -x "$OMC" ] || omtex_fetch_omc |
| 21 | got=$(sha256sum < "$OMC" | cut -d' ' -f1) |
| 22 | if [ "$got" != "$OMTEX_OMC_SHA256" ]; then |
| 23 | echo "omtex: $OMC has sha256 $got, pinned $OMTEX_OMC_SHA256; refusing" >&2 |
| 24 | exit 2 |
| 25 | fi |
| 26 | } |