summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2015-06-23 01:41:28 +0000
committerMike Gilbert <floppym@gentoo.org>2015-06-23 01:41:28 +0000
commit2f51d5149ccbaa789cdd8347327f79abb00ca53f (patch)
tree3f9ad501f1a4f930b4326b38c0b31410bdd8e727
parentFix udev directory (bug #552784, thanks to Bertrand Jacquin and Mike Gilbert)... (diff)
downloadgentoo-2-2f51d5149ccbaa789cdd8347327f79abb00ca53f.tar.gz
gentoo-2-2f51d5149ccbaa789cdd8347327f79abb00ca53f.tar.bz2
gentoo-2-2f51d5149ccbaa789cdd8347327f79abb00ca53f.zip
Backport hotwording flag.
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
-rw-r--r--www-client/chromium/ChangeLog6
-rw-r--r--www-client/chromium/chromium-44.0.2403.30.ebuild8
-rw-r--r--www-client/chromium/files/chromium-hotwording-2403.patch147
3 files changed, 157 insertions, 4 deletions
diff --git a/www-client/chromium/ChangeLog b/www-client/chromium/ChangeLog
index de7a7abe347e..2f2db10c3710 100644
--- a/www-client/chromium/ChangeLog
+++ b/www-client/chromium/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for www-client/chromium
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.1256 2015/06/21 20:07:47 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.1257 2015/06/23 01:41:28 floppym Exp $
+
+ 23 Jun 2015; Mike Gilbert <floppym@gentoo.org>
+ +files/chromium-hotwording-2403.patch, chromium-44.0.2403.30.ebuild:
+ Backport hotwording flag.
21 Jun 2015; Mike Gilbert <floppym@gentoo.org> chromium-45.0.2431.0.ebuild,
metadata.xml:
diff --git a/www-client/chromium/chromium-44.0.2403.30.ebuild b/www-client/chromium/chromium-44.0.2403.30.ebuild
index 20bc6dc29915..9dda2a7d0236 100644
--- a/www-client/chromium/chromium-44.0.2403.30.ebuild
+++ b/www-client/chromium/chromium-44.0.2403.30.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-44.0.2403.30.ebuild,v 1.1 2015/06/09 02:17:33 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-44.0.2403.30.ebuild,v 1.2 2015/06/23 01:41:28 floppym Exp $
EAPI="5"
PYTHON_COMPAT=( python2_7 )
@@ -16,10 +16,10 @@ DESCRIPTION="Open-source version of Google Chrome web browser"
HOMEPAGE="http://chromium.org/"
SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
-LICENSE="BSD"
+LICENSE="BSD hotwording? ( no-source-code )"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
-IUSE="cups gnome gnome-keyring hidpi kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc"
+IUSE="cups gnome gnome-keyring hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +tcmalloc"
RESTRICT="proprietary-codecs? ( bindist )"
# Native Client binaries are compiled with different set of flags, bug #452066.
@@ -187,6 +187,7 @@ src_prepare() {
# fi
epatch "${FILESDIR}/${PN}-system-jinja-r7.patch"
+ epatch "${FILESDIR}/${PN}-hotwording-2403.patch"
epatch_user
@@ -358,6 +359,7 @@ src_configure() {
$(gyp_use gnome-keyring use_gnome_keyring)
$(gyp_use gnome-keyring linux_link_gnome_keyring)
$(gyp_use hidpi enable_hidpi)
+ $(gyp_use hotwording enable_hotwording)
$(gyp_use kerberos)
$(gyp_use pulseaudio)
$(gyp_use tcmalloc use_allocator tcmalloc none)"
diff --git a/www-client/chromium/files/chromium-hotwording-2403.patch b/www-client/chromium/files/chromium-hotwording-2403.patch
new file mode 100644
index 000000000000..a3904ad03061
--- /dev/null
+++ b/www-client/chromium/files/chromium-hotwording-2403.patch
@@ -0,0 +1,147 @@
+From c2a0c6df7d468da9864c56f2099aa947b07e2535 Mon Sep 17 00:00:00 2001
+From: amistry <amistry@chromium.org>
+Date: Tue, 9 Jun 2015 12:18:39 -0700
+Subject: [PATCH] Add build flag to disable hotwording.
+
+Hotwording downloads a shared module from the web store containing a NaCl module. There is a desire to build and distribute Chromium without this happening. This change adds an "enable_hotwording" build flag that is enabled by default, but can be disabled at compile time.
+
+BUG=491435
+
+Review URL: https://codereview.chromium.org/1160243004
+
+Cr-Commit-Position: refs/heads/master@{#333548}
+
+Conflicts:
+ chrome/browser/search/hotword_service.cc
+---
+ build/common.gypi | 4 ++++
+ chrome/browser/BUILD.gn | 9 +++++++++
+ chrome/browser/search/hotword_service.cc | 4 ++++
+ chrome/browser/search/hotword_service_unittest.cc | 4 ++++
+ chrome/chrome_browser.gypi | 3 +++
+ 5 files changed, 24 insertions(+)
+
+diff --git a/build/common.gypi b/build/common.gypi
+index 339cc75..ddb075c 100644
+--- a/build/common.gypi
++++ b/build/common.gypi
+@@ -381,6 +381,9 @@
+ # Web speech is enabled by default. Set to 0 to disable.
+ 'enable_web_speech%': 1,
+
++ # 'Ok Google' hotwording is enabled by default. Set to 0 to disable.
++ 'enable_hotwording%': 1,
++
+ # Notifications are compiled in by default. Set to 0 to disable.
+ 'notifications%' : 1,
+
+@@ -1134,6 +1137,7 @@
+ 'configuration_policy%': '<(configuration_policy)',
+ 'safe_browsing%': '<(safe_browsing)',
+ 'enable_web_speech%': '<(enable_web_speech)',
++ 'enable_hotwording%': '<(enable_hotwording)',
+ 'notifications%': '<(notifications)',
+ 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
+ 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
+diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
+index 5152d83..6ccb079 100644
+--- a/chrome/browser/BUILD.gn
++++ b/chrome/browser/BUILD.gn
+@@ -18,6 +18,11 @@ if (is_desktop_linux) {
+ import("//build/config/linux/pkg_config.gni")
+ }
+
++declare_args() {
++ # 'Ok Google' hotwording is enabled.
++ enable_hotwording = true
++}
++
+ about_credits_file = "$target_gen_dir/about_credits.html"
+ additional_modules_list_file =
+ "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
+@@ -455,6 +460,10 @@ source_set("browser") {
+ }
+ }
+
++ if (enable_hotwording) {
++ defines += [ "ENABLE_HOTWORDING" ]
++ }
++
+ if (is_linux) {
+ deps += [
+ "//device/media_transfer_protocol",
+diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
+index 0cf3c60..e93789b 100644
+--- a/chrome/browser/search/hotword_service.cc
++++ b/chrome/browser/search/hotword_service.cc
+@@ -642,6 +642,7 @@ bool HotwordService::IsServiceAvailable() {
+ }
+
+ bool HotwordService::IsHotwordAllowed() {
++#if defined(ENABLE_HOTWORDING)
+ std::string group = base::FieldTrialList::FindFullName(
+ hotword_internal::kHotwordFieldTrialName);
+ // Allow hotwording by default, and only disable if the field trial has been
+@@ -650,6 +651,9 @@ bool HotwordService::IsHotwordAllowed() {
+ return false;
+
+ return DoesHotwordSupportLanguage(profile_);
++#else
++ return false;
++#endif
+ }
+
+ bool HotwordService::IsOptedIntoAudioLogging() {
+diff --git a/chrome/browser/search/hotword_service_unittest.cc b/chrome/browser/search/hotword_service_unittest.cc
+index a3aef47..b0b5927 100644
+--- a/chrome/browser/search/hotword_service_unittest.cc
++++ b/chrome/browser/search/hotword_service_unittest.cc
+@@ -216,6 +216,7 @@ TEST_P(HotwordServiceTest, IsHotwordAllowedInvalidFieldTrial) {
+ }
+
+ TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
++#if defined(ENABLE_HOTWORDING)
+ TestingProfile::Builder profile_builder;
+ scoped_ptr<TestingProfile> profile = profile_builder.Build();
+
+@@ -246,6 +247,7 @@ TEST_P(HotwordServiceTest, IsHotwordAllowedLocale) {
+ Profile* otr_profile = profile->GetOffTheRecordProfile();
+ SetApplicationLocale(otr_profile, "en");
+ EXPECT_FALSE(HotwordServiceFactory::IsHotwordAllowed(otr_profile));
++#endif // defined(ENABLE_HOTWORDING)
+ }
+
+ TEST_P(HotwordServiceTest, ShouldReinstallExtension) {
+@@ -302,6 +304,7 @@ TEST_P(HotwordServiceTest, PreviousLanguageSetOnInstall) {
+ }
+
+ TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
++#if defined(ENABLE_HOTWORDING)
+ InitializeEmptyExtensionService();
+ service_->Init();
+
+@@ -372,6 +375,7 @@ TEST_P(HotwordServiceTest, UninstallReinstallTriggeredCorrectly) {
+ EXPECT_TRUE(HotwordServiceFactory::IsHotwordAllowed(profile()));
+ EXPECT_FALSE(hotword_service->MaybeReinstallHotwordExtension());
+ EXPECT_EQ(1, hotword_service->uninstall_count()); // no change
++#endif // defined(ENABLE_HOTWORDING)
+ }
+
+ TEST_P(HotwordServiceTest, DisableAlwaysOnOnLanguageChange) {
+diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
+index 6d323eb..1aaedba 100644
+--- a/chrome/chrome_browser.gypi
++++ b/chrome/chrome_browser.gypi
+@@ -3529,6 +3529,9 @@
+ ['enable_session_service==1', {
+ 'sources': [ '<@(chrome_browser_session_service_sources)' ],
+ }],
++ ['enable_hotwording==1', {
++ 'defines': [ 'ENABLE_HOTWORDING' ],
++ }],
+ ['OS!="android" and OS!="ios" and chromeos==0', {
+ 'sources': [ '<@(chrome_browser_desktop_sources)' ],
+ }],
+--
+2.4.4
+