diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-06-03 17:12:43 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-03 20:50:01 +0100 |
commit | 834e0ee614ba19bbff564d2c349a2783029c56b4 (patch) | |
tree | d032a180bc51f09d3e4ebd9c71f8bf211eda8487 /Ports/libxml2 | |
parent | 9213ed85f0633f84013e1e449d30a836eb5dae24 (diff) | |
download | serenity-834e0ee614ba19bbff564d2c349a2783029c56b4.zip |
Ports: Replace manually linking `libxml2` with a libtool patch
Diffstat (limited to 'Ports/libxml2')
-rwxr-xr-x | Ports/libxml2/package.sh | 10 | ||||
-rw-r--r-- | Ports/libxml2/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch | 76 | ||||
-rw-r--r-- | Ports/libxml2/patches/ReadMe.md | 16 |
3 files changed, 93 insertions, 9 deletions
diff --git a/Ports/libxml2/package.sh b/Ports/libxml2/package.sh index 73878a535d..4944ec4049 100755 --- a/Ports/libxml2/package.sh +++ b/Ports/libxml2/package.sh @@ -6,12 +6,4 @@ use_fresh_config_sub=true files="https://download.gnome.org/sources/libxml2/2.9/libxml2-${version}.tar.xz libxml2-${version}.tar.xz 276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e" auth_type=sha256 depends=("libiconv" "xz") -configopts=("--with-sysroot=${SERENITY_INSTALL_ROOT}" "--prefix=/usr/local" "--without-python") - -install() { - run make DESTDIR="${SERENITY_INSTALL_ROOT}" install - - # Link shared library - run ${SERENITY_ARCH}-pc-serenity-gcc -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libxml2.so -Wl,-soname,libxml2.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libxml2.a -Wl,--no-whole-archive -llzma - rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libxml2.la -} +configopts=("--with-sysroot=${SERENITY_INSTALL_ROOT}" "--prefix=/usr/local" "--without-python" "--disable-static" "--enable-shared") diff --git a/Ports/libxml2/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libxml2/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 0000000000..a9030a71cf --- /dev/null +++ b/Ports/libxml2/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,76 @@ +From 897e1d8be1554c6588941574e620a90600b024d0 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 6156015..cfd0935 100755 +--- a/configure ++++ b/configure +@@ -6148,6 +6148,10 @@ tpf*) + os2*) + lt_cv_deplibs_check_method=pass_all + ;; ++ ++serenity*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + esac + + fi +@@ -9300,6 +9304,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 + ;; +@@ -10822,6 +10830,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } + hardcode_shlibpath_var=no + ;; + ++ serenity*) ++ ld_shlibs=yes ++ ;; ++ + *) + ld_shlibs=no + ;; +@@ -11902,6 +11914,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/libxml2/patches/ReadMe.md b/Ports/libxml2/patches/ReadMe.md new file mode 100644 index 0000000000..8642332d7d --- /dev/null +++ b/Ports/libxml2/patches/ReadMe.md @@ -0,0 +1,16 @@ +# Patches for libxml2 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. + |