Add libopenmpt

Closes #113
This commit is contained in:
BtbN 2021-12-05 18:10:48 +01:00
parent cf8de5ee5e
commit 2d6767df32
2 changed files with 90 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#!/bin/bash
MINGW_STD_THREADS_REPO="https://github.com/meganz/mingw-std-threads.git"
MINGW_STD_THREADS_COMMIT="f73afbe664bf3beb93a01274246de80d543adf6e"
ffbuild_enabled() {
[[ $TARGET == win* ]] || return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$MINGW_STD_THREADS_REPO" "$MINGW_STD_THREADS_COMMIT" mingw-std-threads
cd mingw-std-threads
mkdir -p "$FFBUILD_PREFIX"/include
cp *.h "$FFBUILD_PREFIX"/include
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DMINGW_STDTHREADS_DIR="$FFBUILD_PREFIX"/include -DMINGW_STDTHREADS_BUILD_TEST=0 -DMINGW_STDTHREADS_GENERATE_STDHEADERS=1 .
cp cmake_stdheaders_generator/cmake_stdheaders_generator/* "$FFBUILD_PREFIX"/include
}

69
scripts.d/50-openmpt.sh Executable file
View file

@ -0,0 +1,69 @@
#!/bin/bash
OPENMPT_REPO="https://source.openmpt.org/svn/openmpt/trunk/OpenMPT"
OPENMPT_REV="16112"
ffbuild_enabled() {
return 0
}
ffbuild_dockerbuild() {
svn checkout "${OPENMPT_REPO}@${OPENMPT_REV}" openmpt
cd openmpt
local myconf=(
PREFIX="$FFBUILD_PREFIX"
CXXSTDLIB_PCLIBSPRIVATE="-lstdc++"
VERBOSE=2
STATIC_LIB=1
SHARED_LIB=0
DYNLINK=0
EXAMPLES=0
OPENMPT123=0
IN_OPENMPT=0
XMP_OPENMPT=0
DEBUG=0
OPTIMIZE=1
TEST=0
MODERN=1
FORCE_DEPS=1
NO_MINIMP3=0
NO_ZLIB=0
NO_OGG=0
NO_VORBIS=0
NO_VORBISFILE=0
NO_MPG123=1
NO_SDL2=1
NO_PULSEAUDIO=1
NO_SNDFILE=1
NO_PORTAUDIO=1
NO_PORTAUDIOCPP=1
NO_FLAC=1
)
if [[ $TARGET == win* ]]; then
myconf+=(
CONFIG=mingw64-"$TARGET"
)
export CPPFLAGS="$CPPFLAGS -DMPT_WITH_MINGWSTDTHREADS"
elif [[ $TARGET == linux* ]]; then
myconf+=(
CONFIG=gcc
TOOLCHAIN_PREFIX="$FFBUILD_CROSS_PREFIX"
)
else
echo "Unknown target"
return -1
fi
make -j$(nproc) "${myconf[@]}" all install
rm -r "$FFBUILD_PREFIX"/share/doc/libopenmpt
}
ffbuild_configure() {
echo --enable-libopenmpt
}
ffbuild_unconfigure() {
echo --disable-libopenmpt
}