From 1c381b34e9aadbea3cab61eca81b67d38a394f53 Mon Sep 17 00:00:00 2001 From: Fabian Dellwing Date: Wed, 17 Apr 2024 19:36:15 +0200 Subject: [PATCH] Ports: Add `oniguruma` --- Ports/AvailablePorts.md | 1 + Ports/oniguruma/package.sh | 9 +++ ...hared-library-support-for-SerenityOS.patch | 73 +++++++++++++++++++ Ports/oniguruma/patches/ReadMe.md | 15 ++++ 4 files changed, 98 insertions(+) create mode 100755 Ports/oniguruma/package.sh create mode 100644 Ports/oniguruma/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch create mode 100644 Ports/oniguruma/patches/ReadMe.md diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 0445df6ff2..7f3b6df280 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -234,6 +234,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`nyancat`](nyancat/) | Nyancat | | https://github.com/klange/nyancat | | [`ObjFW`](ObjFW/) | ObjFW | 8d19ba9 | https://objfw.nil.im/ | | [`oksh`](oksh/) | oksh | 7.1 | https://github.com/ibara/oksh | +| [`oniguruma`](oniguruma/) | oniguruma | 6.9.9 | https://github.com/kkos/oniguruma/ | | [`OpenJDK`](OpenJDK/) | OpenJDK | 17.0.6 | https://openjdk.java.net/ | | [`openjpeg`](openjpeg/) | OpenJPEG | 2.5.2 | https://www.openjpeg.org/ | | [`openrct2`](openrct2/) | OpenRCT2 | 0.4.9 | https://openrct2.org/ | diff --git a/Ports/oniguruma/package.sh b/Ports/oniguruma/package.sh new file mode 100755 index 0000000000..80ea8505fe --- /dev/null +++ b/Ports/oniguruma/package.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='oniguruma' +version='6.9.9' +useconfigure='true' +use_fresh_config_sub='true' +files=( + "https://github.com/kkos/oniguruma/releases/download/v${version}/onig-${version}.tar.gz#60162bd3b9fc6f4886d4c7a07925ffd374167732f55dce8c491bfd9cd818a6cf" +) +workdir="onig-${version}" diff --git a/Ports/oniguruma/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/oniguruma/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 0000000000..0758ea95d9 --- /dev/null +++ b/Ports/oniguruma/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tim Schumacher +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 906cbcb..1929b30 100755 +--- a/configure ++++ b/configure +@@ -6522,6 +6522,10 @@ sysv4 | sysv4.3*) + tpf*) + lt_cv_deplibs_check_method=pass_all + ;; ++ ++serenity*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + esac + + fi +@@ -9546,6 +9550,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 + ;; +@@ -10962,6 +10970,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } + hardcode_shlibpath_var=no + ;; + ++ serenity*) ++ ld_shlibs=yes ++ ;; ++ + *) + ld_shlibs=no + ;; +@@ -11977,6 +11989,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 + ;; diff --git a/Ports/oniguruma/patches/ReadMe.md b/Ports/oniguruma/patches/ReadMe.md new file mode 100644 index 0000000000..3ec55979a4 --- /dev/null +++ b/Ports/oniguruma/patches/ReadMe.md @@ -0,0 +1,15 @@ +# Patches for oniguruma 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.