Make docker build work

This commit is contained in:
David Voswinkel 2023-05-16 17:03:38 +00:00 committed by David Voswinkel
parent e0115a32da
commit e7aa6a96ae
7 changed files with 38 additions and 60 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
*

View file

@ -1,27 +1,26 @@
from node:slim
from ubuntu:22.04
WORKDIR /usr/src/app
ENV N64_LIBGCCDIR /opt/crashsdk/lib/gcc/mips64-elf/11.2.0
ENV N64_LIBGCCDIR /opt/crashsdk/lib/gcc/mips64-elf/12.2.0
ENV PATH /opt/crashsdk/bin:$PATH
ENV ROOT /etc/n64
ENV BLENDER_3_0 /usr/bin/blender
RUN apt update -y
RUN apt install -y ca-certificates
RUN echo "deb [trusted=yes] https://lambertjamesd.github.io/apt/ ./" | tee /etc/apt/sources.list.d/lambertjamesd.list
RUN echo "deb [trusted=yes] https://crashoveride95.github.io/apt/ ./" | tee /etc/apt/sources.list.d/n64sdk.list
RUN apt update -y
RUN dpkg --add-architecture i386
RUN apt install -y binutils-mips-n64 \
RUN apt update -y && \
DEBIAN_FRONTEND=noninteractive apt install -y \
ca-certificates
RUN echo "deb [trusted=yes] https://lambertjamesd.github.io/apt/ ./" | tee /etc/apt/sources.list.d/lambertjamesd.list && \
echo "deb [trusted=yes] https://crashoveride95.github.io/apt/ ./" | tee /etc/apt/sources.list.d/n64sdk.list
RUN apt update -y && \
dpkg --add-architecture i386 && \
DEBIAN_FRONTEND=noninteractive apt install -y \
binutils-mips-n64 \
gcc-mips-n64 \
n64sdk \
libnustd \
makemask \
root-compatibility-environment \
build-essential \
libmpc-dev \
sfz2n64 \
vtf2png \
@ -42,32 +41,11 @@ RUN apt install -y binutils-mips-n64 \
wget \
unzip \
sox \
nodejs \
lua5.4 \
liblua5.4-dev \
liblua5.4-0 \
blender \
mpg123
COPY skelatool64/src skelatool64/src
COPY skelatool64/main.cpp skelatool64/main.cpp
COPY skelatool64/makefile skelatool64/makefile
RUN git clone https://github.com/jbeder/yaml-cpp.git skelatool64/yaml-cpp
RUN cmake -S skelatool64/yaml-cpp -B skelatool64/yaml-cpp
RUN make -C skelatool64/yaml-cpp
RUN wget http://cimg.eu/files/CImg_latest.zip
RUN unzip CImg_latest.zip
RUN mv CImg-3.1.3_pre051622 skelatool64/cimg
RUN make -C skelatool64
RUN pip install vpk
COPY Makefile Makefile
COPY tools/export_fbx.py tools/export_fbx.py
COPY tools/generate_level_list.js tools/generate_level_list.js
COPY tools/generate_sound_ids.js tools/generate_sound_ids.js
COPY asm asm
COPY assets assets
COPY src src
COPY portal.ld portal.ld
CMD make

View file

@ -429,4 +429,10 @@ clean:
fix:
wine tools/romfix64.exe build/portal.z64
docker-build:
docker build . -t portal64
docker-run:
docker run -v $PWD:/usr/src/app -it portal64 bash
.SECONDARY:

9
Makefile.docker Normal file
View file

@ -0,0 +1,9 @@
clean:
sudo rm -rf build
docker-build:
docker buildx use desktop-linux
docker buildx build --platform linux/amd64 -t portal64 .
docker-make:
docker run -v $$PWD:/usr/src/app -it portal64 make

View file

@ -108,33 +108,18 @@ make fix
Build the Docker image.
```sh
docker build . -t portal64
make -f Makefile.docker docker-build
```
<br />
Then build.
```sh
# Set the environment variable
BLENDER_3_0=/blender/blender
# Build using docker
docker run \
-v /home/james/Blender/blender-2.93.1-linux-x64:/blender \
-e BLENDER_3_0 -v /home/james/portal/portal64/vpk:/usr/src/app/vpk \
-t -v /home/james/portal/portal64/docker-output:/usr/src/app/build portal64
make -f Makefile.docker docker-make
```
<br />
Where `/home/james/Blender/blender-2.93.1-linux-x64` is the folder where Blender is located.
`/home/james/portal/portal64/vpk` is the folder where the portal `*.vpk` files are located.
`/home/james/portal/portal64/docker-output` is where you want the output of the build to locate `portal.z64` will be put into this folder.
<br />
## Current New Feature TODO List
- [ ] Add auto save checkpoints
- [ ] rotate auto uv

View file

@ -124,11 +124,10 @@ void graphicsCreateTask(struct GraphicsTask* targetTask, GraphicsCallback callba
if (gfxValidate(&scTask->list, renderStateMaxDLCount(renderState), &validationResult) != GFXValidatorErrorNone) {
gfxGenerateReadableMessage(&validationResult, graphicsOutputMessageToDebugger);
gdbBreak();
}
#endif // PORTAL64_WITH_DEBUGGER
#endif // PORTAL64_WITH_GFX_VALIDATOR
osSendMesg(schedulerCommandQueue, (OSMesg)scTask, OS_MESG_BLOCK);
}
}

View file

@ -428,7 +428,7 @@ void sceneAnimatorDeserialize(struct Serializer* serializer, struct Scene* scene
#ifdef PORTAL64_WITH_DEBUGGER
#define READ_ALIGN_CHECK {serializeRead(serializer, &currentAlign, 1); if (currentAlign != expectedAlign) return; ++expectedAlign;}
#else
#define READ_ALIGN_CHECK {serializeRead(serializer, &currentAlign, 1); if (currentAlign != expectedAlign) gdbBreak(); ++expectedAlign;}
#define READ_ALIGN_CHECK {serializeRead(serializer, &currentAlign, 1); if (currentAlign != expectedAlign) return; ++expectedAlign;}
#endif
void sceneSerialize(struct Serializer* serializer, SerializeAction action, struct Scene* scene) {
@ -486,4 +486,4 @@ void sceneDeserialize(struct Serializer* serializer, struct Scene* scene) {
for (int i = 0; i < scene->doorCount; ++i) {
doorCheckForOpenState(&scene->doors[i]);
}
}
}