Ports: Replace manually linking libsodium with a libtool patch

This commit is contained in:
Tim Schumacher 2022-06-03 16:59:59 +02:00 committed by Linus Groh
parent e9e6dd925c
commit 6d20f2aaa1
Notes: sideshowbarker 2024-07-17 10:27:56 +09:00
3 changed files with 93 additions and 6 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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.