···565 # preventing compilations of chromium with versions below their intended version, not about running the very
566 # exact version or even running a newer version.
567 ./patches/chromium-136-nodejs-assert-minimal-version-instead-of-exact-match.patch
00000000000000000000000000568 ];
569570 postPatch =
···565 # preventing compilations of chromium with versions below their intended version, not about running the very
566 # exact version or even running a newer version.
567 ./patches/chromium-136-nodejs-assert-minimal-version-instead-of-exact-match.patch
568+ ]
569+ ++ lib.optionals (chromiumVersionAtLeast "137") [
570+ (fetchpatch {
571+ # Partial revert of upstream clang+llvm bump revert to fix the following error when building with LLVM < 21:
572+ # clang++: error: unknown argument: '-fextend-variable-liveness=none'
573+ # https://chromium-review.googlesource.com/c/chromium/src/+/6514242
574+ name = "chromium-137-llvm-19.patch";
575+ url = "https://chromium.googlesource.com/chromium/src/+/ddf8f8a465be2779bd826db57f1299ccd2f3aa25^!?format=TEXT";
576+ includes = [ "build/config/compiler/BUILD.gn" ];
577+ revert = true;
578+ decode = "base64 -d";
579+ hash = "sha256-wAR8E4WKMvdkW8DzdKpyNpp4dynIsYAbnJ2MqE8V2o8=";
580+ })
581+ ]
582+ ++ lib.optionals (chromiumVersionAtLeast "137") [
583+ (fetchpatch {
584+ # Backport "Fix build with system libpng" that fixes a typo in core/fxcodec/png/png_decoder.cpp that causes
585+ # the build to fail at the final linking step.
586+ # https://pdfium-review.googlesource.com/c/pdfium/+/132130
587+ name = "pdfium-Fix-build-with-system-libpng.patch";
588+ url = "https://pdfium.googlesource.com/pdfium.git/+/83f11d630aa1cb6d5ceb292364412f7b0585a201^!?format=TEXT";
589+ extraPrefix = "third_party/pdfium/";
590+ stripLen = 1;
591+ decode = "base64 -d";
592+ hash = "sha256-lDX0OLdxxTNLtViqEt0luJQ/H0mlvQfV0zbY1Ubqyq0=";
593+ })
594 ];
595596 postPatch =