diff --git a/Ports/libtheora/package.sh b/Ports/libtheora/package.sh index 0a7431164e2..7710cc89558 100755 --- a/Ports/libtheora/package.sh +++ b/Ports/libtheora/package.sh @@ -2,21 +2,9 @@ port=libtheora version=1.1.1 useconfigure=true +configopts=() use_fresh_config_sub=true files="https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-${version}.tar.bz2 libtheora-${version}.tar.bz2 b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc" auth_type="sha256" depends=("libvorbis") -configopts=("--disable-examples") - -build_shared() { - local name=$1 - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/${name}.so -Wl,-soname,${name}.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/${name}.a -Wl,--no-whole-archive - rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/${name}.la -} - -install() { - run make DESTDIR=${SERENITY_INSTALL_ROOT} "${installopts[@]}" install - build_shared libtheora - build_shared libtheoradec - build_shared libtheoraenc -} +configopts=("--disable-examples" "--disable-static" "--enable-shared") diff --git a/Ports/libtheora/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch b/Ports/libtheora/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch new file mode 100644 index 00000000000..71120f33777 --- /dev/null +++ b/Ports/libtheora/patches/0001-libtool-Enable-shared-library-support-for-SerenityOS.patch @@ -0,0 +1,76 @@ +From 8c634afaee47bbf9a3fffc0452b740d040a4df98 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 9703bcb..548051c 100755 +--- a/configure ++++ b/configure +@@ -5643,6 +5643,10 @@ sysv4 | sysv4.3*) + tpf*) + lt_cv_deplibs_check_method=pass_all + ;; ++ ++serenity*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; + esac + + fi +@@ -8216,6 +8220,10 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + lt_prog_compiler_static='-Bstatic' + ;; + ++ serenity*) ++ lt_prog_compiler_can_build_shared=yes ++ ;; ++ + *) + lt_prog_compiler_can_build_shared=no + ;; +@@ -9540,6 +9548,10 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + hardcode_shlibpath_var=no + ;; + ++ serenity*) ++ ld_shlibs=yes ++ ;; ++ + *) + ld_shlibs=no + ;; +@@ -10475,6 +10487,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/libtheora/patches/ReadMe.md b/Ports/libtheora/patches/ReadMe.md new file mode 100644 index 00000000000..88edd956446 --- /dev/null +++ b/Ports/libtheora/patches/ReadMe.md @@ -0,0 +1,16 @@ +# Patches for libtheora 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. +