Ports: Add libwebp

This library includes webp converter to other formats as well and could
be used as reference implementation for performance improvements.
This commit is contained in:
Liav A 2023-08-26 17:51:39 +03:00 committed by Tim Schumacher
parent 64bb5652a1
commit db2701f2e2
Notes: sideshowbarker 2024-07-17 22:55:25 +09:00
4 changed files with 115 additions and 0 deletions

View File

@ -169,6 +169,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
| [`libuuid`](libuuid/) | libuuid (from util-linux) | 2.38 | https://github.com/karelzak/util-linux/tree/master/libuuid |
| [`libuv`](libuv/) | libuv | 1.44.1 | https://github.com/libuv/libuv |
| [`libvorbis`](libvorbis/) | libvorbis | 1.3.7 | https://github.com/xiph/vorbis |
| [`libwebp`](libwebp/) | libwebp | 1.3.1 | https://github.com/webmproject/libwebp |
| [`libxml2`](libxml2/) | libxml2 | 2.9.14 | http://www.xmlsoft.org/ |
| [`libyaml`](libyaml/) | libyaml | 0.2.5 | https://pyyaml.org/wiki/LibYAML |
| [`libzip`](libzip/) | libzip | 1.8.0 | https://libzip.org/ |

15
Ports/libwebp/package.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env -S bash ../.port_include.sh
port='libwebp'
version='1.3.1'
useconfigure='true'
files=(
"https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${version}.tar.gz b3779627c2dfd31e3d8c4485962c2efe17785ef975e2be5c8c0c9e6cd3c4ef66"
)
depends=(
'libjpeg'
'libpng'
'libtiff'
)
configopts=(
"--with-pnglibdir=${SERENITY_INSTALL_ROOT}/usr/local/include"
)

View File

@ -0,0 +1,78 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Liav A <liavalb@gmail.com>
Date: Fri, 1 Sep 2023 23:44:19 +0300
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.
This patch here is a bit more elaborate for other ports, as libintl's
configure includes the code for detecting dynamic linker characteristics
twice, and it also queries the C++ compiler for shared library support.
Co-Authored-By: Daniel Bertalan <dani@danielbertalan.dev>
---
configure | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/configure b/configure
index d4507aa5761e23c732cc219af4c1c119055cb377..884c76f4da0d8d2640b9fa66cd869816ff35c927 100755
--- a/configure
+++ b/configure
@@ -5635,6 +5635,10 @@ else $as_nop
lt_cv_sys_max_cmd_len=8192
;;
+ serenity*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -9224,6 +9228,10 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-fPIC -shared'
;;
+ serenity)
+ lt_prog_compiler_can_build_shared=yes
+ ;;
+
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
@@ -10067,6 +10075,10 @@ _LT_EOF
fi
;;
+ serenity*)
+ ld_shlibs=no
+ ;;
+
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
@@ -11474,6 +11486,16 @@ beos*)
dynamic_linker="$host_os ld.so"
shlibpath_var=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'
+ ;;
bsdi[45]*)
version_type=linux # correct to gnu/linux during the next big refactor

View File

@ -0,0 +1,21 @@
# Patches for libwebp 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.
This patch here is a bit more elaborate for other ports, as libintl's
configure includes the code for detecting dynamic linker characteristics
twice, and it also queries the C++ compiler for shared library support.