Updated to 118.0.1, Use system libraries for AV1, VP8, VP9, and WebP

This commit is contained in:
Martin Stransky 2023-09-29 11:43:29 +02:00
parent 36a09da5bc
commit 6c0e8c3949
5 changed files with 187 additions and 5 deletions

2
.gitignore vendored
View File

@ -599,3 +599,5 @@ firefox-3.6.4.source.tar.bz2
/firefox-langpacks-117.0.1-20230913.tar.xz
/firefox-118.0.source.tar.xz
/firefox-langpacks-118.0-20230925.tar.xz
/firefox-langpacks-118.0.1-20230929.tar.xz
/firefox-118.0.1.source.tar.xz

View File

@ -0,0 +1,114 @@
From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001
From: Thomas Deutschmann <whissi@gentoo.org>
Date: Mon, 6 Apr 2020 19:36:02 +0200
Subject: [PATCH 06/30] bmo#1559213: Support system av1
Allow building against system-wide av1.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
---
config/external/moz.build | 5 +++--
config/system-headers.mozbuild | 8 ++++++++
dom/media/platforms/moz.build | 5 +++++
toolkit/moz.configure | 20 ++++++++++++++++++--
4 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/config/external/moz.build b/config/external/moz.build
index ab771212bf..75595d999c 100644
--- a/config/external/moz.build
+++ b/config/external/moz.build
@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
external_dirs += ["media/libvpx"]
if CONFIG["MOZ_AV1"]:
- external_dirs += ["media/libaom"]
- external_dirs += ["media/libdav1d"]
+ if not CONFIG["MOZ_SYSTEM_AV1"]:
+ external_dirs += ["media/libaom"]
+ external_dirs += ["media/libdav1d"]
if not CONFIG["MOZ_SYSTEM_PNG"]:
external_dirs += ["media/libpng"]
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
index 2f7ae39515..96ab3a6466 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
'proxy.h',
]
+if CONFIG['MOZ_SYSTEM_AV1']:
+ system_headers += [
+ 'aom/aom_decoder.h',
+ 'aom/aomdx.h',
+ 'aom/aom_image.h',
+ 'dav1d/dav1d.h',
+ ]
+
if CONFIG['MOZ_SYSTEM_LIBVPX']:
system_headers += [
'vpx_mem/vpx_mem.h',
diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
index 8509aec6ef..7c5a1df63d 100644
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
"agnostic/AOMDecoder.cpp",
"agnostic/DAV1DDecoder.cpp",
]
+ if CONFIG["MOZ_SYSTEM_AV1"]:
+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
if CONFIG["MOZ_OMX"]:
EXPORTS += [
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index a68e1b347d..7b7975bd12 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -544,14 +544,29 @@ def av1(value):
if value:
return True
+option("--with-system-av1", help="Use system av1 (located with pkg-config)")
-@depends(target, when=av1 & compile_environment)
+system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
+ when='--with-system-av1')
+
+system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1',
+ when='--with-system-av1')
+
+@depends(system_libaom_info, system_libdav1d_info)
+def system_av1(system_libaom_info, system_libdav1d_info):
+ has_av1_libs = False
+ if system_libaom_info and system_libdav1d_info:
+ has_av1_libs = True
+ return has_av1_libs
+
+
+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
def dav1d_asm(target):
if target.cpu in ("aarch64", "x86", "x86_64"):
return True
-@depends(target, when=av1 & compile_environment)
+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
def dav1d_nasm(target):
if target.cpu in ("x86", "x86_64"):
return namespace(version="2.14", what="AV1")
@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
set_define("MOZ_DAV1D_ASM", dav1d_asm)
set_config("MOZ_AV1", av1)
set_define("MOZ_AV1", av1)
+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
# JXL Image Codec Support
# ==============================================================
--
2.34.1

View File

