casio-docker/Dockerfile

66 lines
1.9 KiB
Docker
Raw Permalink Normal View History

2019-09-10 10:55:22 +02:00
# linux base image
FROM alpine
# set up environment variables for the compiler
2019-09-10 10:55:22 +02:00
ENV TARGET="sh3eb-elf" \
2020-09-04 12:00:36 +02:00
COMPILER="/opt/sh-elf-2.35-10.2.0" \
PATH="$PATH:/opt/sh-elf-2.35-10.2.0/bin"
2019-09-10 10:55:22 +02:00
# dependencies
RUN apk update && apk add --update --no-cache \
bash \
git \
build-base \
gmp-dev \
mpfr-dev \
mpc1-dev \
2019-09-11 12:06:35 +02:00
pcre-dev \
libpng-dev \
python3 \
py3-pillow \
flex
# extract archives (binutils & gcc)
2020-09-04 12:00:36 +02:00
ADD binutils-2.35.tar.xz gcc-10.2.0.tar.xz $COMPILER/
2019-09-10 10:55:22 +02:00
# binutils
RUN cd $COMPILER && mkdir build-binutils && cd build-binutils && \
2020-09-04 12:00:36 +02:00
../binutils-2.35/configure --prefix=$COMPILER --target=$TARGET --with-multilib-list=m3,m4-nofpu --disable-nls --program-prefix=sh-elf- && \
2019-09-10 10:55:22 +02:00
make && make install
# gcc
RUN cd $COMPILER && mkdir build-gcc && cd build-gcc && \
2020-09-04 12:00:36 +02:00
../gcc-10.2.0/configure --prefix=$COMPILER --target=$TARGET --with-multilib-list=m3,m4-nofpu --enable-languages=c,c++ --without-headers --with-newlib --disable-nls --program-prefix=sh-elf- && \
2019-09-10 10:55:22 +02:00
make all-gcc && make install-gcc
# link gcc with libgcc
2019-09-10 10:55:22 +02:00
# need to fix the contrib/dl script : https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg549371.html
2020-09-04 12:00:36 +02:00
RUN cd $COMPILER/gcc-10.2.0 && \
2019-09-10 10:55:22 +02:00
sed -i 's/sha512sum --check/sha512sum -c/g' ./contrib/download_prerequisites && \
./contrib/download_prerequisites && \
cd $COMPILER/build-gcc && \
2019-09-10 10:55:22 +02:00
make all-target-libgcc && make install-target-libgcc
# set up environment variables for casio tools
ENV CASIO="/usr/local"
2019-09-10 10:55:22 +02:00
# fxsdk
ADD fxsdk $CASIO/fxsdk
RUN cd $CASIO/fxsdk && bash configure --prefix=$CASIO && make && make install
2019-09-10 10:55:22 +02:00
# gint
ADD gint $CASIO/gint
RUN cd $CASIO/gint && mkdir build.fx && cd build.fx && \
2019-09-10 10:55:22 +02:00
../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