diff --git a/Makefile b/Makefile index 7c15718..afd9c80 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ install: cp compile-r7rs.scm ${PREFIX}/lib/compile-r7rs/main.scm install compile-r7rs ${PREFIX}/bin/compile-r7rs +install-compile-r7rs-docker: + install compile-r7rs-docker.sh ${PREFIX}/bin/compile-r7rs-docker + uninstall: rm -rf ${PREFIX}/lib/compile-r7rs/snow rm -rf ${PREFIX}/bin/compile-r7rs diff --git a/compile-r7rs-docker.sh b/compile-r7rs-docker.sh new file mode 100644 index 0000000..0477f8f --- /dev/null +++ b/compile-r7rs-docker.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +{ + echo "ARG COMPILE_R7RS=chibi" + echo "FROM debian:bookworm AS build" + echo "RUN apt-get update && apt-get install -y build-essential wget make cmake libgc-dev zlib1g-dev libffi-dev libssl-dev" + echo "RUN wget https://bitbucket.org/ktakashi/sagittarius-scheme/downloads/sagittarius-0.9.12.tar.gz && tar -xf sagittarius-0.9.12.tar.gz" + echo "RUN cd sagittarius-0.9.12 && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local-other .. && make && make install" + echo "" + echo "FROM schemers/${COMPILE_R7RS}" + echo "RUN apt-get update && apt-get install -y make libffi8 libgc1 libssl3 libuv1" + echo "COPY --from=build /usr/local-other/ /usr/local-other/" + echo 'ENV PATH=${PATH}:/usr/local-other/bin' + echo "ARG COMPILE_R7RS=chibi" + echo "ENV COMPILE_R7RS=${COMPILE_R7RS}" +} > /tmp/Dockerfile.compile-r7rs-docker + +docker build . \ + -f /tmp/Dockerfile.compile-r7rs-docker \ + --tag=compile-r7rs-docker-${COMPILE_R7RS} + +docker run \ + -v "${PWD}":/workdir \ + -w /workdir \ + -t compile-r7rs-docker-${COMPILE_R7RS}