diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-06-03 17:07:34 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-03 20:50:01 +0100 |
commit | e3b29ef61c8bb40d821e235a20d5b42e9fbeec62 (patch) | |
tree | 98be13030beed443e3cbcc5f3a9bf1b7a2a54b62 /Ports/libtiff | |
parent | bd7bcd240797f1b74a889a39245eaa2d08f019c9 (diff) | |
download | serenity-e3b29ef61c8bb40d821e235a20d5b42e9fbeec62.zip |
Ports: Replace manually linking `libtiff` with a libtool patch
Diffstat (limited to 'Ports/libtiff')
-rwxr-xr-x | Ports/libtiff/package.sh | 8 | ||||
-rw-r--r-- | Ports/libtiff/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch | 94 | ||||
-rw-r--r-- | Ports/libtiff/patches/ReadMe.md | 16 |
3 files changed, 111 insertions, 7 deletions
diff --git a/Ports/libtiff/package.sh b/Ports/libtiff/package.sh index 8701580865..4cc200807b 100755 --- a/Ports/libtiff/package.sh +++ b/Ports/libtiff/package.sh @@ -2,14 +2,8 @@ port=libtiff version=4.3.0 useconfigure=true +configopts=("--disable-static" "--enable-shared") workdir="tiff-$version" files="http://download.osgeo.org/libtiff/tiff-${version}.tar.gz tiff-${version}.tar.gz 0e46e5acb087ce7d1ac53cf4f56a09b221537fc86dfc5daaad1c2e89e1b37ac8" auth_type="sha256" depends=("libjpeg" "zstd" "xz") - -install() { - run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.so -Wl,-soname,libtiff.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.a -Wl,--no-whole-archive -lzstd -llzma -ljpeg - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.so -Wl,-soname,libtiffxx.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.a -Wl,--no-whole-archive -lzstd -llzma -ljpeg - rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.la ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.la -} diff --git a/Ports/libtiff/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libtiff/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 0000000000..5804c58371 --- /dev/null +++ b/Ports/libtiff/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,94 @@ +From 9f36cd059f2ea7ae5233519fd7f486850d623014 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 | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/configure b/configure +index 1d9918f..e1e8caa 100755 +--- a/configure ++++ b/configure +@@ -6439,6 +6439,10 @@ tpf*) + os2*) + lt_cv_deplibs_check_method=pass_all + ;; ++ ++serenity*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + esac + + fi +@@ -10022,6 +10026,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 + ;; +@@ -11544,6 +11552,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } + hardcode_shlibpath_var=no + ;; + ++ serenity*) ++ ld_shlibs=yes ++ ;; ++ + *) + ld_shlibs=no + ;; +@@ -12624,6 +12636,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 + ;; +@@ -17019,6 +17042,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/libtiff/patches/ReadMe.md b/Ports/libtiff/patches/ReadMe.md new file mode 100644 index 0000000000..54a371ecf1 --- /dev/null +++ b/Ports/libtiff/patches/ReadMe.md @@ -0,0 +1,16 @@ +# Patches for libtiff 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. + |