casio-docker/Dockerfile

77 lines
2.2 KiB
Docker

# linux base image
FROM alpine
# set up variables
ENV TARGET="sh3eb-elf" \
PREFIX="$HOME/opt/sh3eb-elf-2.31.1-8.2.0" \
# TO DELETE
PATH="$PATH:$PREFIX/bin"
# PATH="$PATH:/opt/sh3eb-elf-2.31.1-8.2.0/bin" \
# PATH="$PATH:/opt/sh3eb-elf-2.31.1-8.2.0/fxsdk/bin"
# extract archives (binutils & gcc)
RUN mkdir -p $PREFIX
ADD binutils-2.31.1.tar.xz gcc-8.2.0.tar.xz $PREFIX/
# dependencies
RUN apk update && apk add --update --no-cache \
bash \
git \
build-base \
gmp-dev \
mpfr-dev \
mpc1-dev \
pcre-dev
# libpng-dev \
# python3 \
# py3-pillow \
# flex
# binutils
RUN cd $PREFIX && mkdir build-binutils && cd build-binutils && \
../binutils-2.31.1/configure --prefix=$PREFIX --target=$TARGET --disable-nls && \
make && make install
# gcc
RUN cd $PREFIX && mkdir build-gcc && cd build-gcc && \
../gcc-8.2.0/configure --prefix=$PREFIX --target=$TARGET --enable-languages=c,c++ --without-headers --with-newlib --disable-nls && \
make all-gcc && make install-gcc
# link gcc with libgcc
# need to fix the contrib/dl script : https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg549371.html
RUN cd $PREFIX/gcc-8.2.0 && \
sed -i 's/sha512sum --check/sha512sum -c/g' ./contrib/download_prerequisites && \
./contrib/download_prerequisites && \
cd $PREFIX/build-gcc && \
make all-target-libgcc && make install-target-libgcc
# TO DELETE
RUN apk add --update --no-cache libpng-dev python3 py3-pillow flex
# fxsdk
# old : http://git.planet-casio.com/lephe/fxsdk
RUN cd $PREFIX && \
git clone https://gitea.planet-casio.com/Lephenixnoir/fxsdk.git && \
cd fxsdk && bash configure --prefix=$PREFIX && make && make install
ENV PATH="$PATH:/opt/sh3eb-elf-2.31.1-8.2.0/bin"
ENV PATH="$PATH:/opt/sh3eb-elf-2.31.1-8.2.0/fxsdk/bin"
# gint
# old : http://git.planet-casio.com/lephe/gint
RUN cd $PREFIX && \
git clone --single-branch --branch compat https://gitea.planet-casio.com/Lephenixnoir/gint.git && \
cd gint && mkdir build.fx && cd build.fx && \
../configure --target=fx9860g && make && make install
WORKDIR /casio
# Build :
# docker build -t casio .
# Run :
# - Linux
# docker run -u 0 -it --rm -v $(pwd):/casio casio
# - Windows
# docker run -u 0 -it --rm -v "/$(pwd)":/casio casio