summaryrefslogtreecommitdiffstats
path: root/http
diff options
context:
space:
mode:
authorIsmael Luceno2019-09-24 01:50:33 +0200
committerIsmael Luceno2019-09-24 01:50:33 +0200
commit819bcf79c8342fee0f0937d90a1a7840ac587451 (patch)
treec38519d14970ba838b012b445dccc46f30d2c445 /http
parent827607eeec1c51c1f3b5ae003f094865d9ddee62 (diff)
firefox: Add patch to use system dav1d
Diffstat (limited to 'http')
-rwxr-xr-xhttp/firefox/DEPENDS2
-rw-r--r--http/firefox/HISTORY4
-rw-r--r--http/firefox/patches/7002_system_av1_support.patch138
3 files changed, 143 insertions, 1 deletions
diff --git a/http/firefox/DEPENDS b/http/firefox/DEPENDS
index 1a93a60c9b..c3244cc407 100755
--- a/http/firefox/DEPENDS
+++ b/http/firefox/DEPENDS
@@ -134,6 +134,6 @@ optional_depends harfbuzz \
"for system harfbuzz" &&
optional_depends dav1d \
- "--enable-av1" \
+ "--enable-av1 --with-system-av1" \
"--disable-av1" \
"for AV1 video support"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index a2153e79c6..2d0d5e869b 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,7 @@
+2019-09-23 Ismael Luceno <ismael@sourcemage.org>
+ * DEPENDS, patches/7002_system_av1_support.patch: Added patch to use
+ system dav1d
+
2019-09-18 Pavel Vinogradov <public@sourcemage.org>
* DETAILS: version 69.0.1, SECURITY_PATCH++, (CVE-2019-11754)
diff --git a/http/firefox/patches/7002_system_av1_support.patch b/http/firefox/patches/7002_system_av1_support.patch
new file mode 100644
index 0000000000..38ef6ae81c
--- /dev/null
+++ b/http/firefox/patches/7002_system_av1_support.patch
@@ -0,0 +1,138 @@
+# HG changeset patch
+# User Thomas Deutschmann <whissi@gentoo.org>
+
+# Parent 66f9c84511dda432587261f6b9ebf07c4771aad8
+Add ability to use system-av1 (media-libs/libaom and media-libs/dav1d) instead of bundled.
+
+diff --git a/config/external/moz.build b/config/external/moz.build
+--- a/config/external/moz.build
++++ b/config/external/moz.build
+@@ -32,18 +32,19 @@ if CONFIG['MOZ_TREMOR']:
+
+ if CONFIG['MOZ_WEBM_ENCODER']:
+ external_dirs += ['media/libmkv']
+
+ 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']
+
+ if not CONFIG['MOZ_SYSTEM_WEBP']:
+ external_dirs += ['media/libwebp']
+
+ if CONFIG['CPU_ARCH'] == 'arm':
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1311,16 +1311,24 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']:
+ system_headers += [
+ 'QtSparql/qsparqlconnection.h',
+ 'QtSparql/qsparqlquery.h',
+ 'QtSparql/qsparqlresult.h',
+ 'SelectMultipleContentItemsPage.h',
+ 'SelectSingleContentItemPage.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',
+ 'vpx/svc_context.h',
+ 'vpx/vp8cx.h',
+ 'vpx/vp8dx.h',
+ 'vpx/vpx_codec.h',
+ 'vpx/vpx_decoder.h',
+diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -75,16 +75,21 @@ if CONFIG['MOZ_AV1']:
+ EXPORTS += [
+ 'agnostic/AOMDecoder.h',
+ 'agnostic/DAV1DDecoder.h',
+ ]
+ UNIFIED_SOURCES += [
+ '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 += [
+ 'omx/OmxCoreLibLinker.h',
+ ]
+ UNIFIED_SOURCES += [
+ 'omx/OmxCoreLibLinker.cpp',
+ ]
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -460,32 +460,49 @@ imply_option('--enable-fmp4', ffmpeg, '-
+ option('--disable-av1',
+ help='Disable av1 video support')
+
+ @depends('--enable-av1')
+ def av1(value):
+ if value:
+ return True
+
+-@depends(target, nasm_version, when=av1 & compile_environment)
++option('--with-system-av1',
++ help="Use system av1 (located with pkgconfig)")
++
++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, nasm_version, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment)
+ def dav1d_asm(target, nasm_version):
+ if target.os != 'Android':
+ if target.cpu == 'aarch64':
+ return True
+ elif target.cpu in ('x86', 'x86_64'):
+ if nasm_version < '2.13':
+ die('nasm 2.13 or greater is required for AV1 support. '
+ 'Either install nasm or add --disable-av1 to your configure options.')
+ return True
+
+
+ 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))
+
+ # Built-in fragmented MP4 support.
+ # ==============================================================
+ option('--disable-fmp4', env='MOZ_FMP4',
+ help='Disable support for in built Fragmented MP4 parsing')
+
+ @depends('--disable-fmp4', target, wmf, applemedia)
+ def fmp4(value, target, wmf, applemedia):