@ -0,0 +1,22 @@
diff -Naur a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build
--- a/media/ffvpx/libavcodec/moz.build 2023-08-01 09:34:20.242044722 +0300
+++ b/media/ffvpx/libavcodec/moz.build 2023-08-01 09:36:01.445808739 +0300
@@ -109,10 +109,14 @@
'vp9recon.c',
'vpx_rac.c',
]
- USE_LIBS += [
- 'dav1d',
- 'media_libdav1d_asm',
- ]
+ if CONFIG["MOZ_SYSTEM_AV1"]:
+ CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
+ OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
+ else:
+ USE_LIBS += [
+ 'dav1d',
+ 'media_libdav1d_asm',
+ ]
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
LOCAL_INCLUDES += ['/media/mozva']
SOURCES += [

View File

@ -55,9 +55,11 @@ ExcludeArch: i686
%endif
%global system_ffi 1
%global system_libvpx 0
%global system_av1 1
%global system_libvpx 1
%global system_jpeg 1
%global system_pixman 1
%global system_webp 1
# Bundled cbindgen makes build slow.
# Enable only if system cbindgen is not available.
%if 0%{?rhel}
@ -108,8 +110,15 @@ ExcludeArch: i686
%global cairo_version 1.13.1
%global freetype_version 2.1.9
%global libnotify_version 0.7.0
%if %{?system_av1}
%global aom_version 1.0.0
%global dav1d_version 1.0.0
%endif
%if %{?system_libvpx}
%global libvpx_version 1.8.2
%global libvpx_version 1.10.0
%endif
%if %{?system_webp}
%global libwebp_version 1.1.0
%endif
%if %{?system_nss}
@ -159,13 +168,13 @@ ExcludeArch: i686
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 118.0
Release: 2%{?pre_tag}%{?dist}
Version: 118.0.1
Release: 1%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
%if %{with langpacks}
Source1: firefox-langpacks-%{version}%{?pre_version}-20230925.tar.xz
Source1: firefox-langpacks-%{version}%{?pre_version}-20230929.tar.xz
%endif
Source2: cbindgen-vendor.tar.xz
Source10: firefox-mozconfig
@ -242,6 +251,10 @@ Patch600: pgo.patch
Patch602: mozilla-1516803.patch
Patch603: firefox-gcc-always-inline.patch
# system AV1 patches (from Gentoo)
Patch800: bmo-1559213-Support-system-av1.patch
Patch801: bmo-1559213-fix-system-av1-libs.patch
# tentative patch for RUSTFLAGS parsing issue:
# https://bugzilla.redhat.com/show_bug.cgi?id=2184743
# https://bugzilla.mozilla.org/show_bug.cgi?id=1474486
@ -275,9 +288,17 @@ BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(alsa)
BuildRequires: dbus-glib-devel
%if %{?system_av1}
BuildRequires: pkgconfig(aom) >= %{aom_version}
BuildRequires: pkgconfig(dav1d) >= %{dav1d_version}
%endif
%if %{?system_libvpx}
BuildRequires: libvpx-devel >= %{libvpx_version}
%endif
%if %{?system_webp}
BuildRequires: pkgconfig(libwebp) >= %{libwebp_version}
BuildRequires: pkgconfig(libwebpdemux) >= %{libwebp_version}
%endif
BuildRequires: autoconf213
BuildRequires: pkgconfig(libpulse)
BuildRequires: yasm
@ -520,6 +541,9 @@ This package contains results of tests executed during build.
%endif
%patch603 -p1 -b .inline
%patch800 -p1 -b .system-av1
%patch801 -p1 -b .system-av1-fixup
%patch1200 -p1 -b .rustflags-commasplit
rm -f .mozconfig
@ -599,12 +623,24 @@ echo "ac_add_options --with-system-jpeg" >> .mozconfig
echo "ac_add_options --enable-system-pixman" >> .mozconfig
%endif
%if %{?system_av1}
echo "ac_add_options --with-system-av1" >> .mozconfig
%else
echo "ac_add_options --without-system-av1" >> .mozconfig
%endif
%if %{?system_libvpx}
echo "ac_add_options --with-system-libvpx" >> .mozconfig
%else
echo "ac_add_options --without-system-libvpx" >> .mozconfig
%endif
%if %{?system_webp}
echo "ac_add_options --with-system-webp" >> .mozconfig
%else
echo "ac_add_options --without-system-webp" >> .mozconfig
%endif
%ifarch s390x
echo "ac_add_options --disable-jit" >> .mozconfig
%endif
@ -1075,6 +1111,12 @@ fi
#---------------------------------------------------------------------
%changelog
* Wed Sep 27 2023 Neal Gompa <ngompa@fedoraproject.org> - 118.0.1-1
- Use system libraries for AV1, VP8, VP9, and WebP
* Fri Sep 29 2023 Martin Stransky <stransky@redhat.com>- 118.0.1-1
- Updated to 118.0.1
* Wed Sep 27 2023 Martin Stransky <stransky@redhat.com>- 118.0-2
- Fixed Gnome search provider

View File

@ -2,3 +2,5 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2
SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36
SHA512 (firefox-118.0.source.tar.xz) = 7c34c43930bda84d17a241fe7e0f8e6ca262410423ae7e7cc8444224aea2d25a52acc9079064ba57f3350e3573eb23aeaf7a2d98136d17e6fa89a61aaf57155d
SHA512 (firefox-langpacks-118.0-20230925.tar.xz) = 5a51a9843fba00779e718649154ea484ec3787fffcbb787a2f172bd7a1be99a87588abae17c1b38f9fb76c1d0e27fb453d1766285107a5b363bba047daae2579
SHA512 (firefox-langpacks-118.0.1-20230929.tar.xz) = ea3923d854bce960b3a8ec859145fc7dcc878f389be5ed9f837a28268fc0f03482e7e073fe9a5207e7cccb6b7e6c4a8151ed409821e3ca38b795574354227013
SHA512 (firefox-118.0.1.source.tar.xz) = b1efa1afea70434dc2a18d335bb8b526883cde200f1503b8c5fd2e7db8285e6a999cfa3aac354ea1c15a91d13a46d68db37023235314240b59eb8f55e01554ad