Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated to Minetest 5.9 and 5.10-dev #25

Merged
merged 4 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@ jobs:
args: |-
MINETEST_VERSION=master
MINETEST_GAME_VERSION=master
MINETEST_IRRLICHT_VERSION=master
MINETEST_IRRLICHT_VERSION=none
LUAJIT_VERSION=v2.1
tags: |-
5.8.0-dev
5.10.0-dev
unstable
dev
platforms: |-
linux/amd64
linux/arm64
- dockerfile: Dockerfile
args: |-
MINETEST_VERSION=5.8.0
MINETEST_GAME_VERSION=5.8.0
MINETEST_IRRLICHT_VERSION=1.9.0mt13
MINETEST_VERSION=5.9.0
MINETEST_GAME_VERSION=4e402ec39fb1852b148e62637df0b72ae70ecd7d
LUAJIT_VERSION=f725e44cda8f359869bf8f92ce71787ddca45618
tags: |-
stable
stable-5
Expand Down
29 changes: 16 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Build stage
FROM debian:bookworm-slim AS builder

# Build-time arguments
# Build-time arguments - defaults to dev build of more recent version
ARG MINETEST_VERSION=master
ARG MINETEST_GAME_VERSION=master
ARG MINETEST_IRRLICHT_VERSION=master
ARG MINETEST_IRRLICHT_VERSION=none
# LuaJIT rolling stable branch is v2.1
ARG LUAJIT_VERSION=v2.1

ARG MINETOOLS_VERSION=v0.2.2
# Using a specific and newer LuaJIT commit to fix several ARM issues
# and crashes. This commit uses the unrelease v2.1 branch.
ARG LUAJIT_VERSION=505e2c03de35e2718eef0d2d3660712e06dadf1f
ENV MINETOOLS_DL_URL=https://github.com/ronoaldo/minetools/releases/download

# Install all build-dependencies
RUN apt-get update &&\
Expand All @@ -26,12 +27,14 @@ RUN mkdir -p /usr/src &&\
https://github.com/minetest/minetest.git \
/usr/src/minetest &&\
rm -rf /usr/src/minetest/.git
RUN git clone --depth=1 -b ${MINETEST_GAME_VERSION} \
https://github.com/minetest/minetest_game.git \
/usr/src/minetest/games/minetest_game
RUN git clone --depth=1 -b ${MINETEST_IRRLICHT_VERSION} \
RUN if [ "${MINETEST_IRRLICHT_VERSION}" != "none" ] ; then \
git clone --depth=1 -b ${MINETEST_IRRLICHT_VERSION} \
https://github.com/minetest/irrlicht \
/usr/src/minetest/lib/irrlichtmt
/usr/src/minetest/lib/irrlichtmt ; \
fi
RUN git clone --depth=1 https://github.com/minetest/minetest_game.git \
/usr/src/minetest/games/minetest_game &&\
git -C /usr/src/minetest/games/minetest_game checkout ${MINETEST_GAME_VERSION}
RUN git clone \
https://github.com/LuaJIT/LuaJIT.git \
/usr/src/luajit &&\
Expand All @@ -45,13 +48,13 @@ RUN echo "Building for arch $(uname -m)" &&\
*) echo "Unsupported arch $(uname -m)" ; exit 1 ;; \
esac &&\
curl -SsL --fail \
https://github.com/ronoaldo/minetools/releases/download/${MINETOOLS_VERSION}/contentdb-linux-${ARCH}.zip > /tmp/minetools.zip &&\
${MINETOOLS_DL_URL}/${MINETOOLS_VERSION}/contentdb-linux-${ARCH}.zip > /tmp/minetools.zip &&\
cd /tmp/ && unzip minetools.zip && mv dist/contentdb /usr/bin &&\
rm /tmp/minetools.zip

# Build LuaJIT
WORKDIR /usr/src/luajit
RUN sed -e 's/PREREL=.*/PREREL=-beta4-mercurio/g' -i Makefile
RUN sed -e 's/PREREL=.*/PREREL=-rolling/g' -i Makefile
RUN make PREFIX=/usr &&\
make install PREFIX=/usr &&\
make install PREFIX=/usr DESTDIR=/opt/luajit
Expand Down Expand Up @@ -93,4 +96,4 @@ ADD minetest-wrapper.sh /usr/bin
WORKDIR /var/lib/minetest
USER minetest
EXPOSE 30000/udp 30000/tcp
CMD ["/usr/bin/minetest-wrapper.sh", "--config", "/etc/minetest/minetest.conf"]
CMD ["/usr/bin/minetest-wrapper.sh", "--config", "/etc/minetest/minetest.conf", "--gameid", "minetest"]
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SHELL=bash
IMAGE=ghcr.io/ronoaldo/minetestserver
TAG=latest

build:
docker build -t ${IMAGE}:${TAG} .

run: build
docker run --rm --name minetestserver -it -P ${IMAGE}:${TAG}

build-workflow-matrix:
@for i in $$(seq 0 1) ; do \
MATRIX="$$(yq -r ".jobs.\"multiarch-build\".strategy.matrix.include[$$i] | .args" \
< .github/workflows/multiarch.yaml)" ;\
while read arg ; do export ARGS="$${ARGS} --build-arg $${arg}" ; done <<<"$${MATRIX}"; \
docker buildx build \
$${ARGS} \
--file Dockerfile \
--platform linux/amd64 \
. ; \
done