Skip to content

Commit 21fc503

Browse files
ephphathaAJenbo
authored andcommitted
build smpq and d1 graphics tool from source in devcontainer
Building d1 graphics tool from source allows running the container on non-x64 architectures Building smpq from source works around the arm64 version of smpq distributed in debian 12 repos (which is linked against StormLib 9.22 from 2017) failing an assert when packing our assets.
1 parent 7a2f226 commit 21fc503

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.devcontainer/Dockerfile

+10-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ USER root
66
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
77
&& apt-get -y install tar curl zip unzip bash-completion build-essential ripgrep htop \
88
ninja-build ccache g++ mold gdb clang-format clang-tidy \
9-
rpm pkg-config cmake git smpq gettext libsdl2-dev libsdl2-image-dev libsodium-dev \
9+
rpm pkg-config cmake git gettext libsdl2-dev libsdl2-image-dev libsodium-dev \
1010
libpng-dev libbz2-dev libfmt-dev libgtest-dev libgmock-dev libbenchmark-dev zsh \
1111
qtbase5-dev qt6-base-dev ristretto \
1212
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
1313

14+
RUN --mount=type=bind,source=tools/build_and_install_smpq.sh,target=/tmp/build_and_install_smpq.sh sh /tmp/build_and_install_smpq.sh
15+
1416
# Install devilutionx-graphics-tools
1517
RUN git clone https://github.com/diasurgical/devilutionx-graphics-tools.git /tmp/devilutionx-graphics-tools && \
1618
cd /tmp/devilutionx-graphics-tools && \
@@ -28,9 +30,12 @@ RUN git clone https://github.com/diasurgical/devilutionx-mpq-tools.git /tmp/devi
2830
rm -rf /tmp/devilutionx-mpq-tools
2931

3032
# Install d1-graphics-tool
31-
RUN curl -O -L https://github.com/diasurgical/d1-graphics-tool/releases/download/1.1.0/D1GraphicsTool-Linux-x64.deb && \
32-
dpkg -i D1GraphicsTool-Linux-x64.deb && \
33-
rm D1GraphicsTool-Linux-x64.deb
33+
RUN git clone https://github.com/diasurgical/d1-graphics-tool.git /tmp/d1-graphics-tool && \
34+
cd /tmp/d1-graphics-tool && \
35+
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release && \
36+
cmake --build build-rel -j $(getconf _NPROCESSORS_ONLN) && \
37+
cmake --install build-rel && \
38+
rm -rf /tmp/d1-graphics-tool
3439

3540
# Download spawn.mpq and fonts.mpq
3641
RUN curl --create-dirs -O -L --output-dir /usr/local/share/diasurgical/devilutionx/ \
@@ -40,4 +45,4 @@ RUN curl --create-dirs -O -L --output-dir /usr/local/share/diasurgical/devilutio
4045
chown -R vscode: /usr/local/share/diasurgical/
4146

4247
# Desktop environment configuration
43-
COPY fluxbox /home/vscode/.fluxbox/
48+
COPY .devcontainer/fluxbox /home/vscode/.fluxbox/

.devcontainer/devcontainer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"build": {
3-
"dockerfile": "Dockerfile"
3+
"dockerfile": "Dockerfile",
4+
"context": ".."
45
},
56
"customizations": {
67
"vscode": {

0 commit comments

Comments
 (0)