summaryrefslogtreecommitdiff
path: root/Ports/libsodium
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-06-03 16:59:59 +0200
committerLinus Groh <mail@linusgroh.de>2022-06-03 20:50:01 +0100
commit6d20f2aaa11ef6666e99c7d0b855b7e25c9e1d81 (patch)
tree256c59b478c895d9baabc6d6e3824ec9460be78f /Ports/libsodium
parente9e6dd925cf1017dd93eb9304ed4cd31bac729e6 (diff)
downloadserenity-6d20f2aaa11ef6666e99c7d0b855b7e25c9e1d81.zip
Ports: Replace manually linking `libsodium` with a libtool patch
Diffstat (limited to 'Ports/libsodium')
-rwxr-xr-xPorts/libsodium/package.sh7
-rw-r--r--Ports/libsodium/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch76
-rw-r--r--Ports/libsodium/patches/ReadMe.md16
3 files changed, 93 insertions, 6 deletions
diff --git a/Ports/libsodium/package.sh b/Ports/libsodium/package.sh
index fecf020f21..3261cb5438 100755
--- a/Ports/libsodium/package.sh
+++ b/Ports/libsodium/package.sh
@@ -2,14 +2,9 @@
port=libsodium
version=1.0.18
useconfigure=true
+configopts=("--disable-static" "--enable-shared")
use_fresh_config_sub=true
config_sub_paths=("build-aux/config.sub")
workdir=libsodium-${version}
files="https://download.libsodium.org/libsodium/releases/libsodium-${version}.tar.gz libsodium-${version}.tar.gz 6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1"
auth_type=sha256
-
-install() {
- run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install
- ${CC} -shared -pthread -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libsodium.so -Wl,-soname,libsodium.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libsodium.a -Wl,--no-whole-archive
- rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libsodium.la
-}
diff --git a/Ports/libsodium/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libsodium/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch
new file mode 100644
index 0000000000..9fd321753f
--- /dev/null
+++ b/Ports/libsodium/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch
@@ -0,0 +1,76 @@
+From 24fdb0b1d714807f338b1a96ae7c30db19e9a7e2 Mon Sep 17 00:00:00 2001
+From: Tim Schumacher <timschumi@gmx.de>
+Date: Sun, 29 May 2022 15:01:28 +0200
+Subject: [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.
+---
+ configure | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+diff --git a/configure b/configure
+index 6063204..73853e4 100755
+--- a/configure
++++ b/configure
+@@ -10278,6 +10278,10 @@ tpf*)
+ os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
++
++serenity*)
++ lt_cv_deplibs_check_method=pass_all
++ ;;
+ esac
+
+ fi
+@@ -13296,6 +13300,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
+ ;;
+@@ -14814,6 +14822,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ hardcode_shlibpath_var=no
+ ;;
+
++ serenity*)
++ ld_shlibs=yes
++ ;;
++
+ *)
+ ld_shlibs=no
+ ;;
+@@ -15882,6 +15894,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/libsodium/patches/ReadMe.md b/Ports/libsodium/patches/ReadMe.md
new file mode 100644
index 0000000000..2f5d331891
--- /dev/null
+++ b/Ports/libsodium/patches/ReadMe.md
@@ -0,0 +1,16 @@
+# Patches for libsodium on SerenityOS
+
+## `0001-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.
+