summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-06-03 16:41:48 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-03 20:50:01 +0100
commita97899c0883b3a0aa2cc2b1fc5645dc9e2e44c57 (patch)
treef2182cb8cf07ee87110b885d2016a810747aa4a4 /Ports
parent9e1de61613c99767fd1bdc5181887a213ebbda23 (diff)
downloadserenity-a97899c0883b3a0aa2cc2b1fc5645dc9e2e44c57.zip
Ports: Replace manually linking `libiconv` with a libtool patch
Diffstat (limited to 'Ports')
-rwxr-xr-xPorts/libiconv/package.sh6
-rw-r--r--Ports/libiconv/patches/0001-Stub-out-getprogname-for-serenity.patch4
-rw-r--r--Ports/libiconv/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch76
-rw-r--r--Ports/libiconv/patches/ReadMe.md14
4 files changed, 92 insertions, 8 deletions
diff --git a/Ports/libiconv/package.sh b/Ports/libiconv/package.sh
index 7bbde3a9b2..e4eb13ed54 100755
--- a/Ports/libiconv/package.sh
+++ b/Ports/libiconv/package.sh
@@ -7,9 +7,3 @@ files="https://ftpmirror.gnu.org/gnu/libiconv/libiconv-${version}.tar.gz libicon
auth_type="sha256"
use_fresh_config_sub=true
config_sub_paths=("build-aux/config.sub" "libcharset/build-aux/config.sub")
-
-install() {
- run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install
- run ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libiconv.so -Wl,-soname,libiconv.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libiconv.a -Wl,--no-whole-archive
- rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libiconv.la
-}
diff --git a/Ports/libiconv/patches/0001-Stub-out-getprogname-for-serenity.patch b/Ports/libiconv/patches/0001-Stub-out-getprogname-for-serenity.patch
index 303e51e34c..3acfa2ee29 100644
--- a/Ports/libiconv/patches/0001-Stub-out-getprogname-for-serenity.patch
+++ b/Ports/libiconv/patches/0001-Stub-out-getprogname-for-serenity.patch
@@ -1,7 +1,7 @@
-From 9b61ddd52828042b106d7d4c3fef582be9c933e7 Mon Sep 17 00:00:00 2001
+From 74f7065ed6f9cf338f53657ea08e980328dd27c6 Mon Sep 17 00:00:00 2001
From: Vincent Sanders <vince@kyllikki.org>
Date: Sun, 6 Oct 2019 11:11:16 +0100
-Subject: [PATCH 1/1] Stub out getprogname() for serenity
+Subject: [PATCH 1/2] Stub out getprogname() for serenity
---
srclib/getprogname.c | 2 ++
diff --git a/Ports/libiconv/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libiconv/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch
new file mode 100644
index 0000000000..0ddb432ec4
--- /dev/null
+++ b/Ports/libiconv/patches/0002-libtool-Enable-shared-library-support-for-SerenityOS.patch
@@ -0,0 +1,76 @@
+From bdcb52aa7f451346423c3468ab124c57464b1b5a Mon Sep 17 00:00:00 2001
+From: Tim Schumacher <timschumi@gmx.de>
+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 | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/configure b/configure
+index 3488d1d..33b4956 100755
+--- a/configure
++++ b/configure
+@@ -7376,6 +7376,10 @@ tpf*)
+ os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
++
++serenity*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
+ esac
+
+ fi
+@@ -10688,6 +10692,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
+ ;;
+@@ -12206,6 +12214,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ hardcode_shlibpath_var=no
+ ;;
+
++ serenity*)
++ ld_shlibs=yes
++ ;;
++
+ *)
+ ld_shlibs=no
+ ;;
+@@ -13274,6 +13286,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/libiconv/patches/ReadMe.md b/Ports/libiconv/patches/ReadMe.md
index 8adfac6a09..779a29f555 100644
--- a/Ports/libiconv/patches/ReadMe.md
+++ b/Ports/libiconv/patches/ReadMe.md
@@ -5,3 +5,17 @@
Stub out getprogname() for serenity
+## `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.
+