Add libopenmpt to vendor libraries.

This commit is contained in:
casey langen 2022-02-15 12:01:00 -08:00
parent e3f58f2dde
commit 8089935f76
2 changed files with 51 additions and 9 deletions

View File

@ -20,8 +20,9 @@ CURL_VERSION="7.81.0"
LIBMICROHTTPD_VERSION="0.9.75"
FFMPEG_VERSION="5.0"
LAME_VERSION="3.100"
LIBOPENMPT_VERSION="0.6.1"
OUTDIR=$(realpath $(pwd)/vendor/bin)
OUTDIR="$(pwd)/vendor/bin"
LIBDIR="$OUTDIR/lib"
JOBS="-j8"
@ -45,6 +46,7 @@ function fetch_packages() {
wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-${LIBMICROHTTPD_VERSION}.tar.gz
wget https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2
wget https://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz
wget https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-${LIBOPENMPT_VERSION}+release.autotools.tar.gz
}
#
@ -343,6 +345,36 @@ function build_lame() {
cd ..
}
#
# libopenmpt
#
function build_libopenmpt() {
rm -rf libopenmpt-${LIBOPENMPT_VERSION}+release.autotools
tar xvfz libopenmpt-${LIBOPENMPT_VERSION}+release.autotools.tar.gz
cd libopenmpt-${LIBOPENMPT_VERSION}+release.autotools
./configure \
--disable-dependency-tracking \
--enable-shared \
--disable-openmpt123 \
--disable-examples \
--disable-tests \
--disable-doxygen-doc \
--disable-doxygen-html \
--without-mpg123 \
--without-ogg \
--without-vorbis \
--without-vorbisfile \
--without-portaudio \
--without-portaudiocpp \
--without-sndfile \
--without-flac \
--prefix=${OUTDIR}
make ${JOBS} || exit $?
make install
cd ..
}
#
# macOS dylib rpaths
#
@ -476,6 +508,11 @@ function patch_dylib_rpaths() {
rm libmp3lame.dylib
ln -s libmp3lame.0.dylib libmp3lame.dylib
# libopenmpt
install_name_tool -id "$RPATH/libopenmpt.0.dylib" libopenmpt.0.dylib
rm libopenmpt.dylib
ln -s libopenmpt.0.dylib libopenmpt.dylib
cd ../../
fi
}
@ -491,4 +528,5 @@ build_libmicrohttpd
stage_opus_ogg_vorbis
build_ffmpeg
build_lame
build_libopenmpt
patch_dylib_rpaths

View File

@ -3,15 +3,19 @@ set (openmptdecoder_SOURCES
OpenMptDataStream.cpp
OpenMptDecoder.cpp
OpenMptIndexerSource.cpp
Utility.cpp
)
Utility.cpp)
add_library(openmptdecoder SHARED ${openmptdecoder_SOURCES})
# ensure vendor'd headers take priority over our local ones.
target_include_directories(openmptdecoder BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
if (${BUILD_STANDALONE} MATCHES "true")
target_include_directories(openmptdecoder BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
find_vendor_library(OPENMPTLIB openmpt)
target_link_libraries(openmptdecoder ${OPENMPTLIB})
else()
find_library(OPENMPTLIB NAMES openmpt)
find_library(MPG123LIB NAMES mpg123)
find_library(ZLIB NAMES z)
target_link_libraries(openmptdecoder ${OPENMPTLIB} ${MPG123LIB} ${ZLIB})
endif()
find_library(OPENMPTLIB NAMES openmpt)
find_library(MPG123LIB NAMES mpg123)
find_library(ZLIB NAMES z)
target_link_libraries(openmptdecoder ${OPENMPTLIB} ${MPG123LIB} ${ZLIB})