From 2a85abb15de1c52af9739f100872408e8661e4d7 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Fri, 7 Jan 2022 23:24:04 +0100 Subject: [PATCH] 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. --- Ports/SDL2_mixer/package.sh | 5 +++++ Ports/libmodplug/package.sh | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Ports/SDL2_mixer/package.sh b/Ports/SDL2_mixer/package.sh index 573fd636e2..d9b27f839b 100755 --- a/Ports/SDL2_mixer/package.sh +++ b/Ports/SDL2_mixer/package.sh @@ -7,6 +7,7 @@ auth_type=sha256 depends=("libmodplug" "libvorbis" "SDL2") configure() { + export LIBS="-L${SERENITY_INSTALL_ROOT}/usr/local/lib" run ./configure \ --host="${SERENITY_ARCH}-pc-serenity" \ --with-sdl-prefix="${SERENITY_INSTALL_ROOT}/usr/local" \ @@ -15,6 +16,10 @@ configure() { EXTRA_LDFLAGS="-lgui -lgfx -lipc -lcore -lcompression" } +post_configure() { + unset LIBS +} + build() { run make -k } diff --git a/Ports/libmodplug/package.sh b/Ports/libmodplug/package.sh index c0161e4f6f..4ea4d012bb 100755 --- a/Ports/libmodplug/package.sh +++ b/Ports/libmodplug/package.sh @@ -9,6 +9,8 @@ workdir="libmodplug-$version" install() { run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libmodplug.so -Wl,-soname,libmodplug.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libmodplug.a -Wl,--no-whole-archive - rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libmodplug.la + 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 }