commit 7fbf9344ea591c66d3166ec0c366c3bf2a94fdfc
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Tue Sep 14 08:32:49 2021 +0100
Add fedora clang-format patch
chromium-clang-format.patch | 34 ++++++++++++++++++++++++++++++++++
chromium-freeworld.spec | 1 +
2 files changed, 35 insertions(+)
---
diff --git a/chromium-clang-format.patch b/chromium-clang-format.patch
new file mode 100644
index 0000000..77e842e
--- /dev/null
+++ b/chromium-clang-format.patch
@@ -0,0 +1,34 @@
+diff -up chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3
chromium-93.0.4577.63/buildtools/linux64/clang-format
+--- chromium-93.0.4577.63/buildtools/linux64/clang-format.clang-format-py3 2021-09-03
04:42:46.736294345 +0000
++++ chromium-93.0.4577.63/buildtools/linux64/clang-format 2021-09-03 04:59:55.296512600
+0000
+@@ -10,9 +10,9 @@ import sys
+ args = sys.argv[1:]
+ inputfiles = [a for a in args if not a.startswith('-')]
+
+-contents = ''
++contents = b''
+ if '-' in args or not inputfiles:
+- contents = sys.stdin.read()
++ contents = sys.stdin.buffer.read()
+
+ # Tarball builds may or may not have depot_tools in $PATH. In the former case,
+ # running 'clang-format' will call back into this script infinitely. Strip off
+@@ -34,14 +34,14 @@ try:
+ stdout, stderr = proc.communicate(input=contents)
+ # Ignore if clang-format fails. Eg: it may be too old to support C++14.
+ if proc.returncode == 0:
+- sys.stdout.write(stdout)
+- sys.stderr.write(stderr)
++ sys.stdout.buffer.write(stdout)
++ sys.stderr.buffer.write(stderr)
+ sys.exit(0)
+ except OSError:
+ # Ignore if clang-format is not installed.
+ pass
+
+ # If any failure happens, continue with unformatted files.
+-sys.stdout.write(contents)
++sys.stdout.buffer.write(contents)
+ for inputfile in inputfiles:
+- sys.stdout.write(open(inputfile).read())
++ sys.stdout.buffer.write(open(inputfile).read())
diff --git a/chromium-freeworld.spec b/chromium-freeworld.spec
index ad3cea6..11a6b85 100644
--- a/chromium-freeworld.spec
+++ b/chromium-freeworld.spec
@@ -180,6 +180,7 @@ Patch303: chromium-java-only-allowed-in-android-builds.patch
Patch304: chromium-update-highway-0.12.2.patch
Patch305: chromium-aarch64-cxxflags-addition.patch
Patch306: chromium-93-old-freetype.patch
+Patch307: chromium-clang-format.patch
Patch1303: chromium-rawhide-gcc-std-max-fix.patch
# RPM Fusion patches [free/chromium-freeworld]: