2022-08-03 16:03:33 +03:00
|
|
|
#! /usr/bin/env sh
|
|
|
|
|
|
|
|
set -ue
|
|
|
|
|
2024-01-22 16:57:43 +03:00
|
|
|
CATALA_VERSION=${CATALA_VERSION:-$(git describe --tags 2>/dev/null || echo dev)}
|
2022-08-01 20:56:04 +03:00
|
|
|
|
2024-01-22 15:50:31 +03:00
|
|
|
BIN_TAG=${BIN_TAG:-$(uname -s)-$(uname -m)}
|
2022-08-01 20:56:04 +03:00
|
|
|
|
2022-08-03 16:03:33 +03:00
|
|
|
CUSTOM_LINKING_CATALA_Z3="\
|
|
|
|
(-cclib -static
|
|
|
|
-cclib -no-pie
|
|
|
|
-noautolink
|
|
|
|
-cclib -L/home/ocaml/.opam/z3/lib/stublibs
|
|
|
|
-cclib -lz3ml-static
|
|
|
|
-cclib -lz3
|
|
|
|
-cclib -lstdc++
|
|
|
|
-cclib -lthreadsnat
|
|
|
|
-cclib -lzarith
|
|
|
|
-cclib -lgmp
|
|
|
|
-cclib -lcamlstr
|
2023-05-02 12:42:04 +03:00
|
|
|
-cclib -lalcotest_stubs
|
2022-08-03 16:03:33 +03:00
|
|
|
-cclib -lunix)"
|
|
|
|
|
|
|
|
CUSTOM_LINKING_CATALA_NOZ3="(-cclib -static -cclib -no-pie)"
|
|
|
|
|
|
|
|
CUSTOM_LINKING_CLERK="(-cclib -static -cclib -no-pie)"
|
|
|
|
|
|
|
|
git archive HEAD --prefix catala/ | \
|
2024-01-16 19:13:29 +03:00
|
|
|
docker run --rm -i registry.gitlab.inria.fr/verifisc/docker-catala:ocaml.4.14-z3static.4.11.2 \
|
2022-08-03 16:03:33 +03:00
|
|
|
sh -uexc \
|
|
|
|
'{ tar x &&
|
|
|
|
cd catala &&
|
2024-01-22 16:57:43 +03:00
|
|
|
export CATALA_VERSION='"${CATALA_VERSION}"' &&
|
2022-08-03 16:03:33 +03:00
|
|
|
echo "'"${CUSTOM_LINKING_CATALA_Z3}"'" >compiler/custom_linking.sexp &&
|
|
|
|
echo "'"${CUSTOM_LINKING_CLERK}"'" >build_system/custom_linking.sexp &&
|
2024-01-16 19:13:29 +03:00
|
|
|
opam --cli=2.1 install ./catala.opam --destdir ../release.out/ &&
|
2022-08-03 16:03:33 +03:00
|
|
|
mv ../release.out/bin/catala ../release.out/bin/catala-z3 &&
|
|
|
|
opam --cli=2.1 remove z3 catala &&
|
|
|
|
echo "'"${CUSTOM_LINKING_CATALA_NOZ3}"'" >compiler/custom_linking.sexp &&
|
|
|
|
opam --cli=2.1 install ./catala.opam --destdir ../release.out/ &&
|
2024-01-22 15:50:31 +03:00
|
|
|
for f in ../release.out/bin/*; do case ${f} in
|
2024-01-22 16:57:43 +03:00
|
|
|
*.js) mv ${f} ${f%.js}-'"${CATALA_VERSION}"'.js;;
|
|
|
|
*) strip ${f}; mv ${f} ${f}-'"${CATALA_VERSION}"'-'"${BIN_TAG}"';;
|
2024-01-22 15:50:31 +03:00
|
|
|
esac; done;
|
2022-08-03 16:03:33 +03:00
|
|
|
} >&2 && tar c -hC ../release.out/bin .' |
|
2022-08-01 20:56:04 +03:00
|
|
|
tar vx "$@"
|