Skip to content

Commit

Permalink
fix missing libs
Browse files Browse the repository at this point in the history
  • Loading branch information
rwanyoike committed Oct 7, 2024
1 parent 398d09f commit 4360e66
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ ARG SRB2KART_USER=srb2kart
# Ref: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=srb2kart-data
RUN set -ex \
&& apk add --no-cache -t .build-deps curl \
&& _assets_file=/tmp/srb2kart-data_${SRB2KART_VERSION}.zip \
&& _target_dir=/usr/local/share/games/SRB2Kart \
&& curl -fL -o ${_assets_file} ${SRB2KART_REPO}/releases/download/${SRB2KART_VERSION}/AssetsLinuxOnly.zip \
&& mkdir -p ${_target_dir} \
&& unzip -d ${_target_dir} ${_assets_file} \
&& find ${_target_dir}/mdls -type d -print -exec chmod 0755 {} \; \
&& rm ${_assets_file} \
&& _assets=/tmp/srb2kart-data_${SRB2KART_VERSION}.zip \
&& _target=/usr/share/games/SRB2Kart \
&& curl -fL -o ${_assets} ${SRB2KART_REPO}/releases/download/${SRB2KART_VERSION}/AssetsLinuxOnly.zip \
&& mkdir -p ${_target} \
&& unzip -d ${_target} ${_assets} \
&& find ${_target}/mdls -type d -print -exec chmod 0755 {} \; \
&& rm ${_assets} \
&& apk del .build-deps

# Ref: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=srb2kart
Expand All @@ -27,26 +27,35 @@ RUN set -ex \
libpng-dev \
sdl2_mixer-dev \
sdl2-dev \
&& _target_dir=/tmp/srb2kart_${SRB2KART_VERSION} \
&& git clone --depth=1 -b ${SRB2KART_VERSION} ${SRB2KART_REPO} ${_target_dir} \
&& (cd ${_target_dir}/src \
# NOUPX - Don't compress with UPX (speed up compiling)
# NOOBJDUMP - Don't dump symbols (speed up compiling)
# LINUX64 - Compile for x86_64 Linux
# NOHW - Disable OpenGL and OpenAL
&& make -j$(nproc) NOUPX=1 NOOBJDUMP=1 LINUX64=1 NOHW=1) \
&& cp ${_target_dir}/bin/Linux64/Release/lsdl2srb2kart /usr/bin/srb2kart \
&& rm -rf ${_target_dir} \
&& _target=/tmp/srb2kart_${SRB2KART_VERSION} \
&& git clone --depth=1 -b ${SRB2KART_VERSION} ${SRB2KART_REPO} ${_target} \
&& cd ${_target}/src \
# Ref: https://wiki.srb2.org/wiki/Source_code_compiling
# NOUPX - Don't compress with UPX (speed up compiling)
# NOOBJDUMP - Don't dump symbols (speed up compiling)
# LINUX64 - Compile for x86_64 Linux
# NOHW - Disable OpenGL and OpenAL
&& make -j$(nproc) NOUPX=1 NOOBJDUMP=1 LINUX64=1 NOHW=1 \
&& cp ${_target}/bin/Linux64/Release/lsdl2srb2kart /usr/bin/srb2kart \
&& rm -rf ${_target} \
&& apk del .build-deps

RUN set -ex \
&& apk add --no-cache \
libcurl \
libgme \
libpng \
sdl2 \
sdl2_mixer

RUN adduser -D ${SRB2KART_USER} \
&& mkdir /data \
&& chown ${SRB2KART_USER}:${SRB2KART_USER} /data \
&& ln -s /data /home/${SRB2KART_USER}/.srb2kart

USER ${SRB2KART_USER}

WORKDIR /usr/share/games/SRB2Kart
WORKDIR /data

EXPOSE 5029/udp

Expand Down

0 comments on commit 4360e66

Please sign in to comment.