Skip to content

Commit

Permalink
www-client/ungoogled-chromium: missing patches
Browse files Browse the repository at this point in the history
  • Loading branch information
PF4Public committed Mar 5, 2025
1 parent 70258fa commit 7c0f556
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From d1e4332f1a2361014175646fae4f4549b8c1abbf Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Thu, 13 Feb 2025 16:56:53 +1000
Subject: [PATCH] seccomp: Define MAP_DROPPABLE for glibc 2.41

Bug: https://bugs.gentoo.org/949654
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
@@ -1,3 +1,4 @@
+
// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,6 +36,10 @@
#include "sandbox/linux/system_headers/linux_syscalls.h"
#include "sandbox/linux/system_headers/linux_time.h"

+#if !defined(MAP_DROPPABLE)
+#define MAP_DROPPABLE 0x08 // Zero memory under memory pressure.
+#endif
+
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \
!defined(__arm__) && !defined(__aarch64__) && \
!defined(PTRACE_GET_THREAD_AREA)
@@ -238,7 +243,7 @@ ResultExpr RestrictMmapFlags() {
// TODO(davidung), remove MAP_DENYWRITE with updated Tegra libraries.
const uint64_t kAllowedMask = MAP_SHARED | MAP_PRIVATE | MAP_ANONYMOUS |
MAP_STACK | MAP_NORESERVE | MAP_FIXED |
- MAP_DENYWRITE | MAP_LOCKED |
+ MAP_DENYWRITE | MAP_LOCKED | MAP_DROPPABLE |
kArchSpecificAllowedMask;
const Arg<int> flags(3);
return If((flags & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS());
--
2.48.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 628c8aad603791ec1276c6a5b8d3704a03840f86 Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Sat, 18 Jan 2025 11:09:46 +1000
Subject: [PATCH] www-client/chromium: work around dead oauth2 credentials

Google doesn't let us bake in OAuth2 credentials, and for some time,
Google sign-in has been broken. Arch dealt with this in March, and so
did we to some degree, but in the last few months, our sign-in
credentials have been broken. It appears that we actually did remove API
credentials in March around Chrome 89, but they got added back, perhaps
when rotating newer versions to replace older versions. Work around this
by following Arch's lead: we remove the predefined credentials, as
before, but also we patch Chromium so that people can use their own
easily, using Arch's patch for that.
--- a/google_apis/api_key_cache.cc
+++ b/google_apis/api_key_cache.cc
@@ -192,13 +192,13 @@ ApiKeyCache::ApiKeyCache(const DefaultApiKeys& default_api_keys) {

std::string default_client_id = CalculateKeyValue(
default_api_keys.google_default_client_id,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr, std::string(),
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID, std::string(),
environment.get(), command_line, gaia_config,
default_api_keys.allow_override_via_environment,
default_api_keys.allow_unset_values);
std::string default_client_secret = CalculateKeyValue(
default_api_keys.google_default_client_secret,
- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr,
+ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientID,
std::string(), environment.get(), command_line, gaia_config,
default_api_keys.allow_override_via_environment,
default_api_keys.allow_unset_values);
--
2.48.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 919cda539b142b51fc2ef2342dbf1803b65f5434 Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Wed, 12 Feb 2025 20:13:09 +1000
Subject: [PATCH] remoting: Linux: guard wayland includes

During the refactor in 53f3429926deb4cb92d9cddcda5fc096a0332db3
wayland support became required to build this component.

Only include wayland components in the `platform_impls` target
if `ozone_platform_wayland` is true.

Bug: 391722217
See also: https://bugs.gentoo.org/948384
Signed-off-by: Matt Jolly <kangie@gentoo.org>
--- a/remoting/host/linux/BUILD.gn
+++ b/remoting/host/linux/BUILD.gn
@@ -192,7 +192,6 @@ source_set("platform_impls") {
"wayland_seat.h",
]
deps = [
- ":wayland",
":x11",
":x11_display_utils",
"//base",
@@ -214,9 +213,16 @@ source_set("platform_impls") {
"//ui/base",
"//ui/base/x",
"//ui/events:dom_keycode_converter",
- "//ui/events/platform/wayland:wayland_event_watcher",
"//ui/gfx/x",
]
+ # ui/events/platform/wayland:wayland_event_watcher asserts that the wayland
+ # platform is enabled.
+ if (ozone_platform_wayland) {
+ deps += [
+ ":wayland",
+ "//ui/events/platform/wayland:wayland_event_watcher",
+ ]
+ }
}

source_set("x11_display_utils") {
--
2.48.0

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ HOMEPAGE="https://github.com/ungoogled-software/ungoogled-chromium"
PPC64_HASH="a85b64f07b489b8c6fdb13ecf79c16c56c560fc6"
LITE_TARBALL=1
SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${PV/_*}${LITE_TARBALL:+-lite}.tar.xz
ppc64? (
ppc64? (
https://gitlab.raptorengineering.com/raptor-engineering-public/chromium/openpower-patches/-/archive/${PPC64_HASH}/openpower-patches-${PPC64_HASH}.tar.bz2 -> chromium-openpower-${PPC64_HASH:0:10}.tar.bz2
)
"
Expand Down

0 comments on commit 7c0f556

Please sign in to comment.