diff --git a/Ports/SDL2_net/package.sh b/Ports/SDL2_net/package.sh index fdec08db09..f3291a466e 100755 --- a/Ports/SDL2_net/package.sh +++ b/Ports/SDL2_net/package.sh @@ -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 -} diff --git a/Ports/SDL2_net/patches/0001-Undefine-SIOCGIFCONF-on-serenity.patch b/Ports/SDL2_net/patches/0001-Undefine-SIOCGIFCONF-on-serenity.patch index b9a96c3b58..98b64ab9af 100644 --- a/Ports/SDL2_net/patches/0001-Undefine-SIOCGIFCONF-on-serenity.patch +++ b/Ports/SDL2_net/patches/0001-Undefine-SIOCGIFCONF-on-serenity.patch @@ -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 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. --- diff --git a/Ports/SDL2_net/patches/0002-Include-sys-select.h.patch b/Ports/SDL2_net/patches/0002-Include-sys-select.h.patch index a810d42c61..2821579de5 100644 --- a/Ports/SDL2_net/patches/0002-Include-sys-select.h.patch +++ b/Ports/SDL2_net/patches/0002-Include-sys-select.h.patch @@ -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 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 + diff --git a/Ports/SDL2_net/patches/0003-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/SDL2_net/patches/0003-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 0000000000..ee7f0960c6 --- /dev/null +++ b/Ports/SDL2_net/patches/0003-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,94 @@ +From 3986e0cc88c73b1ecb21b831f807333e1c46dad7 Mon Sep 17 00:00:00 2001 +From: Tim Schumacher +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 + diff --git a/Ports/SDL2_net/patches/ReadMe.md b/Ports/SDL2_net/patches/ReadMe.md index 2f08b6fd38..6939e02b29 100644 --- a/Ports/SDL2_net/patches/ReadMe.md +++ b/Ports/SDL2_net/patches/ReadMe.md @@ -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. +