Bug 1529194 - Allow to opt-in to widevine on aarch64 Windows. r=chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 19 Feb 2019 09:55:41 +0900
changeset 1859842 87199eb0d8d8988eb07b13f270b0f752ae68b37c
parent 1859841 8b50e585eb6fe9b046af1d7a65ddab9b22b21b55
child 1859843 5d168b6ce1d4fd1d9ea9bb2823913796be54a03f
child 1859846 953ff4ede46dbe341409733994092594b27de58f
child 1859854 b80a787e09b835f07f78cf436a24883f65a78933
push id339404
push usermh@glandium.org
push dateWed, 06 Mar 2019 06:20:20 +0000
treeherdertry@13cffbc19e9f [default view] [failures only]
reviewerschmanchester
bugs1529194
milestone67.0a1
Bug 1529194 - Allow to opt-in to widevine on aarch64 Windows. r=chmanchester This uses artifacts from a win32 build to get the necessary DLLs. Differential Revision: https://phabricator.services.mozilla.com/D20597
Makefile.in
browser/installer/Makefile.in
browser/installer/allowed-dupes.mn
browser/installer/package-manifest.in
config/baseconfig.mk
toolkit/moz.configure
--- a/Makefile.in
+++ b/Makefile.in
@@ -165,16 +165,23 @@ endif
 
 # Host binaries are not produced for macOS consumers: that is, there's
 # no macOS-hosted job to produce them at this time.  Therefore we
 # enable --host-bins only for automation builds, which only require Linux and
 # Windows host binaries.
 recurse_artifact:
 	$(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols)$(if $(MOZ_AUTOMATION), --host-bins)
 
