diff --git a/srcpkgs/chromium/patches/chromium-121-rust-without-profiler_builtins.patch b/srcpkgs/chromium/patches/chromium-121-rust-without-profiler_builtins.patch deleted file mode 100644 index 25c34229829..00000000000 --- a/srcpkgs/chromium/patches/chromium-121-rust-without-profiler_builtins.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/build/rust/std/BUILD.gn -+++ b/build/rust/std/BUILD.gn -@@ -100,7 +100,6 @@ - # don't need to pass to the C++ linker because they're used for specialized - # purposes. - skip_stdlib_files = [ -- "profiler_builtins", - "rustc_std_workspace_alloc", - "rustc_std_workspace_core", - "rustc_std_workspace_std", diff --git a/srcpkgs/chromium/patches/chromium-138-fix-rust-1.88.0.patch b/srcpkgs/chromium/patches/chromium-138-fix-rust-1.88.0.patch new file mode 100644 index 00000000000..695b59ce3f5 --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-138-fix-rust-1.88.0.patch @@ -0,0 +1,21 @@ +error[E0463]: can't find crate for `rustc_literal_escaper` which `proc_macro` depends on + --> ../../third_party/rust/chromium_crates_io/vendor/proc-macro2-v1/src/lib.rs:139:1 + | +139 | extern crate proc_macro; + | ^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + | + = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0463`. +--- a/build/rust/std/BUILD.gn ++++ b/build/rust/std/BUILD.gn +@@ -40,6 +40,7 @@ + "panic_abort", + "panic_unwind", + "rustc_demangle", ++ "rustc_literal_escaper", + "std_detect", + "test", + "unicode_width", diff --git a/srcpkgs/chromium/patches/chromium-138-musl-toolchain.patch b/srcpkgs/chromium/patches/chromium-138-musl-toolchain.patch new file mode 100644 index 00000000000..70c938960ff --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-138-musl-toolchain.patch @@ -0,0 +1,63 @@ +--- a/build/toolchain/toolchain.gni ++++ b/build/toolchain/toolchain.gni +@@ -51,6 +51,10 @@ + } + } + ++declare_args() { ++ is_musl = false ++} ++ + # Extension for shared library files (including leading dot). + if (is_apple) { + shlib_extension = ".dylib" +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -1216,8 +1220,13 @@ + if (current_cpu == "x64") { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && + !is_chromeos_device) { +- cflags += [ "--target=x86_64-unknown-linux-gnu" ] +- ldflags += [ "--target=x86_64-unknown-linux-gnu" ] ++ if (is_musl) { ++ cflags += [ "--target=x86_64-unknown-linux-musl" ] ++ ldflags += [ "--target=x86_64-unknown-linux-musl" ] ++ } else { ++ cflags += [ "--target=x86_64-unknown-linux-gnu" ] ++ ldflags += [ "--target=x86_64-unknown-linux-gnu" ] ++ } + } else { + cflags += [ "-m64" ] + ldflags += [ "-m64" ] +@@ -1225,8 +1234,13 @@ + cflags += [ "-msse3" ] + } else if (current_cpu == "x86") { + if (is_clang && !is_android && !is_nacl && !is_chromeos_device) { +- cflags += [ "--target=i386-unknown-linux-gnu" ] +- ldflags += [ "--target=i386-unknown-linux-gnu" ] ++ if (is_musl) { ++ cflags += [ "--target=i386-unknown-linux-musl" ] ++ ldflags += [ "--target=i386-unknown-linux-musl" ] ++ } else { ++ cflags += [ "--target=i386-unknown-linux-gnu" ] ++ ldflags += [ "--target=i386-unknown-linux-gnu" ] ++ } + } else { + cflags += [ "-m32" ] + ldflags += [ "-m32" ] +@@ -1254,8 +1268,13 @@ + } else if (current_cpu == "arm64") { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && + !is_chromeos_device) { +- cflags += [ "--target=aarch64-linux-gnu" ] +- ldflags += [ "--target=aarch64-linux-gnu" ] ++ if (is_musl) { ++ cflags += [ "--target=aarch64-linux-musl" ] ++ ldflags += [ "--target=aarch64-linux-musl" ] ++ } else { ++ cflags += [ "--target=aarch64-linux-gnu" ] ++ ldflags += [ "--target=aarch64-linux-gnu" ] ++ } + } + } else if (current_cpu == "mipsel" && !is_nacl) { + ldflags += [ "-Wl,--hash-style=sysv" ] diff --git a/srcpkgs/chromium/patches/chromium-121-rust-clang_lib.patch b/srcpkgs/chromium/patches/chromium-138-rust-clang_lib.patch similarity index 85% rename from srcpkgs/chromium/patches/chromium-121-rust-clang_lib.patch rename to srcpkgs/chromium/patches/chromium-138-rust-clang_lib.patch index 4014f9a8276..5b82bc880b0 100644 --- a/srcpkgs/chromium/patches/chromium-121-rust-clang_lib.patch +++ b/srcpkgs/chromium/patches/chromium-138-rust-clang_lib.patch @@ -1,8 +1,8 @@ --- a/build/config/clang/BUILD.gn +++ b/build/config/clang/BUILD.gn -@@ -128,14 +128,15 @@ - } else if (is_apple) { - _dir = "darwin" +@@ -208,14 +208,15 @@ + assert(false) # Unhandled cpu type + } } else if (is_linux || is_chromeos) { + _dir = "linux" if (current_cpu == "x64") { @@ -17,6 +17,6 @@ } else if (current_cpu == "arm64") { - _dir = "aarch64-unknown-linux-gnu" + _suffix = "-aarch64" + } else if (current_cpu == "loong64") { + _dir = "loongarch64-unknown-linux-gnu" } else { - assert(false) # Unhandled cpu type - } diff --git a/srcpkgs/chromium/patches/build-support-musl.patch b/srcpkgs/chromium/patches/chromium-138-rust-musl-targets.patch similarity index 55% rename from srcpkgs/chromium/patches/build-support-musl.patch rename to srcpkgs/chromium/patches/chromium-138-rust-musl-targets.patch index 635c592b0a3..e57cc03218f 100644 --- a/srcpkgs/chromium/patches/build-support-musl.patch +++ b/srcpkgs/chromium/patches/chromium-138-rust-musl-targets.patch @@ -1,16 +1,3 @@ ---- a/build/toolchain/toolchain.gni -+++ b/build/toolchain/toolchain.gni -@@ -51,6 +51,10 @@ - } - } - -+declare_args() { -+ is_musl = false -+} -+ - # Extension for shared library files (including leading dot). - if (is_apple) { - shlib_extension = ".dylib" --- a/build/config/rust.gni +++ b/build/config/rust.gni @@ -196,7 +196,18 @@ @@ -33,3 +20,28 @@ if (current_cpu == "arm64") { rust_abi_target = "aarch64-unknown-linux-gnu" cargo_target_abi = "" +--- a/build/rust/known-target-triples.txt ++++ b/build/rust/known-target-triples.txt +@@ -17,6 +17,7 @@ + aarch64-pc-windows-msvc + aarch64-unknown-fuchsia + aarch64-unknown-linux-gnu ++aarch64-unknown-linux-musl + arm64e-apple-ios + arm-unknown-linux-gnueabi + arm-unknown-linux-gnueabihf +@@ -28,6 +29,7 @@ + i686-linux-android + i686-pc-windows-msvc + i686-unknown-linux-gnu ++i686-unknown-linux-musl + loongarch64-unknown-linux-gnu + riscv64-linux-android + riscv64gc-unknown-linux-gnu +@@ -41,5 +43,6 @@ + x86_64-pc-windows-msvc + x86_64-unknown-fuchsia + x86_64-unknown-linux-gnu ++x86_64-unknown-linux-musl + powerpc64le-unknown-linux-gnu + s390x-unknown-linux-gnu diff --git a/srcpkgs/chromium/patches/cr138-musl-gtk-serinfo.patch b/srcpkgs/chromium/patches/cr138-musl-gtk-serinfo.patch new file mode 100644 index 00000000000..f6f9998e3eb --- /dev/null +++ b/srcpkgs/chromium/patches/cr138-musl-gtk-serinfo.patch @@ -0,0 +1,31 @@ +From e8daefd959e37ca94e99e486927423c0bb24e293 Mon Sep 17 00:00:00 2001 +From: LN Liberda +Date: Wed, 28 May 2025 22:51:21 +0200 +Subject: [PATCH] Don't check glibc search path if not using glibc + +Bug: 40244829 +--- + ui/gtk/ime_compat_check.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ui/gtk/ime_compat_check.cc b/ui/gtk/ime_compat_check.cc +index 3c33ab502bca0..531e7ca60ee09 100644 +--- a/ui/gtk/ime_compat_check.cc ++++ b/ui/gtk/ime_compat_check.cc +@@ -35,6 +35,8 @@ struct InputMethod { + + std::vector GetLibrarySearchPaths() { + std::vector search_path; ++ ++#if defined(__GLIBC__) + void* handle = dlopen("libc.so.6", RTLD_GLOBAL | RTLD_LAZY | RTLD_NOLOAD); + if (!handle) { + return search_path; +@@ -60,6 +62,7 @@ std::vector GetLibrarySearchPaths() { + // SAFETY: The range is bound by `serinfo.dls_cnt`. + search_path.emplace_back(UNSAFE_BUFFERS(sip->dls_serpath[j].dls_name)); + } ++#endif + + return search_path; + } diff --git a/srcpkgs/chromium/patches/cr138-node-version-check.patch b/srcpkgs/chromium/patches/cr138-node-version-check.patch new file mode 100644 index 00000000000..74fa68c0a5a --- /dev/null +++ b/srcpkgs/chromium/patches/cr138-node-version-check.patch @@ -0,0 +1,67 @@ +From 41bd9e8e46a97cfe8a0dfd2c2626aa7d4809ed4d Mon Sep 17 00:00:00 2001 +From: LN Liberda +Date: Wed, 28 May 2025 12:10:07 +0200 +Subject: [PATCH] Allow to disable the Node.js version check with a build arg + +For distributions building Chromium with their own Node.js binaries, +version mismatches are expected. Keep the check on by default, +but allow to opt-out of it. + +Bug: 401522564 +Change-Id: I211279a607b5b5fefd13614b177e55e57ba804c1 +--- + third_party/node/BUILD.gn | 40 ++++++++++++++++++++++++--------------- + 1 file changed, 25 insertions(+), 15 deletions(-) + +diff --git a/third_party/node/BUILD.gn b/third_party/node/BUILD.gn +index 1741e14401c8c..75631fac8b462 100644 +--- a/third_party/node/BUILD.gn ++++ b/third_party/node/BUILD.gn +@@ -4,22 +4,32 @@ + + import("//third_party/node/node.gni") + +-node("check_version") { +- script = "check_version.py" ++declare_args() { ++ # Check the version of the Node.js binary. ++ node_version_check = true ++} ++ ++if (node_version_check) { ++ node("check_version") { ++ script = "check_version.py" + +- expected_version_file = "update_node_binaries" +- inputs = [ +- expected_version_file, +- "check_version.js", +- ] ++ expected_version_file = "update_node_binaries" ++ inputs = [ ++ expected_version_file, ++ "check_version.js", ++ ] + +- out_file = "${target_gen_dir}/check_version_result.txt" +- outputs = [ out_file ] ++ out_file = "${target_gen_dir}/check_version_result.txt" ++ outputs = [ out_file ] + +- args = [ +- "--expected_version_file", +- rebase_path(expected_version_file, root_build_dir), +- "--out_file", +- rebase_path(out_file, root_build_dir), +- ] ++ args = [ ++ "--expected_version_file", ++ rebase_path(expected_version_file, root_build_dir), ++ "--out_file", ++ rebase_path(out_file, root_build_dir), ++ ] ++ } ++} else { ++ group("check_version") { ++ } + } diff --git a/srcpkgs/chromium/patches/cross-build.patch b/srcpkgs/chromium/patches/cross-build.patch index 439f2522643..b6bf3d9c615 100644 --- a/srcpkgs/chromium/patches/cross-build.patch +++ b/srcpkgs/chromium/patches/cross-build.patch @@ -1,21 +1,3 @@ ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -1257,8 +1257,13 @@ - } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia && - !is_chromeos_device) { -- cflags += [ "--target=aarch64-linux-gnu" ] -- ldflags += [ "--target=aarch64-linux-gnu" ] -+ if (is_musl) { -+ cflags += [ "--target=aarch64-linux-musl" ] -+ ldflags += [ "--target=aarch64-linux-musl" ] -+ } else { -+ cflags += [ "--target=aarch64-linux-gnu" ] -+ ldflags += [ "--target=aarch64-linux-gnu" ] -+ } - } - } else if (current_cpu == "mipsel" && !is_nacl) { - ldflags += [ "-Wl,--hash-style=sysv" ] --- a/build/toolchain/linux/unbundle/BUILD.gn.orig +++ b/build/toolchain/linux/unbundle/BUILD.gn @@ -39,3 +39,22 @@ @@ -41,17 +23,6 @@ + v8_current_cpu = target_cpu + } +} ---- a/build/config/linux/pkg_config.gni.orig -+++ b/build/config/linux/pkg_config.gni -@@ -91,7 +91,7 @@ - assert(defined(invoker.packages), - "Variable |packages| must be defined to be a list in pkg_config.") - config(target_name) { -- if (host_toolchain == current_toolchain) { -+ if (current_cpu != target_cpu) { - args = common_pkg_config_args + host_pkg_config_args + invoker.packages - } else { - args = common_pkg_config_args + pkg_config_args + invoker.packages --- a/build/config/clang/BUILD.gn +++ b/build/config/clang/BUILD.gn @@ -168,7 +168,11 @@ diff --git a/srcpkgs/chromium/patches/llvm19.patch b/srcpkgs/chromium/patches/llvm19.patch index 6c132771972..f298f543c39 100644 --- a/srcpkgs/chromium/patches/llvm19.patch +++ b/srcpkgs/chromium/patches/llvm19.patch @@ -1,22 +1,13 @@ --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn -@@ -1641,7 +1641,7 @@ - # Some build configs use older versions of clang that don't support WSMs - if (!is_nacl && default_toolchain != "//build/toolchain/cros:target" && - !llvm_android_mainline && is_clang && -- clang_warning_suppression_file != "") { -+ clang_warning_suppression_file != "" && clang_version != "19") { - from_build_root = - rebase_path(clang_warning_suppression_file, root_build_dir) - inputs = [ clang_warning_suppression_file ] ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -627,7 +627,7 @@ - # TODO(crbug.com/413427035): Remove once - # https://github.com/llvm/llvm-project/pull/136867/ is landed. - if (!is_win && !llvm_android_mainline && -- default_toolchain != "//build/toolchain/cros:target") { -+ default_toolchain != "//build/toolchain/cros:target" && clang_version != "19") { - cflags += [ "-fextend-variable-liveness=none" ] - } +@@ -328,6 +328,10 @@ + configs -= [ ":clang_warning_suppression" ] } + ++ if (clang_version == "19") { ++ configs -= [ ":clang_warning_suppression" ] ++ } ++ + # Here we enable -fno-delete-null-pointer-checks, which makes various nullptr + # operations (e.g. dereferencing) into defined behavior. This avoids deletion + # of some security-critical code: see https://crbug.com/1139129. diff --git a/srcpkgs/chromium/patches/pdfium-fix-build-with-system-libpng.patch b/srcpkgs/chromium/patches/pdfium-fix-build-with-system-libpng.patch deleted file mode 100644 index e24114f2161..00000000000 --- a/srcpkgs/chromium/patches/pdfium-fix-build-with-system-libpng.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 83f11d630aa1cb6d5ceb292364412f7b0585a201 Mon Sep 17 00:00:00 2001 -From: Matt Jolly -Date: Mon, 19 May 2025 11:21:10 -0700 -Subject: [PATCH] Fix build with system libpng - -`cbc692a42241970e1da492d5b14326e81ecb1061` refactored -`fxcodec::CFX_DIBAttribute` and changed the names of its members. - -Unfortunately this change appears to have been typo'd in the -'system libpng' build path, which is not checked by CI, resulting -in downstream build failures in Chromium. - -Signed-off-by: Matt Jolly -Change-Id: Id4c2c24f76cb709a0bc78badcaf63eb9c5868fe3 -Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/132130 -Reviewed-by: Lei Zhang -Commit-Queue: Tom Sepez -Reviewed-by: Tom Sepez ---- - AUTHORS | 1 + - core/fxcodec/png/png_decoder.cpp | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/AUTHORS b/AUTHORS -index 3cd57a711..567f8f5c9 100644 ---- a/third_party/pdfium/AUTHORS -+++ b/third_party/pdfium/AUTHORS -@@ -32,6 +32,7 @@ Justin Pierce - Ke Liu - Luật Nguyễn - Manuel Geißer -+Matt Jolly - Michael Doppler - Miklos Vajna - Minh Trần -diff --git a/core/fxcodec/png/png_decoder.cpp b/core/fxcodec/png/png_decoder.cpp -index 278e381ea..7b6edcd04 100644 ---- a/third_party/pdfium/core/fxcodec/png/png_decoder.cpp -+++ b/third_party/pdfium/core/fxcodec/png/png_decoder.cpp -@@ -52,8 +52,8 @@ void _png_load_bmp_attribute(png_structp png_ptr, - CFX_DIBAttribute* pAttribute) { - if (pAttribute) { - #if defined(PNG_pHYs_SUPPORTED) -- pAttribute->xdpi_ = png_get_x_pixels_per_meter(png_ptr, info_ptr); -- pAttribute->ydpi_ = png_get_y_pixels_per_meter(png_ptr, info_ptr); -+ pAttribute->x_dpi_ = png_get_x_pixels_per_meter(png_ptr, info_ptr); -+ pAttribute->y_dpi_ = png_get_y_pixels_per_meter(png_ptr, info_ptr); - png_uint_32 res_x, res_y; - int unit_type; - png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, &unit_type); diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template index ce631cc1c4d..21780f9e13b 100644 --- a/srcpkgs/chromium/template +++ b/srcpkgs/chromium/template @@ -1,7 +1,7 @@ # Template file for 'chromium' pkgname=chromium # See https://chromiumdash.appspot.com/releases?platform=Linux for the latest version -version=137.0.7151.103 +version=138.0.7204.92 revision=1 archs="i686* x86_64* aarch64* armv7l*" _llvmver=19 @@ -30,8 +30,9 @@ maintainer="Duncaen " license="BSD-3-Clause" homepage="https://www.chromium.org/" distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz" -#distfiles="https://chromium-tarballs.distfiles.gentoo.org/chromium-${version}.tar.xz" -checksum=31083a39c661942a3617e272787a3927f9b7eeaf2a4e2de1ac3affc8a7f05ef3 +# distfiles="https://chromium-tarballs.distfiles.gentoo.org/chromium-${version}.tar.xz" +# distfiles="https://chromium.googlesource.com/chromium/src.git/+archive/refs/tags/${version}.tar.gz" +checksum=b7c4985e41e8c581355a577ab3f114d41433c94e655916d4c1cf4cf31c277964 lib32disabled=yes @@ -218,6 +219,8 @@ do_configure() { 'rust_bindgen_root="/usr"' "rustc_version=\"$(rustc --version)\"" + 'node_version_check=false' + # is_debug makes the build a debug build, changes some things. # might be useful for real debugging vs just debug symbols. "is_debug=false"