-
Notifications
You must be signed in to change notification settings - Fork 0
/
modify.patch
397 lines (365 loc) · 15.8 KB
/
modify.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
diff --git a/chromium-browser.desktop b/chromium-browser.desktop
index 23d3257..eb861c1 100644
--- a/chromium-browser.desktop
+++ b/chromium-browser.desktop
@@ -1,27 +1,6 @@
[Desktop Entry]
Version=1.0
-Name=Chromium Web Browser
-Name[ast]=Restolador web Chromium
-Name[ca]=Navegador web Chromium
-Name[de]=Chromium-Webbrowser
-Name[es]=Navegador web Chromium
-Name[fr]=Navigateur Web Chromium
-Name[gl]=Navegador web Chromium
-Name[he]=דפדפן האינטרנט Chromium
-Name[hr]=Chromium web preglednik
-Name[hu]=Chromium webböngésző
-Name[id]=Peramban Web Chromium
-Name[it]=Browser web Chromium
-Name[ja]=Chromium ウェブ・ブラウザ
-Name[ko]=Chromium 웹 브라우저
-Name[pt_BR]=Chromium Navegador da Internet
-Name[ru]=Веб-браузер Chromium
-Name[sl]=Chromium spletni brskalnik
-Name[sv]=Webbläsaren Chromium
-Name[ug]=Chromium توركۆرگۈ
-Name[zh_CN]=Chromium 网页浏览器
-Name[zh_HK]=Chromium 網頁瀏覽器
-Name[zh_TW]=Chromium 網頁瀏覽器
+Name=Ungoogled Chromium
Comment=Access the Internet
Comment[ar]=الدخول إلى الإنترنت
Comment[ast]=Accesu a Internet
@@ -128,11 +107,11 @@ GenericName[vi]=Bộ duyệt Web
GenericName[zh_CN]=网页浏览器
GenericName[zh_HK]=網頁瀏覽器
GenericName[zh_TW]=網頁瀏覽器
-Exec=/usr/bin/chromium-browser %U
+Exec=/usr/bin/ungoogled-chromium %U
Terminal=false
X-MultipleArgs=false
Type=Application
-Icon=chromium-browser
+Icon=ungoogled-chromium
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Chromium-browser
@@ -245,7 +224,7 @@ Name[wo]=Palanteer bu bees
Name[xh]=Ifestile entsha
Name[zh-CN]=新建窗口
Name[zh-TW]=開新視窗
-Exec=chromium-browser %U
+Exec=ungoogled-chromium %U
[Desktop Action new-private-window]
Name=Open a New Private Window
@@ -353,4 +332,4 @@ Name[wo]=Panlanteeru biir bu bees
Name[xh]=Ifestile yangasese entsha
Name[zh-CN]=新建隐私浏览窗口
Name[zh-TW]=新增隱私視窗
-Exec=chromium-browser --incognito %U
+Exec=ungoogled-chromium --incognito %U
diff --git a/chromium-browser.sh b/chromium-browser.sh
index 4ed62f5..080110f 100755
--- a/chromium-browser.sh
+++ b/chromium-browser.sh
@@ -32,7 +32,7 @@ export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
# Allow users to override command-line options and prefer user defined
# CHROMIUM_USER_FLAGS from env over system wide CHROMIUM_FLAGS
-[[ -f /etc/chromium/chromium.conf ]] && . /etc/chromium/chromium.conf
+[[ -f /etc/ungoogled-chromium/ungoogled-chromium.conf ]] && . /etc/ungoogled-chromium/ungoogled-chromium.conf
CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-$CHROMIUM_FLAGS}
CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
@@ -40,6 +40,7 @@ CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
--enable-user-scripts \
--enable-printing \
--enable-sync \
+ --disable-background-networking \
--auto-ssl-client-auth @@EXTRA_FLAGS@@"
# Sanitize std{in,out,err} because they'll be shared with untrusted child
diff --git a/chromium-browser.xml b/chromium-browser.xml
index 159e05c..b6cce7e 100644
--- a/chromium-browser.xml
+++ b/chromium-browser.xml
@@ -3,10 +3,10 @@
<default-apps>
<web-browsers>
<web-browser>
- <name>Chromium</name>
- <executable>chromium-browser</executable>
- <command>/usr/bin/chromium-browser %s</command>
- <icon-name>chromium-browser</icon-name>
+ <name>Ungoogled Chromium</name>
+ <executable>ungoogled-chromium</executable>
+ <command>/usr/bin/ungoogled-chromium %s</command>
+ <icon-name>ungoogled-chromium</icon-name>
<run-in-terminal>false</run-in-terminal>
<netscape-remote>false</netscape-remote>
<!--
diff --git a/chromium.spec b/chromium.spec
index 43d1b86..3e28e29 100644
--- a/chromium.spec
+++ b/chromium.spec
@@ -36,10 +36,10 @@
ninja -j %{numjobs} -C '%1' '%2'
# enable|disable chromedriver
-%global build_chromedriver 1
+%global build_chromedriver 0
# enable|disable headless client build
-%global build_headless 1
+%global build_headless 0
%ifarch ppc64le
%global build_headless 0
%endif
@@ -128,9 +128,9 @@
# %%{nil} for Stable; -beta for Beta; -dev for Devel
# dash in -beta and -dev is intentional !
%global chromium_channel %{nil}
-%global chromium_menu_name Chromium
-%global chromium_browser_channel chromium-browser%{chromium_channel}
-%global chromium_path %{_libdir}/chromium-browser%{chromium_channel}
+%global chromium_menu_name Ungoogled Chromium
+%global chromium_browser_channel ungoogled-chromium%{chromium_channel}
+%global chromium_path %{_libdir}/ungoogled-chromium%{chromium_channel}
%global crd_path %{_libdir}/chrome-remote-desktop
# We don't want any libs in these directories to generate Provides
@@ -278,11 +278,11 @@
%global chromoting_client_id %nil
%endif
-Name: chromium%{chromium_channel}
+Name: ungoogled-chromium%{chromium_channel}
Version: 131.0.6778.204
Release: 1%{?dist}
-Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
-Url: http://www.chromium.org/Home
+Summary: A lightweight approach to removing Google web service dependency
+Url: https://github.com/Eloston/ungoogled-chromium
License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
# Use /etc/chromium for initial_prefs
@@ -459,8 +459,8 @@ Patch415: add-ppc64-pthread-stack-size.patch
# https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz
Source0: chromium-%{version}-clean.tar.xz
Source1: README.fedora
-Source2: chromium.conf
-Source3: chromium-browser.sh
+Source2: ungoogled-chromium.conf
+Source3: ungoogled-chromium.sh
Source4: %{chromium_browser_channel}.desktop
# Also, only used if you want to reproduce the clean tarball.
Source5: clean_ffmpeg.sh
@@ -470,7 +470,7 @@ Source7: get_free_ffmpeg_source_files.py
# Usage: get_linux_tests_name.py chromium-%%{version} --spec
Source8: get_linux_tests_names.py
# GNOME stuff
-Source9: chromium-browser.xml
+Source9: ungoogled-chromium.xml
Source10: chrome-remote-desktop@.service
Source11: master_preferences
@@ -485,6 +485,13 @@ Source14: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-%{esbuild_ve
Source15: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-%{esbuild_version}.tgz
%endif
+# Add our own appdata file.
+Source22: ungoogled-chromium.appdata.xml
+
+# ungoogled-chromium source
+%global ungoogled_chromium_revision %{version}-1
+Source300: https://github.com/Eloston/ungoogled-chromium/archive/%{ungoogled_chromium_revision}/ungoogled-chromium-%{ungoogled_chromium_revision}.tar.gz
+
# esbuild binary from fedora
%if 0%{?fedora}
BuildRequires: golang-github-evanw-esbuild
@@ -795,7 +802,7 @@ Requires: libcanberra-gtk3%{_isa}
Requires: u2f-hidraw-policy
%endif
-Requires: chromium-common%{_isa} = %{version}-%{release}
+Requires: ungoogled-chromium-common%{_isa} = %{version}-%{release}
# rhel 8 or newer and fedora < 40: x86_64, aarch64
# fedora 40 or newer: x86_64, aarch64, ppc64le
@@ -989,21 +996,24 @@ udev.
%package qt5-ui
Summary: Qt5 UI built from Chromium
-Requires: chromium%{_isa} = %{version}-%{release}
+Requires: ungoogled-chromium%{_isa} = %{version}-%{release}
%description qt5-ui
Qt5 UI for chromium.
%package qt6-ui
Summary: Qt6 UI built from Chromium
-Requires: chromium%{_isa} = %{version}-%{release}
+Requires: ungoogled-chromium%{_isa} = %{version}-%{release}
%description qt6-ui
Qt6 UI for chromium.
%prep
+%setup -q -T -n ungoogled-chromium-%{ungoogled_chromium_revision} -b 300
%setup -q -n chromium-%{version}
+%global ungoogled_chromium_root %{_builddir}/ungoogled-chromium-%{ungoogled_chromium_revision}
+
### Chromium Fedora Patches ###
%patch -P1 -p1 -b .etc
%patch -P8 -p1 -b .widevine-other-locations
@@ -1081,8 +1091,8 @@ Qt6 UI for chromium.
%if 0%{?rhel} && 0%{?rhel} < 10 || 0%{?fedora} && 0%{?fedora} < 40
%patch -P354 -p1 -b .split-threshold-for-reg-with-hint
%endif
-
-%patch -P355 -p1 -b .hardware_destructive_interference_size
+# Comment out to avoid unclean patching with equal Ungoogled Chromium patch
+#%%patch -P355 -p1 -b .hardware_destructive_interference_size
%patch -P356 -p1 -b .size-assertions
%patch -P358 -p1 -b .rust-clang_lib
@@ -1145,6 +1155,9 @@ Qt6 UI for chromium.
%patch -P415 -p1 -b .add-ppc64-pthread-stack-size
%endif
+# ungoogled-chromium: binary pruning.
+python3 -B %{ungoogled_chromium_root}/utils/prune_binaries.py . %{ungoogled_chromium_root}/pruning.list || true
+
# Change shebang in all relevant files in this directory and all subdirectories
# See `man find` for how the `-exec command {} +` syntax works
find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{chromium_pybin}=' {} +
@@ -1197,7 +1210,7 @@ cp -a %{_includedir}/libusb-1.0/libusb.h third_party/libusb/src/libusb/libusb.h
%endif
# Hard code extra version
-sed -i 's/getenv("CHROME_VERSION_EXTRA")/"Fedora Project"/' chrome/common/channel_info_posix.cc
+sed -i 's/getenv("CHROME_VERSION_EXTRA")/"Ungoogled Chromium"/' chrome/common/channel_info_posix.cc
# Fix hardcoded path in remoting code
sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc
@@ -1340,7 +1353,7 @@ CHROMIUM_BROWSER_GN_DEFINES=""
%if ! %{bundleffmpegfree}
CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chrome" proprietary_codecs=true is_component_ffmpeg=true enable_ffmpeg_video_decoders=true media_use_ffmpeg=true'
%else
-CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chromium" proprietary_codecs=false is_component_ffmpeg=false enable_ffmpeg_video_decoders=false media_use_ffmpeg=true'
+CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Ungoogled Chromium" proprietary_codecs=false is_component_ffmpeg=false enable_ffmpeg_video_decoders=false media_use_ffmpeg=true'
%endif
# link against noopenh264 library
%if 0%{?noopenh264}
@@ -1406,6 +1419,10 @@ CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libtiff=true'
CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libffi=true'
+#ungoogled-chromium: defines
+CHROMIUM_BROWSER_GN_DEFINES+=' '
+CHROMIUM_BROWSER_GN_DEFINES+=$(tr '\n' ' ' < %{ungoogled_chromium_root}/flags.gn)
+
export CHROMIUM_BROWSER_GN_DEFINES
# headless gn defines
@@ -1525,6 +1542,16 @@ if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \
exit 1 ; \
fi
+# ungoogled-chromium: patches
+python3 -B %{ungoogled_chromium_root}/utils/patches.py apply . %{ungoogled_chromium_root}/patches
+
+# ungoogled-chromium: domain substitution
+rm -f %{_builddir}/dsc.tar.gz
+python3 -B %{ungoogled_chromium_root}/utils/domain_substitution.py apply . \
+ -r %{ungoogled_chromium_root}/domain_regex.list \
+ -f %{ungoogled_chromium_root}/domain_substitution.list \
+ -c %{_builddir}/dsc.tar.gz
+
%if %{bootstrap}
tools/gn/bootstrap/bootstrap.py --gn-gen-args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES"
%else
@@ -1712,15 +1739,15 @@ popd
# need to strip binaries explicitly when debug is disable
%if ! %{enable_debug}
pushd %{buildroot}%{chromium_path}/
-for f in *.so *.so.1 chrome_crashpad_handler chrome-sandbox chromium-browser headless_shell chromedriver ; do
+for f in *.so.1 chrome_crashpad_handler chrome-sandbox ungoogled-chromium headless_shell chromedriver ; do
[ -f $f ] && strip $f
done
popd
%endif
# Add directories for policy management
-mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies/managed
-mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies/recommended
+mkdir -p %{buildroot}%{_sysconfdir}/ungoogled-chromium/policies/managed
+mkdir -p %{buildroot}%{_sysconfdir}/ungoogled-chromium/policies/recommended
cp -a out/Release/gen/chrome/app/policy/common/html/en-US/*.html .
cp -a out/Release/gen/chrome/app/policy/linux/examples/chrome.json .
@@ -1742,7 +1769,7 @@ install -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/%{name}/
mkdir -p %{buildroot}%{_datadir}/applications/
desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE4}
-install -D -m0644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \
+install -D -m0644 %{SOURCE22} \
${RPM_BUILD_ROOT}%{_datadir}/metainfo/%{chromium_browser_channel}.appdata.xml
appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/metainfo/%{chromium_browser_channel}.appdata.xml
@@ -1789,7 +1816,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%doc AUTHORS README.fedora
%doc chrome_policy_list.html *.json
%license LICENSE
-%config(noreplace) %{_sysconfdir}/%{name}/chromium.conf
+%config(noreplace) %{_sysconfdir}/%{name}/ungoogled-chromium.conf
%config %{_sysconfdir}/%{name}/master_preferences
%config %{_sysconfdir}/%{name}/policies/
%if %{build_remoting}
@@ -1802,12 +1829,13 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%{chromium_path}/resources.pak
%{chromium_path}/%{chromium_browser_channel}
%{chromium_path}/%{chromium_browser_channel}.sh
+%{chromium_path}/locales/*.pak
%attr(4755, root, root) %{chromium_path}/chrome-sandbox
%{_mandir}/man1/%{chromium_browser_channel}.*
%{_datadir}/icons/hicolor/*/apps/%{chromium_browser_channel}.png
%{_datadir}/applications/*.desktop
%{_datadir}/metainfo/*.appdata.xml
-%{_datadir}/gnome-control-center/default-apps/chromium-browser.xml
+%{_datadir}/gnome-control-center/default-apps/ungoogled-chromium.xml
%if %{use_qt}
%files qt5-ui
diff --git a/master_preferences b/master_preferences
index 8d732dc..32fdf95 100644
--- a/master_preferences
+++ b/master_preferences
@@ -1,5 +1,5 @@
{
- "homepage": "https://fedoraproject.org/start",
+ "homepage": "about:blank",
"homepage_is_newtabpage": false,
"distribution": {
"alternate_shortcut_text": false,
@@ -11,6 +11,6 @@
"verbose_logging": false
},
"first_run_tabs": [
- "https://fedoraproject.org/start"
+ "https://ungoogled-software.github.io",
]
}
diff --git a/ungoogled-chromium.appdata.xml b/ungoogled-chromium.appdata.xml
new file mode 100644
index 0000000..367f587
--- /dev/null
+++ b/ungoogled-chromium.appdata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop">
+ <id>ungoogled-chromium.desktop</id>
+ <update_contact>eloston@programmer.net</update_contact>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>
+ BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND
+ GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
+ </project_license>
+ <name>Ungoogled Chromium</name>
+ <summary>A lightweight approach to removing Google web service dependency</summary>
+ <description>
+ <p>
+ ungoogled-chromium is Chromium, sans integration with Google. It
+ features some tweaks to enhance privacy, control, and transparency (almost
+ all of which require manual activation or enabling).
+ </p>
+ <p>
+ ungoogled-chromium retains the default Chromium experience as closely as
+ possible. Unlike other Chromium forks that have their own visions of a web
+ browser, ungoogled-chromium is essentially a drop-in replacement for
+ Chromium.
+ </p>
+ </description>
+ <screenshots>
+ <screenshot type="default">
+ <image>https://user-images.githubusercontent.com/16843577/91255906-aa6e5e00-e76e-11ea-9326-fd236ff1db1d.png</image>
+ <caption/>
+ </screenshot>
+ </screenshots>
+ <translation/>
+ <developer_name>The Chromium Authors</developer_name>
+ <url type="homepage">https://github.com/Eloston/ungoogled-chromium</url>
+ <url type="bugtracker">https://github.com/Eloston/ungoogled-chromium/issues</url>
+ <url type="faq">https://ungoogled-software.github.io/ungoogled-chromium-wiki/faq</url>
+</component>