1 darkplaces/Xonotic on Linux uses system libraries. For Windows and macOS external dlls and dylibs are needed. Those reside in xonotic/misc/buildfiles
3 Because at the time of writing there is no automatism to build or update the games dependencies for those 2 platforms and the current dlls/dylibs are VERY outdated and thus also contain vulnerabilities, this page should document on where to obtain or how to build them, retaining API compatibility to darkplaces and also older OS platform versions like Windows XP.
5 For Windows, all libraries can/should be obtained from https://packages.msys2.org/ [1] with the exception of an official DLL release from the upstream being available (this is the case for jpeg-turbo and freetype) or if it has to be compiled on under Windows for some reason (eg. libcurl for Schannel (Windows crypto for HTTPS) support).
7 A handy tool to check dll deps on Windows is https://github.com/lucasg/Dependencies
12 libcurl is used for downloading *.pk3 files from servers
17 git clone -b curl-7_80_0 https://github.com/curl/curl || true
18 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
23 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DCMAKE_INSTALL_PREFIX="$d0/out" -DCURL_USE_SCHANNEL=YES -G"Unix Makefiles" "$d0/curl"
27 cp out/bin/libcurl.dll ~/Games/xonotic/misc/buildfiles/win64/libcurl-4.dll
31 Darkplaces loads `libcurl.4.dylib` or `libcurl.3.dylib` or `libcurl.2.dylib`
34 libjpeg-turbo is needed to display jpeg images/textures
39 git clone https://github.com/libjpeg-turbo/libjpeg-turbo.git || true
40 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
45 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/libjpeg-turbo"
49 cp out/bin/libjpeg-62.dll ~/Games/xonotic/misc/buildfiles/win64/libjpeg.dll
53 Darkplaces loads `libjpeg.62.dylib`
56 zlib is required to read *.pk3 files. Also it is a dependency of libpng and probably some other libraries.
59 Darkplaces loads: ifdef ZLIB_USES_WINAPI `zlibwapi.dll` or `zlib.dll` else `zlib1.dll`. We use `zlib1.dll`!
61 Obtainment instructions:
62 * download as MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-zlib
63 * use dll from `bin` folder
69 curl -L -o zlib-$ZLIBVER.tar.xz https://zlib.net/zlib-$ZLIBVER.tar.xz || true
70 tar -xf zlib-$ZLIBVER.tar.xz
71 rm zlib-$ZLIBVER.tar.xz
72 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
78 sed -i '/zlib PROPERTIES SUFFIX/i set_target_properties(zlib PROPERTIES PREFIX "")' "$d0/zlib-$ZLIBVER/CMakeLists.txt" # Remove the "lib" prefix. TODO Do this through the cmake cache?
79 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DBUILD_SHARED_LIBS=true -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/zlib-$ZLIBVER"
83 cp out/bin/zlib1.dll ~/Games/xonotic/misc/buildfiles/win64/zlib1.dll
87 Darkplaces loads `libz.dylib`
90 libpng is needed to display png images/textures
93 Darkplaces loads `libpng16.dll` or `libpng16-16.dll` or `libpng15-15.dll` or `libpng15.dll` or `libpng14-14.dll` or `libpng14.dll` or `libpng12.dll`
95 Obtainment instructions:
96 * be sure to use a 1.16.X release
97 * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libpng
98 * use dll from `bin` folder
105 ZLIB_ROOT=$d0/../zlib/out # Location to the zlib compiled library
107 git clone -b $PNGVER git://git.code.sf.net/p/libpng/code libpng || true
108 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
113 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DPNG_STATIC=false -DPNG_TESTS=false -DPNG_EXECUTABLES=false -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DZLIB_INCLUDE_DIR=$ZLIB_ROOT/include -DZLIB_LIBRARY=$ZLIB_ROOT/lib/libzlib.dll.a -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/libpng"
117 cp out/bin/libpng16.dll ~/Games/xonotic/misc/buildfiles/win64/libpng16.dll
121 Darkplaces loads `libpng16.16.dylib` or `libpng15.15.dylib` or `libpng14.14.dylib` or `libpng12.0.dylib`
124 Required for the Xolonium font
127 Darkplaces loads: `libfreetype-6.dll` or `freetype6.dll`
131 curl -L -o freetype-$FTVER.tar.xz https://download.savannah.gnu.org/releases/freetype/freetype-$FTVER.tar.xz || true
132 tar -xf freetype-$FTVER.tar.xz
133 rm freetype-$FTVER.tar.xz
135 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
140 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/freetype-$FTVER"
144 cp out/bin/libfreetype.dll ~/Games/xonotic/misc/buildfiles/win64/libfreetype-6.dll
148 Darkplaces loads: `libfreetype.6.dylib` or `libfreetype.dylib`
151 libogg is used for the container in cl_capturevideo
154 Darkplaces loads `libogg-0.dll` or `libogg.dll` or `ogg.dll`
156 Obtainment instructions:
157 * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libogg
158 * use dll from `bin` folder
164 git clone -b $OGGVER https://gitlab.xiph.org/xiph/ogg.git
165 curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
170 cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DBUILD_SHARED_LIBS=true -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/ogg"
174 cp out/bin/libogg.dll ~/Games/xonotic/misc/buildfiles/win64/libogg.dll
178 Darkplaces loads `libogg.dylib`
180 # libvorbis + libvorbisfile + libvorbisenc
181 libvorbis + libvorbisfile are used to play .ogg audio files while libvorbis + libvorbisenc is used for the audio in video capturing (cl_capturevideo)
184 Darkplaces loads `libvorbis-0.dll` or `libvorbis.dll` or `vorbis.dll` and `libvorbisfile-3.dll` or `libvorbisfile.dll` or `vorbisfile.dll` and `libvorbisenc-2.dll` or `vorbisenc-2.dll` or `vorbisenc.dll`
186 Obtainment instructions:
187 * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libvorbis
188 * use dll from `bin` folder
191 Darkplaces loads `libvorbis.dylib` and `libvorbisfile.dylib`
194 libtheora is used for the video in cl_capturevideo
195 libtheoraenc/libtheoradec are not needed, they are the newer API; darkplaces uses the legacy pre 1.0 API (libtheora).
198 Darkplaces loads `libtheora-0.dll` or `theora-0.dll` or `theora.dll`
200 Obtainment instructions:
201 * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libtheora
202 * use dll from `bin` folder
205 Darkplaces loads `libtheora.dylib`
207 # libd0_blind_id-0 & libd0_rijndael-0
208 Internal project, see https://gitlab.com/xonotic/d0_blind_id
212 `LDFLAGS='-L$HOME/Games/xonotic/misc/builddeps/linux64/gmp/lib' CPPFLAGS='-I$HOME/Games/xonotic/misc/builddeps/linux64/gmp/include' ./configure --prefix=$HOME/Games/xonotic/misc/builddeps/linux64/d0_blind_id --enable-static --disable-shared --with-pic`
215 A dependency of libd0_blind_id-0
219 `./configure --prefix=$HOME/Games/xonotic/misc/builddeps/linux64/gmp --enable-static --disable-shared --with-pic --enable-fat`
222 libd0_blind_id-0 loads `libgmp-10.dll`
224 Obtainment instructions:
225 * download as MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-gmp
226 * use dll from `bin` folder
229 Is not loaded under Windows and crashes the game if it is and a map is loaded up.
230 Also it is not statically linked and thus requires libstdc++-6.dll and libgcc_s_sjlj-1.dll.
234 `./configure --enable-static --disable-shared --with-libccd=internal --enable-double-precision --prefix=$HOME/Games/xonotic/misc/builddeps/linux64/ode --with-pic`
237 *Note:* Old and not used in Xonotic but also not disabled :) Adding this for the sake of completeness.
240 Darkplaces loads: `libavw.dll`
242 Source code: https://github.com/paulvortex/DpLibAVW
245 Darkplaces loads: `libavw.dylib`