guix-mirrors/gnu/packages/patches/ungoogled-chromium-extension-search-path.patch
André Batista be44a20ea7
gnu: ungoogled-chromium: Update to 139.0.7258.154.
Fixes #1272 and #2052.  Supersedes #2261.

* gnu/packages/chromium.scm: Remove libevent and regex imports;  Import rust and
rust-apps.
(%preserved-third-party-files): Remove: base/third_party/dynamic_annotations,
  base/third_party/xdg_mime,
  chrome/third_party/mozilla_security_manager,
  courgette/third_party/bsdiff,
  courgette/third_party/divsufsort,
  third_party/devtools-frontend/src/front_end/third_party/lodash-isequal,
  third_party/devtools-frontend/src/third_party/typescript,
  third_party/distributed_point_functions,
  third_party/iccjpeg,
  third_party/jstemplate,
  third_party/libavif,
  third_party/libudev,
  third_party/mesa_headers,
  third_party/openscreen/src/third_party/mozilla,
  third_party/pdfium/third_party/base,
  third_party/pdfium/third_party/skia_shared,
  third_party/qcms,
  third_party/tflite/src/third_party/eigen3,
  third_party/web-animations-js,
  third_party/webrtc/rtc_base/third_party/base64,
  third_party/widevine/cdm/widevine_cdm_version.h,
  v8/src/third_party/siphash,
  v8/src/third_party/utf8-decoder,
  v8/src/third_party/valgrind;
  - Add: third_party/anonymous_tokens,
  third_party/compiler-rt,
  third_party/compiler-rt/src/lib,
  third_party/compiler-rt/src/lib/builtins,
  third_party/crabbyavif,
  third_party/crabbyavif/src/sys/dav1d-sys,
  third_party/crabbyavif/src/sys/aom-sys,
  third_party/crabbyavif/src/sys/libgav1-sys,
  third_party/crabbyavif/src/sys/libyuv-sys,
  third_party/crabbyavif/src/sys/ndk-sys,
  third_party/devtools-frontend/src/front_end,
  third_party/devtools-frontend/src/front_end/third_party,
  third_party/devtools-frontend/src/front_end/third_party/json5,
  third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party,
  third_party/devtools-frontend/src/front_end/third_party/puppeteer/third_party/mitt,
  third_party/devtools-frontend/src/front_end/third_party/puppeteer/third_party/parsel,
  third_party/devtools-frontend/src/front_end/third_party/puppeteer/third_party/rxjs,
  third_party/devtools-frontend/src/front_end/third_party/puppeteer-replay,
  third_party/devtools-frontend/src/front_end/third_party/third-party-web,
  third_party/dragonbox,
  third_party/d3,
  third_party/fast_float,
  third_party/ffmpeg,
  third_party/fp16,
  third_party/ink,
  third_party/ink_stroke_modeler,
  third_party/jsoncpp,
  third_party/lens_server_proto,
  third_party/libdrm,
  third_party/libtess2,
  third_party/lit,
  third_party/lit/v3_0,
  third_party/lzma_sdk,
  third_party/ml_dtypes,
  third_party/protobuf/third_party/utf8_range,
  third_party/puffin,
  third_party/rapidhash,
  third_party/readability,
  third_party/re2,
  third_party/rust,
  third_party/search_engines_data,
  third_party/simdutf,
  third_party/simplejson,
  third_party/spirv-headers,
  third_party/spirv-tools,
  third_party/tensorflow_models,
  third_party/tflite/src/third_party/xla",
  third_party/tflite/src/third_party/xla/xla,
  third_party/tflite/src/third_party/xla/xla/tsl/framework,
  third_party/tflite/src/third_party/xla/xla/tsl/lib/random,
  third_party/tflite/src/third_party/xla/xla/tsl/platform,
  third_party/tflite/src/third_party/xla/xla/tsl/protobuf,
  third_party/tflite/src/third_party/xla/xla/tsl/util,
  third_party/tflite/src/third_party/xla/third_party/tsl,
  third_party/tflite/src/third_party/xla/third_party/tsl/tsl,
  third_party/tflite/src/third_party/xla/third_party/tsl/tsl/platform,
  third_party/tflite/src/third_party/xla/third_party/tsl/tsl/profiler,
  third_party/ungoogled-chromium,
  third_party/vulkan-headers,
  third_party/vulkan-loader,
  third_party/vulkan-tools,
  third_party/vulkan-validation-layers,
  third_party/vulkan-utility-libraries,
  third_party/wasm_tts_engine,
  third_party/zstd,
  v8/third_party/rapidhash-v8,
  v8/third_party/siphash,
  v8/third_party/utf8-decoder,
  v8/third_party/valgrind,
  v8/third_party/v8/codegen.
