re3-wiiu/Dockerfile

80 lines
2.8 KiB
Docker
Raw Normal View History

2021-07-25 13:18:47 +02:00
# build wut
FROM devkitpro/devkitppc:latest AS wutbuild
ENV PATH=$DEVKITPPC/bin:$PATH
WORKDIR /
RUN git clone https://github.com/devkitPro/wut
WORKDIR /wut
RUN make -j
RUN make install
WORKDIR /
# set up builder image
FROM devkitpro/devkitppc:latest AS builder
RUN apt-get update && apt-get -y install --no-install-recommends python wget tar autoconf autogen automake libtool && rm -rf /var/lib/apt/lists/*
COPY --from=wutbuild /opt/devkitpro/wut /opt/devkitpro/wut
# build SDL2
FROM builder AS sdlbuild
ENV WUT_ROOT=$DEVKITPRO/wut
RUN git clone -b wiiu-2.0.9 --single-branch https://github.com/yawut/SDL
WORKDIR /SDL
RUN mkdir build
WORKDIR /SDL/build
RUN cmake .. -DCMAKE_TOOLCHAIN_FILE=$WUT_ROOT/share/wut.toolchain.cmake -DCMAKE_INSTALL_PREFIX=$DEVKITPRO/portlibs/wiiu
RUN make -j && make install
WORKDIR /
# build sndfile
FROM builder as sndfilebuild
ENV WUT_ROOT=$DEVKITPRO/wut
RUN wget https://github.com/libsndfile/libsndfile/archive/refs/tags/1.0.31.tar.gz && mkdir /libsndfile && tar xf 1.0.31.tar.gz -C /libsndfile --strip-components=1
WORKDIR /libsndfile
RUN echo '--- configure2.ac 2021-07-25 12:41:14.205082892 +0200\n\
+++ "configure.ac" 2021-07-25 12:40:43.604738000 +0200\n\
@@ -593,7 +593,6 @@\n\
dnl some distributions (such as Gentoo) have _FORTIFY_SOURCE always\n\
dnl enabled. We test for this situation in order to prevent polluting\n\
dnl the console with messages of macro redefinitions.\n\
-AX_ADD_FORTIFY_SOURCE\n\
\n\
AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [\n\
dnl OS specific tweaks.' >> wiiu.patch && git apply wiiu.patch
RUN ./autogen.sh && ./configure \
--prefix=$DEVKITPRO/portlibs/wiiu/ \
--host=powerpc-eabi \
--enable-static \
--disable-full-suite \
CC=$DEVKITPPC/bin/powerpc-eabi-gcc \
AR=$DEVKITPPC/bin/powerpc-eabi-ar \
RANLIB=$DEVKITPPC/bin/powerpc-eabi-ranlib \
PKG_CONFIG=$DEVKITPRO/portlibs/wiiu/bin/powerpc-eabi-pkg-config \
CFLAGS="-Wall -O2 -ffunction-sections -DESPRESSO -mcpu=750 -meabi -mhard-float -D__WIIU__ -D__WUT__" \
LDFLAGS="-Wl,-q -Wl,-z,nocopyreloc -specs=$WUT_ROOT/share/wut.specs"
RUN make -j
RUN make install
# build final container
FROM devkitpro/devkitppc:latest AS final
# copy in wut
COPY --from=wutbuild /opt/devkitpro/wut /opt/devkitpro/wut
# copy in SDL2
COPY --from=sdlbuild /opt/devkitpro/portlibs/wiiu/lib/libSDL2.a /opt/devkitpro/portlibs/wiiu/lib/
COPY --from=sdlbuild /opt/devkitpro/portlibs/wiiu/include/SDL2 /opt/devkitpro/portlibs/wiiu/include/SDL2/
# copy in libsndfile
COPY --from=sndfilebuild /opt/devkitpro/portlibs/wiiu/lib/libsndfile.a /opt/devkitpro/portlibs/wiiu/lib/
COPY --from=sndfilebuild /opt/devkitpro/portlibs/wiiu/include/sndfile.h /opt/devkitpro/portlibs/wiiu/include/
COPY --from=sndfilebuild /opt/devkitpro/portlibs/wiiu/include/sndfile.hh /opt/devkitpro/portlibs/wiiu/include/
WORKDIR /project