Ports: Replace manually linking SDL2_net with a libtool patch

This commit is contained in:
Tim Schumacher 2022-06-03 16:23:15 +02:00 committed by Linus Groh
parent 546f398ff5
commit 16a34c521e
Notes: sideshowbarker 2024-07-17 10:28:38 +09:00
5 changed files with 113 additions and 9 deletions

View File

@ -3,11 +3,7 @@ port=SDL2_net
version=2.0.1
useconfigure=true
use_fresh_config_sub=true
configopts=("--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local")
configopts=("--with-sdl-prefix=${SERENITY_INSTALL_ROOT}/usr/local" "--disable-static" "--enable-shared")
files="https://www.libsdl.org/projects/SDL_net/release/SDL2_net-${version}.tar.gz SDL2_net-${version}.tar.gz 15ce8a7e5a23dafe8177c8df6e6c79b6749a03fff1e8196742d3571657609d21"
auth_type=sha256
depends=("SDL2")
post_install() {
run ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_net.so -Wl,-soname,libSDL2_net.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libSDL2_net.a -Wl,--no-whole-archive
}

View File

@ -1,7 +1,7 @@
From 39364e14fd4259ab6c618a228f0b06dc8b9af24b Mon Sep 17 00:00:00 2001
From 1e79dfd03eeaf33b9249b2a74a9dede5c5da3a59 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Wed, 16 Jun 2021 11:08:32 +0200
Subject: [PATCH 1/2] Undefine 'SIOCGIFCONF' on serenity
Subject: [PATCH 1/3] Undefine 'SIOCGIFCONF' on serenity
FIXME: We don't know why yet.
---

View File

@ -1,7 +1,7 @@
From 5827fd456bcd7747fca2bb4f447c59ce7886a061 Mon Sep 17 00:00:00 2001
From ef51fb40f756e2d7a7de4d285590305c782ba9b7 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Wed, 16 Jun 2021 11:08:32 +0200
Subject: [PATCH 2/2] Include sys/select.h
Subject: [PATCH 2/3] Include sys/select.h
---
SDLnetsys.h | 1 +

View File

@ -0,0 +1,94 @@
From 3986e0cc88c73b1ecb21b831f807333e1c46dad7 Mon Sep 17 00:00:00 2001
From: Tim Schumacher <timschumi@gmx.de>
Date: Sun, 29 May 2022 15:01:28 +0200
Subject: [PATCH 3/3] 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 8c1d2d4..8ea327f 100755
--- a/configure
+++ b/configure
@@ -4487,6 +4487,10 @@ sysv4 | sysv4.3*)
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+
+serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
fi
@@ -7272,6 +7276,10 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
lt_prog_compiler_static='-Bstatic'
;;
+ serenity*)
+ lt_prog_compiler_can_build_shared=yes
+ ;;
+
*)
lt_prog_compiler_can_build_shared=no
;;
@@ -8508,6 +8516,10 @@ rm -f core conftest.err conftest.$ac_objext \
hardcode_shlibpath_var=no
;;
+ serenity*)
+ ld_shlibs=yes
+ ;;
+
*)
ld_shlibs=no
;;
@@ -9410,6 +9422,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
;;
@@ -14947,6 +14970,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

View File

@ -11,3 +11,17 @@ FIXME: We don't know why yet.
Include sys/select.h
## `0003-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.