git: 29a45d3d9bb0 - main - www/iridium: add explicit dependency on graphics/wayland

From: Rene Ladan <rene_at_FreeBSD.org>
Date: Mon, 04 Apr 2022 08:30:35 UTC
The branch main has been updated by rene:

URL: https://cgit.FreeBSD.org/ports/commit/?id=29a45d3d9bb01d11ef424c2caf3017447bbf1e16

commit 29a45d3d9bb01d11ef424c2caf3017447bbf1e16
Author:     Robert Nagy <robert@openbsd.org>
AuthorDate: 2022-04-04 08:16:05 +0000
Commit:     Rene Ladan <rene@FreeBSD.org>
CommitDate: 2022-04-04 08:30:17 +0000

    www/iridium: add explicit dependency on graphics/wayland
    
    This way Iridium supports Wayland out of the box.
    
    While here:
    -fixup policy paths
    - avoid lurking processes after exit
---
 www/iridium/Makefile                                     |  2 ++
 ...hrome_browser_background_background__mode__manager.cc | 11 ++++++++++-
 ...ome_browser_first__run_first__run__internal__linux.cc | 16 ++++++++++++++++
 ...rowser_policy_headless__browser__policy__connector.cc | 14 ++++++++++++++
 4 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/www/iridium/Makefile b/www/iridium/Makefile
index 606d5fcde078..a68bc855d076 100644
--- a/www/iridium/Makefile
+++ b/www/iridium/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	iridium
 PORTVERSION=	2022.04.100.0
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	https://downloads.iridiumbrowser.de/source/
 PKGNAMESUFFIX=	-browser
@@ -54,6 +55,7 @@ LIB_DEPENDS=	libatk-bridge-2.0.so:accessibility/at-spi2-atk \
 		libnss3.so:security/nss \
 		libexpat.so:textproc/expat2 \
 		libfontconfig.so:x11-fonts/fontconfig \
+		libwayland-client.so:graphics/wayland \
 		libxkbcommon.so:x11/libxkbcommon \
 		libxshmfence.so:x11/libxshmfence
 
diff --git a/www/iridium/files/patch-chrome_browser_background_background__mode__manager.cc b/www/iridium/files/patch-chrome_browser_background_background__mode__manager.cc
index a825aaca917a..590e8a3dc385 100644
--- a/www/iridium/files/patch-chrome_browser_background_background__mode__manager.cc
+++ b/www/iridium/files/patch-chrome_browser_background_background__mode__manager.cc
@@ -1,5 +1,14 @@
---- chrome/browser/background/background_mode_manager.cc.orig	2022-04-01 07:48:30 UTC
+--- chrome/browser/background/background_mode_manager.cc.orig	2022-04-03 12:23:22 UTC
 +++ chrome/browser/background/background_mode_manager.cc
+@@ -376,7 +376,7 @@ void BackgroundModeManager::RegisterPrefs(PrefRegistry
+   registry->RegisterBooleanPref(prefs::kChromeCreatedLoginItem, false);
+   registry->RegisterBooleanPref(prefs::kMigratedLoginItemPref, false);
+ #endif
+-  registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, false);
++  registry->RegisterBooleanPref(prefs::kBackgroundModeEnabled, true);
+ }
+ 
+ void BackgroundModeManager::RegisterProfile(Profile* profile) {
 @@ -899,7 +899,7 @@ gfx::ImageSkia GetStatusTrayIcon() {
      return gfx::ImageSkia();
  
diff --git a/www/iridium/files/patch-chrome_browser_first__run_first__run__internal__linux.cc b/www/iridium/files/patch-chrome_browser_first__run_first__run__internal__linux.cc
new file mode 100644
index 000000000000..03352757575e
--- /dev/null
+++ b/www/iridium/files/patch-chrome_browser_first__run_first__run__internal__linux.cc
@@ -0,0 +1,16 @@
+--- chrome/browser/first_run/first_run_internal_linux.cc.orig	2022-04-03 12:23:22 UTC
++++ chrome/browser/first_run/first_run_internal_linux.cc
+@@ -21,7 +21,13 @@ bool IsOrganicFirstRun() {
+ base::FilePath InitialPrefsPath() {
+   // The standard location of the initial prefs is next to the chrome binary.
+   base::FilePath initial_prefs;
++#if BUILDFLAG(IS_OPENBSD)
++  initial_prefs = base::FilePath("/etc/iridium");
++#elif BUILDFLAG(IS_FREEBSD)
++  initial_prefs = base::FilePath("/usr/local/etc/iridium");
++#else
+   initial_prefs = base::FilePath("/etc/iridium-browser");
++#endif
+   base::FilePath new_path = initial_prefs.AppendASCII(installer::kInitialPrefs);
+   if (base::PathIsReadable(new_path))
+     return new_path;
diff --git a/www/iridium/files/patch-headless_lib_browser_policy_headless__browser__policy__connector.cc b/www/iridium/files/patch-headless_lib_browser_policy_headless__browser__policy__connector.cc
new file mode 100644
index 000000000000..c5fc41c914f1
--- /dev/null
+++ b/www/iridium/files/patch-headless_lib_browser_policy_headless__browser__policy__connector.cc
@@ -0,0 +1,14 @@
+--- headless/lib/browser/policy/headless_browser_policy_connector.cc.orig	2022-04-03 12:23:22 UTC
++++ headless/lib/browser/policy/headless_browser_policy_connector.cc
+@@ -148,8 +148,10 @@ HeadlessBrowserPolicyConnector::CreatePlatformProvider
+   // chrome/common/chrome_paths.cc
+ #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
+   base::FilePath config_dir_path(FILE_PATH_LITERAL("/etc/opt/chrome/policies"));
++#elif BUILDFLAG(IS_FREEBSD)
++  base::FilePath config_dir_path(FILE_PATH_LITERAL("/usr/local/etc/iridium/policies"));
+ #else
+-  base::FilePath config_dir_path(FILE_PATH_LITERAL("/etc/iridium-browser/policies"));
++  base::FilePath config_dir_path(FILE_PATH_LITERAL("/etc/iridium/policies"));
+ #endif
+   std::unique_ptr<AsyncPolicyLoader> loader(new ConfigDirPolicyLoader(
+       base::ThreadPool::CreateSequencedTaskRunner(