diff --git a/Ports/libmodplug/package.sh b/Ports/libmodplug/package.sh index e902e82cd8..552fe32379 100755 --- a/Ports/libmodplug/package.sh +++ b/Ports/libmodplug/package.sh @@ -7,11 +7,3 @@ configopts=("ac_cv_c_bigendian=no") files="https://download.sourceforge.net/modplug-xmms/libmodplug-${version}.tar.gz libmodplug-${version}.tar.gz 457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de" 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 -} diff --git a/Ports/libmodplug/patches/0001-Include-strings.h.patch b/Ports/libmodplug/patches/0001-Include-strings.h.patch index ccf6d61a8c..ae58774dcc 100644 --- a/Ports/libmodplug/patches/0001-Include-strings.h.patch +++ b/Ports/libmodplug/patches/0001-Include-strings.h.patch @@ -1,7 +1,7 @@ -From 8042f44a1358f080e28e727b3deecd43b046a8f7 Mon Sep 17 00:00:00 2001 +From 05bfb2d4b183e7ab23f9c57ccea2022a46178c26 Mon Sep 17 00:00:00 2001 From: xSlendiX Date: Sat, 18 Sep 2021 16:19:50 +0300 -Subject: [PATCH] Include strings.h +Subject: [PATCH 1/2] Include strings.h --- src/libmodplug/stdafx.h | 1 + diff --git a/Ports/libmodplug/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libmodplug/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 0000000000..298cc83550 --- /dev/null +++ b/Ports/libmodplug/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,94 @@ +From 14e9290db59b2a95ea2aa841c4799d1dba648887 Mon Sep 17 00:00:00 2001 +From: Tim Schumacher +Date: Sun, 29 May 2022 15:01:28 +0200 +Subject: [PATCH 2/2] libtool: Enable shared library support for SerenityOS + +For some odd reason, libtool handles the configuration for shared +libraries entirely statically and in its configure script. If no +shared library support is "present", building shared libraries is +disabled entirely. + +Fix that by just adding the appropriate configuration options for +`serenity`. This allows us to finally create dynamic libraries +automatically using libtool, without having to manually link the +static library into a shared library. +--- + configure | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/configure b/configure +index f3d01df..01f0360 100755 +--- a/configure ++++ b/configure +@@ -6573,6 +6573,10 @@ tpf*) + os2*) + lt_cv_deplibs_check_method=pass_all + ;; ++ ++serenity*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + esac + + fi +@@ -9867,6 +9871,10 @@ lt_prog_compiler_static= + lt_prog_compiler_static='-Bstatic' + ;; + ++ serenity*) ++ lt_prog_compiler_can_build_shared=yes ++ ;; ++ + *) + lt_prog_compiler_can_build_shared=no + ;; +@@ -11385,6 +11393,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } + hardcode_shlibpath_var=no + ;; + ++ serenity*) ++ ld_shlibs=yes ++ ;; ++ + *) + ld_shlibs=no + ;; +@@ -12456,6 +12468,17 @@ uts4*) + shlibpath_var=LD_LIBRARY_PATH + ;; + ++serenity*) ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${shared_ext}${versuffix} ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}${major}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ dynamic_linker='SerenityOS LibELF' ++ ;; ++ + *) + dynamic_linker=no + ;; +@@ -16421,6 +16444,17 @@ uts4*) + shlibpath_var=LD_LIBRARY_PATH + ;; + ++serenity*) ++ version_type=linux ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='${libname}${release}${shared_ext}${versuffix} ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' ++ soname_spec='${libname}${release}${shared_ext}${major}' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ dynamic_linker='SerenityOS LibELF' ++ ;; ++ + *) + dynamic_linker=no + ;; +-- +2.36.1 + diff --git a/Ports/libmodplug/patches/ReadMe.md b/Ports/libmodplug/patches/ReadMe.md index 20f49b7acd..bee4cfc631 100644 --- a/Ports/libmodplug/patches/ReadMe.md +++ b/Ports/libmodplug/patches/ReadMe.md @@ -5,3 +5,17 @@ Include strings.h +## `0002-libtool-Enable-shared-library-support-for-SerenityOS.patch` + +libtool: Enable shared library support for SerenityOS + +For some odd reason, libtool handles the configuration for shared +libraries entirely statically and in its configure script. If no +shared library support is "present", building shared libraries is +disabled entirely. + +Fix that by just adding the appropriate configuration options for +`serenity`. This allows us to finally create dynamic libraries +automatically using libtool, without having to manually link the +static library into a shared library. +