Skip to content

Instantly share code, notes, and snippets.

@dgellow
Last active June 9, 2021 16:46
Show Gist options
  • Save dgellow/680c15b727e2b56ff5c65a83e788ac65 to your computer and use it in GitHub Desktop.
Save dgellow/680c15b727e2b56ff5c65a83e788ac65 to your computer and use it in GitHub Desktop.
Idris2 dockerfile to target Game Boy Advance arch
#
# GBA development kit
#
FROM devkitpro/devkitarm:latest as devkit
#
# Idris build process
#
FROM dgellow/idris2:v0.3.0 as base
# setup dependencies
COPY --from=devkit /opt/devkitpro/devkitARM /opt/devkitpro/devkitARM
RUN apt-get update && apt-get -y install build-essential git clang
# fetch idris sources
ARG GIT_TAG=GBA
WORKDIR /src
RUN git clone https://github.com/andrevidela/Idris2.git
WORKDIR /src/Idris2
RUN git checkout ${GIT_TAG}
# build idris
ENV SCHEME=scheme
ENV DEVKITARM /opt/devkitpro/devkitARM
ENV CC $(DEVKITARM)/bin/arm-none-eabi-gcc
RUN export PATH="${PATH}:/root/.idris2/bin" && make all && make install PREFIX=/idris_gba
#
# Naked image
#
FROM ubuntu
COPY --from=base /idris_gba /root/.idris2
ENV SCHEME=scheme
RUN apt-get update && apt-get -y install chezscheme
RUN echo 'export PATH="/root/.idris2/bin/:${PATH}"' >> "${HOME}/.bashrc" && echo 'alias idris=idris2' >> "${HOME}/.bashrc"
ENTRYPOINT ["/root/.idris2/bin/idris2"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment