Created
February 16, 2025 21:49
-
-
Save cheako/3df9f4e0bf30ac4bd713a2c965eaa575 to your computer and use it in GitHub Desktop.
dfplex binary distribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RC="/data/.dfhackrc" | |
if [ -r "$RC" ]; then | |
. $RC | |
fi | |
if [ ! -t 0 ]; then | |
stty() { | |
return | |
} | |
fi | |
old_tty_settings=$(stty -g) | |
LD_LIBRARY_PATH="./hack/libs:./hack:$LD_LIBRARY_PATH" | |
LIB="./hack/libdfhack.so" | |
LIBSAN="" | |
if which objdump > /dev/null; then | |
LIBSAN="$(objdump -p $LIB | sed -n 's/^.*NEEDED.*\(lib[a-z]san[a-z.0-9]*\).*$/\1/p' | head -n1):" | |
fi | |
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}${LIBSAN}${LIB}" | |
LD_PRELOAD="${PRELOAD_LIB#:}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH%:}" ./libs/Dwarf_Fortress "$@" | |
stty "$old_tty_settings" | |
tput sgr0 | |
echo | |
if [ -n "$DF_POST_CMD" ]; then | |
eval $DF_POST_CMD | |
fi | |
exit $ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1 | |
FROM debian:stable-slim | |
ADD http://www.bay12games.com/dwarves/df_47_04_linux.tar.bz2 /root/df.tar.bz2 | |
ADD https://github.com/white-rabbit-dfplex/dfplex/releases/download/v0.2.1-dfplex/dfplex-v0.2.1-linux64.zip /root/dfplex.zip | |
ADD https://github.com/DFHack/dfhack/releases/download/0.47.04-r1/dfhack-0.47.04-r1-Linux-64bit-gcc-4.8.tar.bz2 /root/dfhack.tar.bz2 | |
EXPOSE 8000 | |
EXPOSE 5000 | |
EXPOSE 1234 | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV SDL_DISABLE_LOCK_KEYS=1 | |
RUN \ | |
set -ex; \ | |
apt -yqq update; \ | |
apt -yqq upgrade; \ | |
apt -yqq dist-upgrade; \ | |
apt -yqq autopurge; \ | |
apt -yqq --no-install-suggests --no-install-recommends install \ | |
build-essential libsdl1.2debian libsdl-image1.2 libsdl-ttf2.0-0 libopenal1 \ | |
libsndfile1 libgtk2.0-0 libncursesw5 libglu1 unzip curl libboost-all-dev bzip2 \ | |
; \ | |
unzip /root/dfplex.zip; \ | |
mv dfplex-v0.2.1-Linux64 df_linux; \ | |
tar xj --skip-old-files -f /root/df.tar.bz2; \ | |
tar xj --skip-old-files -C df_linux -f /root/dfhack.tar.bz2; \ | |
rm -f /root/df.tar.bz2 /root/dfplex.zip /root/dfhack.tar.bz2; \ | |
chown -R 0:0 df_linux; \ | |
mkdir /save; \ | |
ln -s /save df_linux/data/save; \ | |
libcxx_orig="df_linux/libs/libstdc++.so.6"; \ | |
libcxx_backup="df_linux/libs/libstdc++.so.6.backup"; \ | |
if [ -e "$libcxx_orig" ] && [ ! -e "$libcxx_backup" ]; then mv "$libcxx_orig" "$libcxx_backup"; \ | |
fi; \ | |
printf '\n[PRINT_MODE:TEXT]\n[INTRO:NO]\n[TRUETYPE:NO]\n[SOUND:NO]\n' >> df_linux/data/init/init.txt; \ | |
printf '\n[AUTOSAVE:SEASONAL]\n[AUTOBACKUP:YES]\n[INITIAL_SAVE:YES]\n' >> df_linux/data/init/d_init.txt; \ | |
printf '\n[BIRTH_CITIZEN:A_D:D_D]\n[MOOD_BUILDING_CLAIMED:A_D:D_D]\n[ARTIFACT_BEGUN:A_D:D_D]\n' >> df_linux/data/init/announcements.txt; \ | |
: | |
VOLUME /save | |
WORKDIR /df_linux | |
COPY dfhack.sh ./dfhack | |
ENTRYPOINT ["./dfhack"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment