serenity/Ports/libmodplug/package.sh
Jelle Raaijmakers 2a85abb15d Ports: Fix dynamic load of libmodplug by SDL2_mixer
The configure script for `SDL2_mixer` was trying to find the shared
library for `libmodplug` in the wrong directories and with the wrong
filename. This installs the shared library as `libmodplug.so.1` and
symlinks to it from `libmodplug.so`, and instructs the `SDL2_mixer`
build to search for it in `/usr/local/lib`.

Fixes the build for ports Super-Mario, freeciv and dungeonrush.
2022-01-08 00:56:48 +01:00

16 lines
777 B
Bash
Executable file

#!/usr/bin/env -S bash ../.port_include.sh
port=libmodplug
version=0.8.8.5
useconfigure=true
configopts=("ac_cv_c_bigendian=no")
files="https://download.sourceforge.net/modplug-xmms/libmodplug-${version}.tar.gz libmodplug-${version}.tar.gz 77462d12ee99476c8645cb5511363e3906b88b33a6b54362b4dbc0f39aa2daad"
auth_type=sha256
workdir="libmodplug-$version"
install() {
run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install
MODPLUG_LIBDIR="${SERENITY_INSTALL_ROOT}/usr/local/lib"
${CC} -shared -o ${MODPLUG_LIBDIR}/libmodplug.so.1 -Wl,-soname,libmodplug.so -Wl,--whole-archive ${MODPLUG_LIBDIR}/libmodplug.a -Wl,--no-whole-archive
ln -rsf ${MODPLUG_LIBDIR}/libmodplug.so.1 ${MODPLUG_LIBDIR}/libmodplug.so
rm -f ${MODPLUG_LIBDIR}/libmodplug.la
}