From de513fd714cacbd5cabbb8fca988b6cf81b1325b Mon Sep 17 00:00:00 2001 From: Ds886 Date: Fri, 24 Dec 2021 00:50:52 +0200 Subject: [PATCH] Adds an automated docker build --- Dockerfile | 28 ++++++++++++++++++++++++++++ docker-build-rom-script | 12 ++++++++++++ docker-build.sh | 7 +++++++ 3 files changed, 47 insertions(+) create mode 100644 Dockerfile create mode 100755 docker-build-rom-script create mode 100755 docker-build.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b98952f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM mcr.microsoft.com/powershell:ubuntu-20.04 +RUN echo "------------------Updating System------------------" +RUN apt update +RUN apt upgrade +RUN apt install -y wget gcc-arm-none-eabi cmake build-essential tar git +RUN echo "------------------Installing dotnet core------------------" +RUN mkdir -p /opt/dep +WORKDIR /opt/dep +RUN wget https://dot.net/v1/dotnet-install.sh +RUN chmod +x dotnet-install.sh +RUN ./dotnet-install.sh -c 2.1 +ENV PATH="${PATH}:/root/.dotnet/tools" +RUN echo "-------------------Installing armips------------------" +WORKDIR /opt/dep +RUN git clone --recursive https://github.com/Kingcom/armips.git +WORKDIR /opt/dep/armips +RUN mkdir -p bld +WORKDIR /opt/dep/armips/bld +RUN cmake ../ +RUN make -j +RUN mkdir -p /opt/src/bin +RUN cp /opt/dep/armips/bld/armips /opt/src/bin/armips +RUN cp /opt/dep/armips/bld/armipstests /opt/src/bin/armipstests +RUN cp /opt/dep/armips/bld/libarmips.a /opt/src/bin/libarmips.a +RUN echo "-------------------Building patched rom------------------" +COPY ./ /opt/src +WORKDIR /opt/src +CMD ./docker-build-rom-script diff --git a/docker-build-rom-script b/docker-build-rom-script new file mode 100755 index 0000000..fac793d --- /dev/null +++ b/docker-build-rom-script @@ -0,0 +1,12 @@ +#!/bin/pwsh +$Env:PATH += ":/root/.dotnet" +echo "Starting to build tools" +./build-tools.ps1 + +echo "Starting to build rom" +./build.ps1 + +echo "Copying rom to output" +cp ./bin/m12.gba /opt/out + +echo "Build successful please review the folder out for the resulted rom" diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 0000000..cfed18c --- /dev/null +++ b/docker-build.sh @@ -0,0 +1,7 @@ +#!/bin/bash +rm -rf ./out +mkdir -p ./out +docker rm image mother2gba:build +docker build ./ -t mother2gba:build +docker run --rm -it -v $PWD/out:/opt/out mother2gba:build +