diff --git a/BUILD.gn b/BUILD.gn index 52e1e9616..795bc6932 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -789,6 +789,7 @@ static_library("libcef_static") { "//third_party/libxml", "//third_party/WebKit/public:blink", "//third_party/widevine/cdm:headers", + "//third_party/widevine/cdm:widevinecdmadapter", "//third_party/icu", "//third_party/zlib:minizip", "//tools/v8_context_snapshot:v8_context_snapshot", @@ -805,11 +806,6 @@ static_library("libcef_static") { "//v8", ] - if (!is_mac) { - # TODO(cef): Enable for Mac once Widevine build errors are resolved. - deps += [ "//third_party/widevine/cdm:widevinecdmadapter" ] - } - if (is_win) { sources += gypi_paths2.includes_win + [ "libcef/browser/browser_main_win.cc", @@ -1366,8 +1362,7 @@ if (is_mac) { "$root_out_dir/cef_extensions.pak", "$root_out_dir/devtools_resources.pak", "$root_out_dir/v8_context_snapshot.bin", - # TODO(cef): Restore this line once Widevine build errors are resolved. - # "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", + "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", ] public_deps = [ @@ -1376,8 +1371,7 @@ if (is_mac) { ":pak_200_percent", ":pak_devtools", ":pak_extensions", - # TODO(cef): Restore this line once Widevine build errors are resolved. - # "//third_party/widevine/cdm:widevinecdmadapter", + "//third_party/widevine/cdm:widevinecdmadapter", "//tools/v8_context_snapshot:v8_context_snapshot", ] diff --git a/patch/patch.cfg b/patch/patch.cfg index f64c9db99..9fa63293d 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -331,4 +331,9 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2274 'name': 'win_rt_2274', }, + { + # macOS: Fix build of widevinecdmadapter.plugin. + # https://bitbucket.org/chromiumembedded/cef/issues/2314 + 'name': 'mac_widevine_2314', + }, ] diff --git a/patch/patches/mac_widevine_2314.patch b/patch/patches/mac_widevine_2314.patch new file mode 100644 index 000000000..9b702d5eb --- /dev/null +++ b/patch/patches/mac_widevine_2314.patch @@ -0,0 +1,21 @@ +diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn +index a3eac59cc2eb..d14e71e0319b 100644 +--- third_party/widevine/cdm/BUILD.gn ++++ third_party/widevine/cdm/BUILD.gn +@@ -111,14 +111,8 @@ if (widevine_cdm_binary_files != []) { + ] + + if (is_mac) { +- ldflags = [ +- # Not to strip important symbols by -Wl,-dead_strip. +- "-Wl,-exported_symbol,_PPP_GetInterface", +- "-Wl,-exported_symbol,_PPP_InitializeModule", +- "-Wl,-exported_symbol,_PPP_ShutdownModule", +- ] +- #TODO(jrummell) Mac: 'DYLIB_INSTALL_NAME_BASE': '@loader_path', +- } else if (is_posix && !is_mac) { ++ ldflags = [ "-Wl,-install_name,@loader_path/libwidevinecdm.dylib" ] ++ } else if (is_posix) { + cflags = [ "-fvisibility=hidden" ] + } + } diff --git a/tools/distrib/mac/widevinecdmadapter.plugin b/tools/distrib/mac/widevinecdmadapter.plugin deleted file mode 100644 index 004ae9793..000000000 Binary files a/tools/distrib/mac/widevinecdmadapter.plugin and /dev/null differ diff --git a/tools/make_distrib.py b/tools/make_distrib.py index 99dbd4a2b..9382149d4 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -842,11 +842,11 @@ elif platform == 'macosx': valid_build_dir = build_dir dst_dir = os.path.join(output_dir, 'Debug') make_dir(dst_dir, options.quiet) + framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name) copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \ - os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet) - copy_file( - os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'), - dst_dir, options.quiet) + framework_dst_dir, options.quiet) + move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \ + os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet) if not options.nosymbols: # create the symbol output directory @@ -869,11 +869,11 @@ elif platform == 'macosx': dst_dir = os.path.join(output_dir, 'Release') make_dir(dst_dir, options.quiet) if mode != 'client': + framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name) copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \ - os.path.join(dst_dir, '%s.framework' % framework_name), options.quiet) - copy_file( - os.path.join(script_dir, 'distrib/mac/widevinecdmadapter.plugin'), - dst_dir, options.quiet) + framework_dst_dir, options.quiet) + move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \ + os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet) else: copy_dir( os.path.join(build_dir, 'cefclient.app'),