From f71d61e7e7de8c50ccb3b3011def6db3f999fd35 Mon Sep 17 00:00:00 2001 From: gravermistakes Date: Mon, 19 Oct 2026 19:46:23 -0700 Subject: [PATCH] tooling: install ECLiPSe CLP for M3b and M3f --- .claude/hooks/install-toolchains.sh | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .claude/hooks/install-toolchains.sh diff --git a/.claude/hooks/install-toolchains.sh b/.claude/hooks/install-toolchains.sh new file mode 100644 index 0000000..e5d2903 --- /dev/null +++ b/.claude/hooks/install-toolchains.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# SessionStart non-apt toolchains for sica-fondt. +# +# ECLiPSe CLP is required by M3b/M3f and is not distributed as a reliable +# Ubuntu apt package. Install the official x86_64 Linux binary distribution +# idempotently. Foundry remains separately hosted by design (M3c). +set -euo pipefail + +if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ] && [ "${SICA_INSTALL_TOOLCHAINS:-}" != "true" ]; then + exit 0 +fi + +ECLIPSE_VERSION="7.2_13" +ECLIPSE_ARCH="x86_64_linux" +ECLIPSE_ROOT="/opt/eclipse-clp-${ECLIPSE_VERSION}" +ECLIPSE_BASE="https://eclipseclp.org/Distribution/Builds/${ECLIPSE_VERSION}/${ECLIPSE_ARCH}" + +if ! command -v eclipse >/dev/null 2>&1; then + tmp="$(mktemp -d)" + trap 'rm -rf "$tmp"' EXIT + + curl --fail --location --silent --show-error "${ECLIPSE_BASE}/eclipse_basic.tgz" --output "${tmp}/eclipse_basic.tgz" + + sudo mkdir -p "${ECLIPSE_ROOT}" + sudo tar -xzf "${tmp}/eclipse_basic.tgz" -C "${ECLIPSE_ROOT}" + + sudo tee /usr/local/bin/eclipse >/dev/null <