From d8a34f369286c710962014e46d64371b99bfb7cf Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 14 Dec 2021 20:16:05 +0000 Subject: [PATCH] Update Shared libraries (buildfiles) --- Shared-libraries-(buildfiles).md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Shared-libraries-(buildfiles).md b/Shared-libraries-(buildfiles).md index 0c43b50..75efcd7 100644 --- a/Shared-libraries-(buildfiles).md +++ b/Shared-libraries-(buildfiles).md @@ -187,6 +187,33 @@ Obtainment instructions: * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libvorbis * use dll from `bin` folder +Cross-compiling: + +``` +d0=$(pwd) +OGG_ROOT=$d0/../ogg/out +VORBISVER="v1.3.7" + +git clone -b $VORBISVER https://gitlab.xiph.org/xiph/vorbis.git + +# Fix win32 def files +sed -i 's/^LIBRARY$/LIBRARY libvorbis/' "$d0/vorbis/win32/vorbis.def" +sed -i 's/^LIBRARY$/LIBRARY libvorbisenc/' "$d0/vorbis/win32/vorbisenc.def" +sed -i 's/^LIBRARY$/LIBRARY libvorbisfile/' "$d0/vorbis/win32/vorbisfile.def" + +curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake +rm -rf build +mkdir build +cd build +cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DBUILD_SHARED_LIBS=true -DOGG_INCLUDE_DIR=$OGG_ROOT/include -DOGG_LIBRARY=$OGG_ROOT/lib/libogg.dll.a -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/vorbis" +make +make install +cd "$d0" +cp out/bin/libvorbis.dll ~/Games/xonotic/misc/buildfiles/win64/libvorbis-0.dll +cp out/bin/libvorbisfile.dll ~/Games/xonotic/misc/buildfiles/win64/libvorbisfile-3.dll +cp out/bin/libvorbisenc.dll ~/Games/xonotic/misc/buildfiles/win64/libvorbisenc-2.dll +``` + ### macOS Darkplaces loads `libvorbis.dylib` and `libvorbisfile.dylib` -- 2.39.2