(%chromium-version): Update to 139.0.7258.154.
(%debian-revision): Change it to concatenation of 'debian/' and
%ungoogled-revision.
(%arch-revision): Remove it.
(%ungoogled-origin) [origin] <uri>: Change to current project URL and update
hash.
(%debian-patches): Add bookworm/clang19.patch,
  bookworm/foreach.patch,
  disable/node-version-ck.patch,
  fixes/rust-clanglib.patch,
  trixie/adler1.patch,
  trixie/libxml-parseerr.patch.
  - Remove: fixes/clang-and-gcc11.patch and system/zlib.patch.
(arch-patch, %reverse-patches, %arch-patches): Remove them.
(%guix-patches): Add ungoogled-chromium-nullptr_t.patch;
Remove: ungoogled-chromium-ffmpeg-compat.patch and
  ungoogled-chromium-system-ffmpeg.patch;  Change indentation.
(%patches): Remove %arch-patches.  Change indentation.
(ungoogled-chromium-snippet): Remove reverse-patches function;
  replace_gn_files.py invokation: Remove references to ffmpeg, jsoncpp, libdrm,
  libevent and re2 which were causing build failures.
(lld-as-ld-wrapper-19): New variable.
(ungoogled-chromium) [origin] <uri>: Use the lite tarball; Update hash.
[arguments]<#:configure-flags>: Set optimize_webui,
  safe_browsing_use_unrar,
  enable_enterprise_companion,
  enable_glic,
  enable_iterator_debugging,
  enable_hangout_services_extension,
  angle_has_histograms,
  angle_build_tests,
  build_angle_perftests,
  use_qt5,
  use_qt6,
  is_cfi and
  v8_enable_backtrace to false;
  - Unset clang_warning_suppression_file;
  - Set symbol_level to zero
  - Set clang_version, rust_sysroot_absolute, rust_bindgen_root and
  rustc_version.
  - Remove use_system_libdrm, media_use_ffmpeg,
  media_use_libvpx,
  media_use_openh264,
  rtc_use_h264,
  rtc_link_pipewire,
  rtc_build_json,
  rtc_jsoncpp_root,
  rtc_build_libevent,
  rtc_build_libvpx,
  rtc_build_opus,
  rtc_build_libsrtp,
  rtc_build_ssl and related comments.
<#:phases> 'patch-stuff: Fix compiler-rt and clang libs location; Remove unknown
compiler flags for clang.  Remove code for minizip, valgrind, jsoncpp and vulkan.
'add-absolute-references: Remove code for vulkan and libudev.
'adjust-CPLUS_INCLUDE_PATH: New phase.
'prepare-build-environment: Set CXXFLAGS, LDFLAGS, CLANG_MVERS and
RUSTC_BOOTSTRAP to appropriate values.
'install: remove code for vulkan.
[native-inputs]: Add clang-19, clang-runtime-19, clang-toolchain-19,
lld-as-ld-wrapper-19, llvm-19, rust, rust-bindgen-cli and rust-cbindgen;
Remove clang-15 and lld-as-ld-wrapper-15.
[inputs]: Add libcxx and qtbase; Remove ffmpeg-4, jsoncpp, libevent, qtbase-5,
re2, vulkan-headers and vulkan-loader.
[home-page]: Set it to current project's page.
* gnu/packages/patches/ungoogled-chromium-ffmpeg-compat.patch: Delete it.
* gnu/packages/patches/ungoogled-chromium-system-ffmpeg.patch: Same.
* gnu/packages/patches/ungoogled-chromium-nullptr_t.patch: Add it.
* gnu/packages/patches/ungoogled-chromium-extension-search-path.patch: Adjust it.
* gnu/packages/patches/ungoogled-chromium-system-nspr.patch: Same.
* gnu/packages/patches/ungoogled-chromium-RUNPATH.patch: Same.
* gnu/local.mk (dist_patch_DATA): Register and unregister the above.

Change-Id: Idc5e90d82f2d6cc7e23cb093d66a6cadb19cecfb
2025-09-05 11:39:32 -04:00

28 lines
943 B
Diff

Look for extensions in $CHROMIUM_EXTENSION_DIRECTORY instead of
/usr/share/chromium/extensions.
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -6,6 +6,7 @@
#include <optional>
+#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/no_destructor.h"
@@ -522,7 +523,13 @@
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: {
- cur = base::FilePath(kFilepathSinglePrefExtensions);
+ std::unique_ptr<base::Environment> environment(base::Environment::Create());
+ if (environment->GetVar("CHROMIUM_EXTENSION_DIRECTORY")) {
+ auto extension_dir = environment->GetVar("CHROMIUM_EXTENSION_DIRECTORY").value();
+ cur = base::FilePath(extension_dir);
+ } else {
+ cur = base::FilePath(kFilepathSinglePrefExtensions);
+ }
break;
}
#endif