+ifdef MOZ_EME_WIN32_ARTIFACT
+recurse_win32-artifact:
+	rm -rf $(DIST)/i686
+	$(topsrcdir)/mach --log-no-times artifact install --job $(if $(MOZ_PGO),win32-pgo,win32-opt) --no-tests --distdir $(DIST)/i686
+	mv $(DIST)/i686/bin/* $(DIST)/i686
+endif
+
 ifdef MOZ_WIDGET_TOOLKIT
 ifdef ENABLE_TESTS
 # Additional makefile targets to call automated test suites
 include $(topsrcdir)/testing/testsuite-targets.mk
 endif
 endif
 
 default all::
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -51,16 +51,20 @@ endif
 ifdef NSS_DISABLE_DBM
 DEFINES += -DNSS_DISABLE_DBM=1
 endif
 
 ifdef MOZ_ARTIFACT_BUILDS
 DEFINES += -DMOZ_ARTIFACT_BUILDS=1
 endif
 
+ifdef MOZ_EME_WIN32_ARTIFACT
+DEFINES += -DMOZ_EME_WIN32_ARTIFACT=1
+endif
+
 DEFINES += -DJAREXT=
 
 ifdef MOZ_ANGLE_RENDERER
 DEFINES += -DMOZ_ANGLE_RENDERER=$(MOZ_ANGLE_RENDERER)
 ifdef MOZ_D3DCOMPILER_VISTA_DLL
 DEFINES += -DMOZ_D3DCOMPILER_VISTA_DLL=$(MOZ_D3DCOMPILER_VISTA_DLL)
 endif
 endif
--- a/browser/installer/allowed-dupes.mn
+++ b/browser/installer/allowed-dupes.mn
@@ -147,8 +147,12 @@ browser/chrome/browser/res/payments/form
 browser/features/formautofill@mozilla.org/chrome/content/autofillEditForms.js
 browser/chrome/browser/res/payments/formautofill/autofillEditForms.js
 # Bug 1451050 - Remote settings empty dumps (will be populated with data eventually)
 browser/defaults/settings/pinning/pins.json
 browser/defaults/settings/main/example.json
 # Bug 1463748 - Fork and pref-off the new error pages
 browser/chrome/browser/content/browser/aboutNetError-new.xhtml
 browser/chrome/browser/content/browser/aboutNetError.xhtml
+#ifdef MOZ_EME_WIN32_ARTIFACT
+gmp-clearkey/0.1/manifest.json
+i686/gmp-clearkey/0.1/manifest.json
+#endif
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -444,8 +444,23 @@ bin/libfreebl_32int64_3.so
 #ifdef XP_LINUX
 @RESPATH@/fix_linux_stack.py
 #endif
 #endif
 
 #ifdef PKG_LOCALE_MANIFEST
 #include @PKG_LOCALE_MANIFEST@
 #endif
+
+#ifdef MOZ_EME_WIN32_ARTIFACT
+i686/plugin-container.exe
+i686/xul.dll
+i686/nss3.dll
+i686/mozglue.dll
+i686/lgpllibs.dll
+i686/msvcp140.dll
+i686/vcruntime140.dll
+i686/gmp-clearkey/0.1/clearkey.dll
+[eme destdir="i686"]
+; We assume the file we generate locally is the same as what was in the win32
+; build, which, practically speaking, is the case.
+@BINPATH@/gmp-clearkey/0.1/manifest.json
+#endif
--- a/config/baseconfig.mk
+++ b/config/baseconfig.mk
@@ -37,17 +37,17 @@ ifeq (a,$(firstword a$(subst /, ,$(srcdi
 $(error MSYS-style srcdir are not supported for Windows builds.)
 endif
 endif
 endif # WINNT
 
 ifndef INCLUDED_AUTOCONF_MK
 default::
 else
-TIERS := $(if $(MOZ_ARTIFACT_BUILDS),artifact )pre-export export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools$(if $(filter check recurse_check,$(MAKECMDGOALS)), check)
+TIERS := $(if $(MOZ_ARTIFACT_BUILDS),artifact )$(if $(MOZ_EME_WIN32_ARTIFACT),win32-artifact )pre-export export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools$(if $(filter check recurse_check,$(MAKECMDGOALS)), check)
 endif
 
 # These defines are used to support the twin-topsrcdir model for comm-central.
 ifdef MOZILLA_SRCDIR
   MOZILLA_DIR = $(MOZILLA_SRCDIR)
 else
   MOZILLA_DIR = $(topsrcdir)
 endif
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -512,23 +512,27 @@ set_define('MOZ_OMX', openmax)
 # EME Support
 # ==============================================================
 @depends(target)
 def eme_choices(target):
     if (target.kernel in ('Darwin', 'WINNT', 'Linux') and
         target.os not in ('Android', 'iOS') and
         target.cpu in ('x86', 'x86_64')):
         return ('widevine',)
+    if target.kernel == 'WINNT' and target.cpu == 'aarch64':
+        return ('widevine',)
 
 
-# Widevine is enabled by default in desktop browser builds.
-@depends(build_project, eme_choices)
-def eme_default(build_project, choices):
+# Widevine is enabled by default in desktop browser builds, except
+# on aarch64 Windows.
+@depends(build_project, eme_choices, target)
+def eme_default(build_project, choices, target):
     if build_project == 'browser':
-        return choices
+        if target.kernel != 'WINNT' or target.cpu != 'aarch64':
+            return choices
 
 
 option('--enable-eme',
        nargs='+',
        choices=eme_choices,
        default=eme_default,
        when=eme_choices,
        help='{Enable|Disable} support for Encrypted Media Extensions')
@@ -545,16 +549,25 @@ def eme(enabled, fmp4):
 def eme_modules(value):
     return value
 
 
 # Fallback to an empty list when eme_choices is empty, setting eme_modules to
 # None.
 set_config('MOZ_EME_MODULES', eme_modules | dependable([]))
 
+
+@depends(eme_modules, target, when=eme_modules)
+def eme_win32_artifact(modules, target):
+    if 'widevine' in modules and target.kernel == 'WINNT' and target.cpu == 'aarch64':
+        return True
+
+
+set_config('MOZ_EME_WIN32_ARTIFACT', eme_win32_artifact)
+
 option(name='--enable-chrome-format',
        help='Select FORMAT of chrome files during packaging.',
        nargs=1,
        choices=('omni', 'jar', 'flat'),
        default='omni')
 
 @depends('--enable-chrome-format')
 def packager_format(value):