#syntax=docker/dockerfile:1
FROM debian:bullseye

RUN apt update && apt install haskell-platform -y && \
	apt install opam ocaml-nox -y && \
	apt install jq pkg-config libssl-dev -y
RUN /usr/bin/cabal update && \
	/usr/bin/cabal install cmdargs \
		ansi-terminal parallel split parsec hashable --lib

WORKDIR /home/

RUN git clone https://bitbucket.org/julien-lange/kmc-cav19.git
RUN cd kmc-cav19 && \
	ghc KMC -threaded && \
	ln -s "$(pwd)/KMC" /usr/local/bin/kmc && \
	cd ..
RUN git clone https://github.com/julien-lange/asynchronous-subtyping.git
RUN cd asynchronous-subtyping/tool && \
	ghc Checker && \
	ln -s "$(pwd)/Checker" /usr/local/bin/concur19 && cd ../..


RUN opam init --disable-sandboxing && \
	eval $(opam env) && opam install nuscr -y
RUN curl https://sh.rustup.rs -sSf > rustup.sh  && \
	bash ./rustup.sh --default-toolchain 1.54.0 -y && \
	/root/.cargo/bin/rustup install nightly-2021-07-06

RUN /root/.cargo/bin/cargo install hyperfine

ENV PATH="/root/.cargo/bin:/root/.opam/default/bin/:${PATH}"

RUN ls
RUN git clone --single-branch --branch test_examples \
	https://github.com/zakcutner/rumpsteak.git
WORKDIR /home/rumpsteak/
RUN /root/.cargo/bin/cargo +1.54.0 install --all-features --path .
RUN /root/.cargo/bin/cargo +1.54.0 install --all-features --path ./generate
RUN /root/.cargo/bin/cargo +1.54.0 build --examples --all-features
