1 |
# eu-strip crashes on chrome binary from this build |
2 |
%define _enable_debug_packages 0 |
3 |
%global debug_package %{nil} |
4 |
%global __debug_install_post %{nil} |
5 |
|
6 |
%global use_gold 0 |
7 |
|
8 |
#squidf:WARNING: building with gcc is broken from chromium version 98. |
9 |
# It is possible again with gcc12 and Chromium 114 but Chromium crashes at launch... |
10 |
%global use_clang 1 |
11 |
#squidf: use ROCm to bring llvm17 |
12 |
%bcond_with system_llvm |
13 |
%if %{without system_llvm} |
14 |
%global _clang_path %{_libdir}/llvm17 |
15 |
%else |
16 |
%global _clang_path %{_prefix} |
17 |
%endif |
18 |
%ifarch %{ix86} |
19 |
#squidf: 120_ i586 crashes during link on our BS |
20 |
%global use_thin_lto 0 |
21 |
%global use_cfi 0 |
22 |
%else |
23 |
%global use_thin_lto 1 |
24 |
%global use_cfi 1 |
25 |
%endif |
26 |
|
27 |
#squidf: MGA version dependent flags |
28 |
#squidf: Chromium seems too sensitive to icu, leading to crash some sites like google earth |
29 |
%global system_icu 0 |
30 |
%global system_harfbuzz 1 |
31 |
%global system_ffmpeg 1 |
32 |
#squidf: use vaapi from the system |
33 |
%global system_vaapi 1 |
34 |
%global system_openjpeg 1 |
35 |
%global system_libtiff 1 |
36 |
%global system_libvpx 0 |
37 |
%global system_dav1d 1 |
38 |
%global system_libaom 0 |
39 |
%global system_libdrm 1 |
40 |
#squidf: bundled re2 from 116_ |
41 |
%global system_re2 0 |
42 |
%global system_flac 1 |
43 |
%global system_fontconfig 1 |
44 |
%global system_freetype 1 |
45 |
# system libevent causes the renderer to get stuck |
46 |
%global system_libevent 0 |
47 |
%global system_libpng 1 |
48 |
%global system_libusb 1 |
49 |
%global system_libwebp 1 |
50 |
%global system_libxml 0 |
51 |
%global system_libxslt 1 |
52 |
%global system_minizip 0 |
53 |
%global system_opus 1 |
54 |
%global system_wayland 1 |
55 |
#squidf: 120_ use bundled jsoncpp and snappy |
56 |
%global system_jsoncpp 0 |
57 |
%global system_snappy 0 |
58 |
|
59 |
#squidf: 120_ flag to enable|disable use_custom_libcxx |
60 |
%global use_custom_libcxx 1 |
61 |
|
62 |
#squidf:build error with chromium 97 even for MGA9 |
63 |
%global warnings_as_errors 0 |
64 |
|
65 |
%if %{use_gold} |
66 |
%define gn_gold use_gold=true |
67 |
%else |
68 |
%define gn_gold use_gold=false |
69 |
%endif |
70 |
%if %{use_thin_lto} |
71 |
%define gn_lto use_thin_lto=true |
72 |
%else |
73 |
%define gn_lto use_thin_lto=false |
74 |
%endif |
75 |
%if ! %{use_cfi} |
76 |
%define gn_cfi is_cfi=false |
77 |
%endif |
78 |
%if %{system_icu} |
79 |
%define bdl_icu icu |
80 |
#squidf: icu_use_data_file needs to be adjusted accordingly |
81 |
%define gn_icu icu_use_data_file=false |
82 |
%endif |
83 |
%if %{system_libtiff} |
84 |
%define gn_libtiff use_system_libtiff=true |
85 |
%endif |
86 |
%if %{system_libvpx} |
87 |
%define bdl_libvpx libvpx |
88 |
%endif |
89 |
%if %{system_libwebp} |
90 |
%define bdl_webp libwebp |
91 |
%endif |
92 |
%if %{system_libxml} |
93 |
%define bdl_libxml libxml |
94 |
%endif |
95 |
%if %{system_libxslt} |
96 |
%define bdl_xslt libxslt |
97 |
%endif |
98 |
%if %{system_dav1d} |
99 |
%define bdl_dav1d dav1d |
100 |
%endif |
101 |
%if %{system_libaom} |
102 |
%define bdl_libaom libaom |
103 |
%endif |
104 |
%if %{system_libdrm} |
105 |
%define bdl_drm libdrm |
106 |
%endif |
107 |
%if %{system_re2} |
108 |
%define bdl_re2 re2 |
109 |
%endif |
110 |
%if %{system_flac} |
111 |
%define bdl_flac flac |
112 |
%endif |
113 |
%if %{system_fontconfig} |
114 |
%define bdl_fontconfig fontconfig |
115 |
%endif |
116 |
%if %{system_freetype} |
117 |
%define gn_freetype use_system_freetype=true |
118 |
%define bdl_freetype freetype |
119 |
%endif |
120 |
%if %{system_libevent} |
121 |
%define bdl_libevent libevent |
122 |
%endif |
123 |
%if %{system_libpng} |
124 |
%define bdl_png libpng |
125 |
%endif |
126 |
%if %{system_ffmpeg} |
127 |
%define bdl_ffmpeg ffmpeg |
128 |
%endif |
129 |
%if %{system_openjpeg} |
130 |
%define bdl_libjpeg libjpeg |
131 |
%define gn_libjpeg use_system_libjpeg=true |
132 |
%endif |
133 |
%if %{system_libusb} |
134 |
%define bdl_libusb libusb |
135 |
%endif |
136 |
%if %{system_minizip} |
137 |
%define bdl_minizip minizip |
138 |
%endif |
139 |
%if %{system_opus} |
140 |
%define bdl_opus opus |
141 |
%endif |
142 |
%if %{system_vaapi} |
143 |
%define gn_vaapi use_vaapi=true |
144 |
%endif |
145 |
%if %{use_clang} |
146 |
%define gn_clang is_clang=true |
147 |
%define gn_lld use_lld=true |
148 |
%else |
149 |
%define gn_clang is_clang=false |
150 |
%define gn_lld use_lld=false |
151 |
%endif |
152 |
%if %{warnings_as_errors} |
153 |
#squidf: added as above for consistency |
154 |
%define gn_warnings_as_errors treat_warnings_as_errors=true |
155 |
%else |
156 |
%define gn_warnings_as_errors treat_warnings_as_errors=false |
157 |
%endif |
158 |
#squidf:test added here to be independant of Mageia version |
159 |
%if %{system_harfbuzz} |
160 |
%define gn_harfbuzz use_system_harfbuzz=true |
161 |
%define bdl_harfbuzz harfbuzz-ng |
162 |
%endif |
163 |
%if %{system_wayland} |
164 |
%define gn_wayland_server use_system_libwayland_server=true |
165 |
%define gn_wayland_scanner use_system_wayland_scanner=true |
166 |
%else |
167 |
%define gn_wayland_server use_system_libwayland_server=false |
168 |
%define gn_wayland_scanner use_system_wayland_scanner=false |
169 |
%endif |
170 |
%if %{use_custom_libcxx} |
171 |
%define gn_custom_libcxx use_custom_libcxx=true |
172 |
%else |
173 |
%define gn_custom_libcxx use_custom_libcxx=false |
174 |
%endif |
175 |
%if %{system_jsoncpp} |
176 |
%define bdl_jsoncpp jsoncpp |
177 |
%endif |
178 |
%if %{system_snappy} |
179 |
%define bdl_snappy snappy |
180 |
%endif |
181 |
|
182 |
%define crname chromium-browser |
183 |
%define _crdir %{_libdir}/%{crname} |
184 |
%define __requires_exclude_from ^%{_crdir}/libwidevinecdmadapter.so$ |
185 |
|
186 |
# eol 'fix' corrupts some .bin |
187 |
%define dont_fix_eol 1 |
188 |
|
189 |
# Set up Google API keys, see https://www.chromium.org/developers/how-tos/api-keys |
190 |
# Note: these are for Mageia use ONLY. |
191 |
# For your own builds, please get your own set of keys. |
192 |
%define google_api_key AIzaSyDhhIHB_kQZodiWr8yDAm8E3GwEyiXmuDU |
193 |
|
194 |
#squidf: to better track esbuild version |
195 |
# check chromium version in third_party/devtools-frontend/src/DEPS |
196 |
# https://github.com/evanw/esbuild |
197 |
%define esb_ver 0.16.4 |
198 |
|
199 |
Name: chromium-browser-stable |
200 |
Version: 121.0.6167.184 |
201 |
Release: %mkrel 1 |
202 |
Summary: A fast webkit-based web browser |
203 |
Group: Networking/WWW |
204 |
License: BSD and LGPLv2+ |
205 |
URL: https://www.chromium.org/Home |
206 |
# https://omahaproxy.appspot.com/ |
207 |
# https://googlechromereleases.blogspot.com/ |
208 |
Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz |
209 |
Source1: chromium-wrapper |
210 |
Source2: chromium-browser.desktop |
211 |
#squidf: to get esbuild from https://github.com/evanw/esbuild with vendor |
212 |
Source3: gen_esbuild_vendor.sh |
213 |
Source4: esbuild-%{esb_ver}.tar.xz |
214 |
#squidf: Applications preferences at startup |
215 |
Source13: master_preferences |
216 |
|
217 |
# fix googleisms in man page |
218 |
Patch2: chromium-mageia.patch |
219 |
# (ns80) use a patch rather than a source file for widevine |
220 |
Patch3: chromium-71.0.3578.98-widevine-r3.patch |
221 |
# (ns80) remove unrar |
222 |
Patch4: chromium-118-norar.patch |
223 |
# (cjw) disable external components -- this stops chromium from downloading hotword stuff, for example |
224 |
#squidf: update for 103_ and simplified |
225 |
Patch10: chromium-103-no-external-components.patch |
226 |
# (cjw) link several libraries directly instead of loading them using dlopen() |
227 |
Patch27: chromium-121-link-libgio-libpci-libudev-libbrlapi.patch |
228 |
# (cjw) add missing unbundle gn files (2) |
229 |
Patch29: chromium-53-gn-system-opus.patch |
230 |
# (cjw) build pdfium with system libtiff |
231 |
Patch30: chromium-121-pdfium-system-libtiff-libpng.patch |
232 |
# (cjw) fix pdfium build with system openjpeg |
233 |
Patch31: chromium-117-pdfium-system-libopenjpeg2.patch |
234 |
# (cjw) use system nodejs to fix build |
235 |
Patch37: chromium-98-system-nodejs.patch |
236 |
# (cjw) use system closure compiler |
237 |
Patch38: chromium-110-system-closure-compiler.patch |
238 |
# (cjw) fix build with system icu |
239 |
Patch39: chromium-113-system-icu.patch |
240 |
# (cjw) gcc errors: include files |
241 |
#squidf: Required with clang as well |
242 |
Patch81: chromium-120-gcc-includes.patch |
243 |
# (cjw) gcc warnings: missing casts |
244 |
# (cjw) fix gn bootstrapping with gcc. Kept with clang to stay safe. |
245 |
#squidf: grouped 69 and 72 versions |
246 |
Patch190: chromium-98-gn-bootstrap.patch |
247 |
# (cjw) fix i586 build |
248 |
Patch198: chromium-72-i586.patch |
249 |
#squidf: grouped system zlib patches 85, 87 and 96, including angle-vulkan fix |
250 |
Patch240: chromium-117-system-zlib.patch |
251 |
#squidf: due to the switch to minizip-ng |
252 |
Patch241: chromium-119-system-minizip.patch |
253 |
# (cjw) fix broken system libvpx build |
254 |
Patch244: chromium-88-system-libvpx.patch |
255 |
# (cjw) remove assertion on "chromium" branding in combination with enabled "proprietary codecs" |
256 |
Patch250: chromium-106-proprietary-codecs-assert.patch |
257 |
# squidf: _121 |
258 |
Patch251: chromium-107-ffmpeg-5.x-duration.patch |
259 |
#squidf: from Fedora disable FFmpegAllowLists by default to allow external ffmpeg - YouTube issue |
260 |
Patch252: chromium-120-disable-FFmpegAllowLists.patch |
261 |
#squidf: 102_: fix no member named 'ch_layout' in 'AVCodecContext' and 'AVframe' |
262 |
# updated for _121 |
263 |
Patch253: chromium-121-system-old-ffmpeg.patch |
264 |
#squidf: from Fedora |
265 |
Patch254: chromium-118-sigtrap_system_ffmpeg.patch |
266 |
#squidf: to use system libusb |
267 |
Patch256: chromium-120-system-libusb.patch |
268 |
Patch257: chromium-117-libusb_interrupt_event_handler.patch |
269 |
|
270 |
#squidf:geentoo patch to pass sandbox/linux/services/credentials.cc:103:16: error: variable-sized object may not be initialized |
271 |
# https://bugs.gentoo.org/823857 |
272 |
Patch261: chromium-100-clang-variable-size-object.patch |
273 |
|
274 |
#squidf:additional patch for vaapi (mainly from rpmfusion/freeworld) |
275 |
#squidf: update for 100_: deprecated patch for media/gpu/chromeos/video_decoder_pipeline.cc |
276 |
Patch280: chromium-100-vaapi-libdrm.patch |
277 |
|
278 |
#squidf: additional patch |
279 |
#squidf: build error: math_extras.h:130:18: error: constexpr function never produces a constant expression |
280 |
Patch301: chromium-98-constexpr-compiler.patch |
281 |
#squidf: from openSUSE tumbleweed to unbundle fully libdrm |
282 |
Patch306: chromium-114-system-libdrm.patch |
283 |
#squidf: update for 99_ |
284 |
Patch307: chromium-112-wayland-egl.patch |
285 |
#squidf: 102_: additional build fix for i586 |
286 |
Patch310: chromium-105-fix-i586-build.patch |
287 |
#squidf: 102: fix fatal error: instantiating fold expression with 303 arguments exceeded expression nesting limit of 256 |
288 |
# from https://github.com/stha09/chromium-patches |
289 |
Patch313: chromium-102-regex_pattern-array.patch |
290 |
#squidf: from Arch |
291 |
Patch314: chromium-120-compiler.patch |
292 |
#squidf: 106_ fix missing include cmath |
293 |
Patch318: chromium-116-include-std-namespace.patch |
294 |
#squidf: allow system clang version |
295 |
Patch319: chromium-107-remove-clang-version-test.patch |
296 |
#squidf: from 120_ |
297 |
# disable GlobalMediaControlsCastStartStop to avoid crash |
298 |
# when using the address bar media player button |
299 |
# it works with use_custom_libcxx=true |
300 |
Patch320: chromium-120-disable-GlobalMediaControlsCastStartStop.patch |
301 |
#squidf: specific Mageia clang15 patch apparently |
302 |
Patch350: chromium-121-include-vector.patch |
303 |
#squidf: from Fedora |
304 |
Patch400: chromium-111-disable-font-tests.patch |
305 |
Patch401: chromium-121-el7-default_constructor.patch |
306 |
Patch402: chromium-120-el7-clang-build-failure.patch |
307 |
Patch403: chromium-121-el7-clang-version-warning.patch |
308 |
# squidf: From Arch: this allows signing into Chromium without baked-in values |
309 |
Patch405: chromium-121-use-oauth2-client-switches-as-default.patch |
310 |
#squidf: 114_ remove rust version check |
311 |
Patch406: chromium-116-trick-rust-version.patch |
312 |
#squidf: from Fedora, former openSUSE to build with gcc |
313 |
Patch408: chromium-120-missing-header-files.patch |
314 |
#squidf: various community patches to fix build |
315 |
Patch409: chromium-121-workaround_clang_bug-structured_binding.patch |
316 |
Patch410: chromium-121-blink-BUILD-mnemonic.patch |
317 |
#squidf: from Arch |
318 |
Patch412: chromium-119-assert.patch |
319 |
Patch413: chromium-115-compiler-SkColor4f.patch |
320 |
Patch414: chromium-117-string-convert.patch |
321 |
Patch415: chromium-121-nullptr_t-without-namespace-std.patch |
322 |
Patch416: chromium-121-typename.patch |
323 |
Patch417: chromium-120-el7-extra-operator.patch |
324 |
Patch418: chromium-117-lp155-url_load_stats-size-t.patch |
325 |
Patch419: chromium-121-no_matching_constructor.patch |
326 |
#squidf: from Fedora, remove ldflags -Wl,-mllvm,-disable-auto-upgrade-debug-info which is not supported |
327 |
Patch421: chromium-120-clang16-disable-auto-upgrade-debug-info.patch |
328 |
#squidf: from Fedora |
329 |
Patch422: chromium-121-constexpr.patch |
330 |
Patch423: chromium-121-python3-invalid-escape-sequence.patch |
331 |
Patch424: chromium-121-llvm17-clang-lib-path.patch |
332 |
|
333 |
#For integration |
334 |
Recommends: xdg-utils |
335 |
Recommends: xdg-portal |
336 |
|
337 |
Provides: %{crname} |
338 |
|
339 |
BuildRequires: bison |
340 |
#squidf: 120_ cfi to be used when possible |
341 |
%if %{with system_llvm} |
342 |
BuildRequires: compiler-rt |
343 |
%endif |
344 |
BuildRequires: flex |
345 |
#squidf: add golang to build esbuild from source |
346 |
BuildRequires: golang |
347 |
BuildRequires: gperf |
348 |
%if %{system_icu} |
349 |
BuildRequires: icu |
350 |
%endif |
351 |
BuildRequires: ninja |
352 |
#squidf: move to Python3: |
353 |
BuildRequires: python3 |
354 |
BuildRequires: python3-devel |
355 |
BuildRequires: python3-beautifulsoup4 |
356 |
BuildRequires: python3-html5lib |
357 |
BuildRequires: python3-urllib3 |
358 |
BuildRequires: python3-markupsafe |
359 |
BuildRequires: python3dist(pyparsing) |
360 |
BuildRequires: python3-ply |
361 |
BuildRequires: python3-simplejson |
362 |
#BuildRequires: yasm |
363 |
BuildRequires: bzip2-devel |
364 |
#BuildRequires: closure-compiler |
365 |
BuildRequires: cups-devel |
366 |
BuildRequires: elfutils-devel |
367 |
%if %{system_ffmpeg} |
368 |
BuildRequires: ffmpeg-devel |
369 |
%endif |
370 |
BuildRequires: pkgconfig(libavcodec) |
371 |
BuildRequires: pkgconfig(libavfilter) |
372 |
BuildRequires: pkgconfig(libavformat) |
373 |
BuildRequires: pkgconfig(libavutil) |
374 |
BuildRequires: glib2-devel |
375 |
BuildRequires: pkgconfig(gtk4) |
376 |
BuildRequires: pkgconfig(gtk+-3.0) |
377 |
BuildRequires: libatomic-devel |
378 |
%if %{system_libevent} |
379 |
BuildRequires: libevent-devel |
380 |
%endif |
381 |
BuildRequires: libmesagl-devel |
382 |
BuildRequires: libpam-devel |
383 |
BuildRequires: libpulseaudio-devel |
384 |
BuildRequires: mesaglesv2-devel |
385 |
|
386 |
BuildRequires: nodejs |
387 |
BuildRequires: rust |
388 |
|
389 |
BuildRequires: osmesa-devel |
390 |
#BuildRequires: protobuf-devel |
391 |
%if %{system_snappy} |
392 |
BuildRequires: snappy-devel |
393 |
%endif |
394 |
BuildRequires: perl(Switch) |
395 |
BuildRequires: pkgconfig(alsa) |
396 |
BuildRequires: pkgconfig(atk-bridge-2.0) |
397 |
%if %{system_dav1d} |
398 |
BuildRequires: pkgconfig(dav1d) |
399 |
%endif |
400 |
%if %{system_libaom} |
401 |
BuildRequires: pkgconfig(aom) |
402 |
%endif |
403 |
BuildRequires: pkgconfig(atspi-2) |
404 |
BuildRequires: pkgconfig(dbus-glib-1) |
405 |
BuildRequires: pkgconfig(epoxy) |
406 |
BuildRequires: pkgconfig(expat) |
407 |
%if %{system_fontconfig} |
408 |
BuildRequires: pkgconfig(flac) |
409 |
%endif |
410 |
%if %{system_fontconfig} |
411 |
BuildRequires: pkgconfig(fontconfig) |
412 |
%endif |
413 |
%if %{system_freetype} |
414 |
BuildRequires: pkgconfig(freetype2) |
415 |
%endif |
416 |
BuildRequires: pkgconfig(gbm) |
417 |
BuildRequires: pkgconfig(glu) |
418 |
BuildRequires: pkgconfig(gnome-keyring-1) |
419 |
BuildRequires: pkgconfig(gnutls) |
420 |
%if %{system_harfbuzz} |
421 |
BuildRequires: pkgconfig(harfbuzz) |
422 |
%endif |
423 |
%if %{system_icu} |
424 |
BuildRequires: pkgconfig(icu-i18n) |
425 |
%endif |
426 |
%if %{system_jsoncpp} |
427 |
BuildRequires: pkgconfig(jsoncpp) |
428 |
%endif |
429 |
BuildRequires: pkgconfig(libcap) |
430 |
%if %{system_libdrm} |
431 |
BuildRequires: pkgconfig(libdrm) |
432 |
%endif |
433 |
BuildRequires: pkgconfig(libexif) |
434 |
BuildRequires: pkgconfig(libjpeg) |
435 |
BuildRequires: pkgconfig(libopenjp2) |
436 |
BuildRequires: pkgconfig(libpci) |
437 |
%if %{system_libpng} |
438 |
BuildRequires: pkgconfig(libpng) |
439 |
%endif |
440 |
%if %{system_libtiff} |
441 |
BuildRequires: pkgconfig(libtiff-4) |
442 |
%endif |
443 |
BuildRequires: pkgconfig(libusb-1.0) |
444 |
#squidf:added for vaapi support |
445 |
BuildRequires: pkgconfig(egl) |
446 |
BuildRequires: pkgconfig(libva) |
447 |
BuildRequires: pkgconfig(libva-drm) |
448 |
BuildRequires: pkgconfig(libva-glx) |
449 |
BuildRequires: pkgconfig(libva-wayland) |
450 |
BuildRequires: pkgconfig(libva-x11) |
451 |
%if %{system_libvpx} |
452 |
BuildRequires: pkgconfig(libvpx) |
453 |
%endif |
454 |
%if %{system_libwebp} |
455 |
BuildRequires: pkgconfig(libwebp) |
456 |
%endif |
457 |
%if %{system_libxml} |
458 |
BuildRequires: pkgconfig(libxml-2.0) |
459 |
%endif |
460 |
%if %{system_libxslt} |
461 |
BuildRequires: pkgconfig(libxslt) |
462 |
%endif |
463 |
%if %{system_minizip} |
464 |
BuildRequires: pkgconfig(minizip) |
465 |
%endif |
466 |
BuildRequires: pkgconfig(nspr) |
467 |
BuildRequires: pkgconfig(nss) |
468 |
%if %{system_opus} |
469 |
BuildRequires: pkgconfig(opus) |
470 |
%endif |
471 |
%if %{system_re2} |
472 |
BuildRequires: pkgconfig(re2) |
473 |
%endif |
474 |
BuildRequires: pkgconfig(speech-dispatcher) |
475 |
BuildRequires: pkgconfig(speex) |
476 |
BuildRequires: pkgconfig(udev) |
477 |
BuildRequires: pkgconfig(xcomposite) |
478 |
BuildRequires: pkgconfig(xscrnsaver) |
479 |
BuildRequires: pkgconfig(xt) |
480 |
BuildRequires: pkgconfig(xtst) |
481 |
BuildRequires: pkgconfig(zlib) |
482 |
%if %{use_clang} |
483 |
%if %{without system_llvm} |
484 |
BuildRequires: llvm17-devel |
485 |
BuildRequires: llvm17-tools-extra |
486 |
%else |
487 |
BuildRequires: clang |
488 |
BuildRequires: lld |
489 |
BuildRequires: clang-tools-extra |
490 |
%endif |
491 |
%endif |
492 |
%if %{system_wayland} |
493 |
BuildRequires: pkgconfig(wayland-egl) |
494 |
BuildRequires: pkgconfig(wayland-client) |
495 |
BuildRequires: pkgconfig(wayland-cursor) |
496 |
BuildRequires: pkgconfig(wayland-scanner) |
497 |
BuildRequires: pkgconfig(wayland-server) |
498 |
%endif |
499 |
# Unused but building gn wants it to be present |
500 |
BuildRequires: pkgconfig(gconf-2.0) |
501 |
BuildRequires: git |
502 |
#squidf: add support to pipewire |
503 |
BuildRequires: pkgconfig(libpipewire-0.3) |
504 |
#squidf: new BR from 107_ to enable Qt6 |
505 |
BuildRequires: pkgconfig(Qt5Core) |
506 |
BuildRequires: pkgconfig(Qt6Core) |
507 |
BuildRequires: pkgconfig(Qt5Widgets) |
508 |
BuildRequires: pkgconfig(Qt6Widgets) |
509 |
|
510 |
|
511 |
ExclusiveArch: i586 x86_64 |
512 |
# aarch64 does not build without fewer than default parallel jobs config |
513 |
# armv5tl armv7hl |
514 |
|
515 |
%description |
516 |
Chromium is a browser that combines a minimal design with sophisticated |
517 |
technology to make the web faster, safer, and easier. |
518 |
|
519 |
For certain media playback features - AAC decoding - this package |
520 |
currently assumes decoder support is available, while that is only true if |
521 |
the 'tainted' variety of the libavcodec package is installed. When the 'core' |
522 |
variety of libavcodec is installed, chromium may output noise for AAC audio. |
523 |
|
524 |
%ifarch %{ix86} |
525 |
The i586 build of this package does not work on machines that do not |
526 |
support the SSE2 instruction set extension. |
527 |
%endif |
528 |
|
529 |
%package -n chromium-browser |
530 |
Summary: A fast webkit-based web browser (transition package) |
531 |
Epoch: 1 |
532 |
Group: Networking/WWW |
533 |
Requires: %{name} = %{version}-%{release} |
534 |
|
535 |
%description -n chromium-browser |
536 |
Chromium is a browser that combines a minimal design with sophisticated |
537 |
technology to make the web faster, safer, and easier. |
538 |
|
539 |
This is a transition package that installs the stable channel Chromium |
540 |
browser. |
541 |
|
542 |
%prep |
543 |
%setup -q -n chromium-%{version} |
544 |
|
545 |
#squidf: avoid autopatch to get all patches in src.rpm, independently of the flag settings |
546 |
%patch -P2 -p1 -b .fix-googleism |
547 |
%patch -P3 -p1 -b .add-widevine |
548 |
%patch -P4 -p1 -b .remove-norar |
549 |
%patch -P10 -p1 -b .disable-no-external-components-downloads |
550 |
%patch -P27 -p1 -b .link-libraaries-libgio-libpci-libudev-libbrlapi |
551 |
%patch -P29 -p1 -b .missing-system-opus-gn-flag |
552 |
%if %{system_libtiff} |
553 |
%patch -P30 -p1 -b .use-pdfium-with-system-libtiff-libpng |
554 |
%endif |
555 |
%if %{system_openjpeg} |
556 |
%patch -P31 -p1 -b .use-pdfium-with-system-libopenjpeg2 |
557 |
%endif |
558 |
%patch -P37 -p1 -b .fix-build-with-system-nodejs |
559 |
%patch -P38 -p1 -b .use-system-closure-compiler |
560 |
%if %{system_icu} |
561 |
%patch -P39 -p1 -b .fix-build-with-system-icu |
562 |
%endif |
563 |
%patch -P81 -p1 -b .fix-build-gcc-includes |
564 |
%patch -P190 -p1 -b .fix-build-gn-bootstrap |
565 |
%patch -P198 -p1 -b .fix-build-i586 |
566 |
%if %{system_minizip} |
567 |
%patch -P240 -p1 -b .use-system-zlib |
568 |
%patch -P241 -p1 -b .use-system-minizip |
569 |
%endif |
570 |
%patch -P244 -p1 -b .use-system-libvpx |
571 |
|
572 |
%if %{system_ffmpeg} |
573 |
%patch -P250 -p1 -b .remove-chromium-branding |
574 |
%patch -P251 -p1 -b .ffmpeg5-duration |
575 |
%patch -P252 -p1 -b .fix-ffmpeg-youtube-playback |
576 |
%patch -P253 -p1 -b .fix-build-old-ffmpeg |
577 |
%patch -P254 -p1 -b .fix-youtube-ffmpeg-crash |
578 |
%endif |
579 |
|
580 |
%patch -P256 -p1 -b .use-system-libusb |
581 |
%patch -P257 -p1 -b .libusb-interrupt |
582 |
|
583 |
%patch -P261 -p1 -b .fix-build-variable-size-object |
584 |
|
585 |
%patch -P280 -p1 -b .use-system-vaapi-libdrm |
586 |
|
587 |
%patch -P301 -p1 -b .fix-build-constexpr |
588 |
|
589 |
%patch -P306 -p1 -b .system-libdrm |
590 |
%patch -P307 -p1 -b .wayland-egl |
591 |
%patch -P310 -p1 -b .fix-i586-build |
592 |
|
593 |
%patch -P313 -p1 -b .fix-build-array-limit |
594 |
%patch -P314 -p1 -b .arch-compiler |
595 |
%patch -P318 -p1 -b .fix-build-isnan-member |
596 |
%patch -P319 -p1 -b .allow-system-clang-version |
597 |
%if ! %{use_custom_libcxx} |
598 |
%patch -P320 -p1 -b .avoid-media-bar-crash |
599 |
%patch -P350 -p1 -b .missing-vector-include |
600 |
%endif |
601 |
%patch -P400 -p1 -b .fix-terminal-error-fontconfig |
602 |
%patch -P401 -p1 -b .fix-build-117_01 |
603 |
%patch -P402 -p1 -R -b .fix-build-120_02 |
604 |
%patch -P403 -p1 -b .fix-build-121_03 |
605 |
%patch -P405 -p1 -b .use-oauth2-client-switches |
606 |
%patch -P406 -p1 -b .remove-rust-version-check |
607 |
%patch -P408 -p1 -b .fix-build-gcc13 |
608 |
%patch -P409 -p1 -b .fix-build-clang-structured_binding |
609 |
%patch -P410 -p1 -b .fix-build-117_10 |
610 |
%patch -P412 -p1 -b .fix-build-119_11 |
611 |
%patch -P413 -p1 -b .fix-build-117_13 |
612 |
%patch -P414 -p1 -b .fix-build-117_14 |
613 |
%if ! %{use_custom_libcxx} |
614 |
%patch -P415 -p1 -b .fix-build-119-15 |
615 |
%endif |
616 |
%patch -P416 -p1 -b .fix-build-120_16 |
617 |
%patch -P417 -p1 -b .fix-build-120_17 |
618 |
%patch -P418 -p1 -b .fix-build-117_18 |
619 |
%patch -P419 -p1 -b .fix-build-120_19 |
620 |
%patch -P421 -p1 -b .fix-build-120_21 |
621 |
%patch -P422 -p1 -b .fix-build-121_22 |
622 |
%patch -P423 -p1 -b .fix-build-121_23 |
623 |
%patch -P424 -p1 -b .fix-build-121_24 |
624 |
|
625 |
#squidf: use esbuild version from esbuild source |
626 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/DEPS |
627 |
sed -i 's/0.14.13/%{esb_ver}/g' ./DEPS |
628 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/node_modules/esbuild/lib/main.js |
629 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/node_modules/esbuild/install.js |
630 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/node_modules/esbuild/package.json |
631 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/package-lock.json |
632 |
sed -i 's/0.14.13/%{esb_ver}/g' ./third_party/devtools-frontend/src/scripts/deps/manage_node_deps.py |
633 |
|
634 |
# files we do not want from upstream source bundles |
635 |
rm -r --interactive=never third_party/breakpad/breakpad/src/processor/testdata/ |
636 |
rm -r --interactive=never third_party/breakpad/breakpad/src/tools |
637 |
#squidf: chrome/test/data/extensions is mandatory to build 108_ |
638 |
rm -r --interactive=never chrome/test/data/{android,app_shim,apptest,ash,autofill,automation,automation_proxy_snapshot,banners,bookmark_html_reader,bookmarks,captive_portal,chromedriver,chrome_endure,chromeos,click_modifier,components,constrained_files,content,content_setting_bubble,devtools,diagnostics,dom_automation,dom_checker,dom_distiller,downloads,dromaeo,durable,edge_database_reader,edge_profile,encoding_tests,fast_shutdown,fast_tab_close,favicon,feeds,file_select_helper,find_in_page,focus,frame_dom_access,frame_tree,fullscreen_mouselock,geolocation,google,gpu,History,image_decoding,image_search,import,indexeddb,inspector,installer,interstitial_page,login,native_messaging,navigation_interception,notifications,page_cycler,page_load_metrics,password,pepper,perf,permissions,plugin_power_saver,policy,popup_blocker,predictor,prefs,pref_service,prerender,printing,profiles,push_messaging,referrer_policy,safe_browsing,save_page,scroll,session_history,session_restore,sessions,settings,speech,ssl,sunspider,sync,template_url_scraper,textinput,third_party,top_sites,translate,viewsource,web_app_info,webrtc,websocket,workers} |
639 |
rm -r --interactive=never chrome/test/data/nacl/{pnacl_error_handling,cross_origin,irt_exception,pnacl_request_header,pnacl_url_loader,pnacl_hw_eh_disabled,pnacl_nmf_options,pnacl_dyncode_syscall_disabled,extension_mime_handler,ppapi_test_lib,bad,ppapi,manifest,pnacl_debug_url,extension_validation_cache,exit_status,progress_events,manifest_file,sysconf_nprocessors_onln,crash} |
640 |
rmdir chrome/test/data/webui/settings/chromeos/app_management |
641 |
rmdir chrome/test/data/webui/history/history_clusters |
642 |
rm -r --interactive=never components/test/data/update_client/jebgalgnebhfojomionfpkfelancnnkf/component1.dll |
643 |
rm -r --interactive=never content/test/data/ |
644 |
rm -r --interactive=never ppapi/native_client/tests/ |
645 |
rm -r --interactive=never third_party/apache-win32/ |
646 |
rm -r --interactive=never third_party/expat/{fuzz,include,src} |
647 |
%if %{system_freetype} |
648 |
rm -r --interactive=never third_party/freetype/{include,src} |
649 |
%endif |
650 |
%if %{system_ffmpeg} |
651 |
rm -r --interactive=never third_party/ffmpeg/*/* |
652 |
%endif |
653 |
rm -r --interactive=never third_party/flac/{include,src} |
654 |
%if %{system_icu} |
655 |
rm -r --interactive=never third_party/icu/{android,common,patches,source,chromeos,ios} |
656 |
%endif |
657 |
%if %{system_jsoncpp} |
658 |
rm -r --interactive=never third_party/jsoncpp/source |
659 |
%endif |
660 |
rm -r --interactive=never third_party/lcov |
661 |
%if %{system_libevent} |
662 |
rm -r --interactive=never base/third_party/libevent/*/* |
663 |
rm -r --interactive=never base/third_party/libevent/*.[ch] |
664 |
%endif |
665 |
%if %{system_libvpx} |
666 |
rm -r --interactive=never third_party/libvpx/source/{libvpx,config} |
667 |
%endif |
668 |
%if %{system_libaom} |
669 |
rm -r --interactive=never third_party/libaom/source |
670 |
%endif |
671 |
%if %{system_dav1d} |
672 |
rm -r --interactive=never third_party/dav1d/{libdav1d,version} |
673 |
%endif |
674 |
rm -r --interactive=never third_party/libjpeg_turbo/*.[ch] |
675 |
rm -r --interactive=never third_party/libpng/*.[ch] |
676 |
rm -r --interactive=never third_party/libxslt/{mac,win32} |
677 |
%if %{system_libxslt} |
678 |
rm -r --interactive=never third_party/libxslt/{linux,src} |
679 |
%endif |
680 |
rm -r --interactive=never third_party/xdg-utils/tests/ |
681 |
%if %{system_minizip} |
682 |
rm -r --interactive=never third_party/zlib/{*.[ch],contrib/minizip} |
683 |
%endif |
684 |
rm -r --interactive=never native_client_sdk/src/tools/lib/tests/data |
685 |
rm -r --interactive=never buildtools/third_party/eu-strip/bin |
686 |
rm --interactive=never third_party/pdfium/third_party/libopenjpeg/*.[ch] |
687 |
%if %{system_libtiff} |
688 |
rm --interactive=never third_party/pdfium/third_party/libtiff/*.[ch] |
689 |
%endif |
690 |
%if %{system_re2} |
691 |
rm -r --interactive=never third_party/re2/src |
692 |
%endif |
693 |
%if %{system_fontconfig} |
694 |
rm -r --interactive=never third_party/fontconfig/{src,include,chromium} |
695 |
%endif |
696 |
rm --interactive=never third_party/webrtc/data/voice_engine/stereo_rtp_files/rtpplay.exe |
697 |
rm -r --interactive=never third_party/llvm |
698 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/bob/bob |
699 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/glut/SanOGLES |
700 |
rm -r --interactive=never third_party/lzma_sdk/bin/* |
701 |
rm --interactive=never third_party/breakpad/symupload.exe |
702 |
rm -r --interactive=never third_party/catapult/third_party/google-endpoints/setuptools |
703 |
rm -r --interactive=never third_party/catapult/third_party/vinn/third_party/v8 |
704 |
rm -r --interactive=never base/test/data/pe_image/ |
705 |
rm -r --interactive=never base/test/data/file_version_info_unittest |
706 |
rm --interactive=never third_party/crashpad/crashpad/handler/win/z7_test.dll |
707 |
rm -r --interactive=never third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_fuzzer_corpus |
708 |
rm -r --interactive=never third_party/boringssl/src/util/ar/testdata |
709 |
rm -r --interactive=never third_party/pyelftools/test/testfiles_for_unittests |
710 |
rm -r --interactive=never third_party/pyelftools/test/external_tools |
711 |
rm -r --interactive=never third_party/pyelftools/test/testfiles_for_readelf |
712 |
rm -r --interactive=never third_party/pyelftools/examples |
713 |
rm -r --interactive=never third_party/skia/platform_tools/android/bin |
714 |
rm --interactive=never third_party/nasm/travis/test/tmap.o.t |
715 |
rm -r --interactive=never build/android/tests/symbolize |
716 |
rm --interactive=never third_party/skia/platform_tools/android/apps/gradle/wrapper/gradle-wrapper.jar |
717 |
rm --interactive=never third_party/libphonenumber/dist/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar |
718 |
rm --interactive=never third_party/libphonenumber/dist/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar |
719 |
rm -r --interactive=never third_party/libphonenumber/dist/java/lib |
720 |
rm --interactive=never third_party/webrtc/examples/androidapp/third_party/autobanh/lib/autobanh.jar |
721 |
rm --interactive=never third_party/closure_compiler/compiler/compiler.jar |
722 |
rm --interactive=never third_party/flatbuffers/src/android/gradle/wrapper/gradle-wrapper.jar |
723 |
rm --interactive=never third_party/flatbuffers/src/kotlin/gradle/wrapper/gradle-wrapper.jar |
724 |
rm --interactive=never third_party/gradle_wrapper/gradle/wrapper/gradle-wrapper.jar |
725 |
rm --interactive=never third_party/webgl/src/conformance-suites/2.0.0/deqp/compiler.jar |
726 |
rm --interactive=never third_party/grpc/src/examples/android/helloworld/gradle/wrapper/gradle-wrapper.jar |
727 |
rm --interactive=never third_party/grpc/src/src/android/test/interop/gradle/wrapper/gradle-wrapper.jar |
728 |
rm --interactive=never third_party/tflite/src/tensorflow/lite/java/ovic/demo/gradle/wrapper/gradle-wrapper.jar |
729 |
rm --interactive=never third_party/tflite/src/tensorflow/lite/java/demo/gradle/wrapper/gradle-wrapper.jar |
730 |
rm --interactive=never third_party/checkstyle/checkstyle-all.jar |
731 |
rm --interactive=never build/android/stacktrace/java_deobfuscate_java.jar |
732 |
|
733 |
%if %{system_libevent} |
734 |
find base/third_party/libevent -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete |
735 |
%endif |
736 |
|
737 |
%if %{system_icu} |
738 |
# Remove bundled ICU; its header files appear to get picked up instead of |
739 |
# the system ones, leading to errors during the final link stage. |
740 |
# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q |
741 |
find third_party/icu -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete |
742 |
%endif |
743 |
|
744 |
# Hard code extra version |
745 |
FILE=chrome/common/channel_info_posix.cc |
746 |
sed -i.orig -r -e 's/env = getenv\("CHROME_VERSION_EXTRA"\).*;/env = "%{product_vendor} %{product_version}";/' -e 's/return env \? (.*) : .*;/return \1;/' $FILE |
747 |
if diff -u $FILE $FILE.orig >/dev/null; then |
748 |
exit 1 |
749 |
fi |
750 |
|
751 |
#squidf: Fedora and Arch allow building against system libraries in official builds |
752 |
# It is not related to Google Chrome build; misleading. |
753 |
# https://groups.google.com/a/chromium.org/g/chromium-dev/c/4F5hM8XMOhQ |
754 |
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ |
755 |
tools/generate_shim_headers/generate_shim_headers.py |
756 |
|
757 |
#squidf: since 120_, from Fedora, add correct path for nodejs binary |
758 |
mkdir -p third_party/node/linux/node-linux-x64/bin |
759 |
ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node |
760 |
|
761 |
%build |
762 |
#squidf: esbuild built from source |
763 |
rm third_party/devtools-frontend/src/third_party/esbuild/esbuild |
764 |
%{__tar} -xf %{SOURCE4} |
765 |
pushd esbuild |
766 |
GO_FLAGS="-mod=vendor" make |
767 |
cp -a esbuild ../third_party/devtools-frontend/src/third_party/esbuild/esbuild |
768 |
popd |
769 |
|
770 |
|
771 |
# squidf: from _121, rust is required. From Fedora: |
772 |
# need for error: the option `Z` is only accepted on the nightly compiler |
773 |
export RUSTC_BOOTSTRAP=1 |
774 |
# set rustc version |
775 |
%define _rustc_version %(rustc -V) |
776 |
# set clang version |
777 |
%define _clang_version %(%{_clang_path}/bin/clang --version | sed -n 's/clang version //p' | cut -d. -f1) |
778 |
|
779 |
#squidf: harfbuzz and freetype added back based on other distro spec, but might not be mandatory |
780 |
%define unbundle_list %{?bdl_ffmpeg} %{?bdl_flac} %{?bdl_fontconfig} %{?bdl_webp} %{?bdl_libxml} %{?bdl_xslt} %{?bdl_snappy} %{?bdl_libvpx} %{?bdl_libjpeg} %{?bdl_png} %{?bdl_icu} %{?bdl_minizip} %{?bdl_jsoncpp} %{?bdl_opus} %{?bdl_re2} %{?bdl_drm} %{?bdl_dav1d} %{?bdl_libevent} %{?bdl_freetype} %{?bdl_harfbuzz-ng} %{?bdl_libaom} %{?bdl_libusb} |
781 |
# handled by upstream regular build scripts: freetype harfbuzz-ng |
782 |
# mesa |
783 |
|
784 |
#squidf: From openSUSE: |
785 |
# The proprietary codecs just force the chromium to say they can use it and |
786 |
# offload the actual computation to the ffmpeg, otherwise the chromium |
787 |
# won't be able to load the codec even if the library can handle it => ffmpeg_branding=chrome |
788 |
# v NO TABS IN HERE! |
789 |
%define gn_mga use_sysroot=false \ |
790 |
system_libdir="%{_lib}" \ |
791 |
%{?gn_icu} \ |
792 |
enable_nacl=false \ |
793 |
is_nacl_glibc=false \ |
794 |
custom_toolchain="//build/toolchain/linux/unbundle:default" \ |
795 |
host_toolchain="//build/toolchain/linux/unbundle:default" \ |
796 |
target_os="linux" current_os="linux" \ |
797 |
proprietary_codecs=true \ |
798 |
ffmpeg_branding="Chrome" \ |
799 |
is_component_ffmpeg=true enable_ffmpeg_video_decoders=true media_use_ffmpeg=true \ |
800 |
use_aura=true \ |
801 |
use_cups=true \ |
802 |
linux_link_libudev = true \ |
803 |
linux_link_libspeechd = true \ |
804 |
linux_link_xlib = true \ |
805 |
enable_platform_ac3_eac3_audio = true \ |
806 |
enable_platform_dts_audio = true \ |
807 |
enable_mse_mpeg2ts_stream_parser=true \ |
808 |
enable_platform_hevc=true \ |
809 |
%{?gn_libjpeg} \ |
810 |
use_system_libopenjpeg2=true \ |
811 |
use_libjpeg_turbo=false \ |
812 |
enable_widevine=true \ |
813 |
pdf_enable_xfa=true \ |
814 |
fatal_linker_warnings=false \ |
815 |
use_libpci = true \ |
816 |
use_gio=true use_pulseaudio=true \ |
817 |
link_pulseaudio=true \ |
818 |
rtc_use_pipewire=true \ |
819 |
rtc_link_pipewire=true \ |
820 |
is_debug=false \ |
821 |
%{?gn_clang} \ |
822 |
clang_use_chrome_plugins=false \ |
823 |
%{?gn_lld} \ |
824 |
%{?gn_lto} \ |
825 |
%{?gn_gold} \ |
826 |
%{?gn_freetype} \ |
827 |
%{?gn_harfbuzz} \ |
828 |
%{?gn_libtiff} \ |
829 |
use_system_libpng=true \ |
830 |
use_system_libffi=true \ |
831 |
use_qt6=true \ |
832 |
moc_qt6_path="%{_libdir}/qt6/libexec" \ |
833 |
use_qt=true \ |
834 |
moc_qt5_path="%{_libdir}/qt5/bin" \ |
835 |
enable_dav1d_decoder=true \ |
836 |
%{?gn_custom_libcxx} \ |
837 |
dcheck_always_on=false \ |
838 |
%{?gn_warnings_as_errors} \ |
839 |
google_api_key="%{google_api_key}" \ |
840 |
rust_sysroot_absolute="%{_prefix}" \ |
841 |
rustc_version="%{_rustc_version}" \ |
842 |
clang_base_path="%{_clang_path}" \ |
843 |
clang_version="%{_clang_version}" |
844 |
|
845 |
#squidf:additional arguments: |
846 |
# to use vaapi from Chromium 96 |
847 |
# is_component_build to improve load-time (used by many other distro) |
848 |
# use_gnome_keyring might be deprecated? TO BE MONITORED |
849 |
# is_official_build flags added from Fedora and Arch |
850 |
%define gn_more %{gn_mga} \ |
851 |
%{?gn_vaapi} \ |
852 |
%{?gn_wayland_server} \ |
853 |
%{?gn_wayland_scanner} \ |
854 |
enable_vulkan=true \ |
855 |
is_component_build=false \ |
856 |
disable_fieldtrial_testing_config=true \ |
857 |
use_dbus=true \ |
858 |
is_official_build=true %{?gn_cfi} chrome_pgo_phase=0 \ |
859 |
ignore_missing_widevine_signing_cert=true |
860 |
|
861 |
|
862 |
build/linux/unbundle/replace_gn_files.py --system-libraries %{unbundle_list} |
863 |
third_party/libaddressinput/chromium/tools/update-strings.py |
864 |
|
865 |
%set_build_flags |
866 |
%if %{use_clang} |
867 |
CC=%{_clang_path}/bin/clang; export CC |
868 |
CXX=%{_clang_path}/bin/clang++; export CXX |
869 |
LD=%{_clang_path}/bin/clang++; export LD |
870 |
%else |
871 |
CC=%{__cc}; export CC |
872 |
CXX=%{__cxx}; export CXX |
873 |
LD=%{__cxx}; export LD |
874 |
%endif |
875 |
|
876 |
%if %{without system_llvm} |
877 |
AR=%{_clang_path}/bin/llvm-ar; export AR |
878 |
NM=%{_clang_path}/bin/llvm-nm; export NM |
879 |
%else |
880 |
AR=%{__ar}; export AR |
881 |
NM=%{_bindir}/nm; export NM |
882 |
%endif |
883 |
|
884 |
%if %{use_clang} |
885 |
LDFLAGS="-fuse-ld=lld $LDFLAGS" |
886 |
%else |
887 |
%if %{use_gold} |
888 |
LDFLAGS="-fuse-ld=gold $LDFLAGS" |
889 |
%endif |
890 |
%endif |
891 |
|
892 |
# filter out -g from CFLAGS and CXXFLAGS to fix builds |
893 |
%if %{_enable_debug_packages} |
894 |
%else |
895 |
CFLAGS=$(echo "$CFLAGS"|sed -e 's/-g //') |
896 |
CXXFLAGS=$(echo "$CXXFLAGS"|sed -e 's/-g //') |
897 |
%endif |
898 |
|
899 |
CXXFLAGS="$CXXFLAGS -Wno-attributes -Wno-ignored-attributes" |
900 |
|
901 |
|
902 |
# extra flags to reduce warnings that aren't very useful |
903 |
export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations" |
904 |
# ignore warnings for minor mistakes that are too common |
905 |
export CXXFLAGS="${CXXFLAGS} -Wno-return-type -Wno-parentheses -Wno-misleading-indentation" |
906 |
# ignore warnings due to gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84055) |
907 |
export CXXFLAGS="${CXXFLAGS} -Wno-ignored-attributes" |
908 |
# ingore new gcc 8 warnings that aren't yet handled upstream |
909 |
export CXXFLAGS="${CXXFLAGS} -Wno-address -Wno-dangling-else" |
910 |
# for wayland |
911 |
export CXXFLAGS="${CXXFLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon -I/usr/include/opus" |
912 |
#### end openSUSE flag |
913 |
|
914 |
%if %{use_clang} |
915 |
export CFLAGS="$CFLAGS -Wno-error=unused-result -Wno-unused-but-set-variable" |
916 |
#squidf: all the below flags are from openSUSE |
917 |
export CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument -Wno-unknown-warning-option" |
918 |
export CXXFLAGS="$CXXFLAGS -Wno-error=deprecated-declarations -Wno-error=deprecated-copy -Wno-error=psabi -Wno-error=implicit-const-int-float-conversion -Wno-error=non-c-typedef-for-linkage -Wno-error=unused-const-variable" |
919 |
export CXXFLAGS="${CXXFLAGS} -Wno-invalid-offsetof -fpermissive" |
920 |
%else |
921 |
#squidf:WARNING: so far, building with gcc on Mageia does not work for chromium version higher than 98 |
922 |
export CFLAGS="$CFLAGS -Wno-error=unused-result" |
923 |
%endif |
924 |
|
925 |
%if %{use_custom_libcxx} |
926 |
export CXXFLAGS="${CXXFLAGS} -I%{_builddir}/%{buildsubdir}/buildtools/third_party/libc++ -I%{_builddir}/%{buildsubdir}/buildtools/third_party/libc++/src/include" |
927 |
%endif |
928 |
|
929 |
%if %{use_gold} |
930 |
%ifarch %ix86 |
931 |
LDFLAGS="$LDFLAGS -Wl,--no-keep-files-mapped" |
932 |
%endif |
933 |
%else |
934 |
LDFLAGS="$LDFLAGS -fno-use-linker-plugin" |
935 |
%endif |
936 |
|
937 |
# for debugging: |
938 |
%if %{_enable_debug_packages} |
939 |
CFLAGS="$(echo $CFLAGS|sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-D_FORTIFY_SOURCE=2//') -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -gdwarf64" |
940 |
CXXFLAGS="$(echo $CXXFLAGS|sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-D_FORTIFY_SOURCE=2//') -Og -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wno-error=return-type -gdwarf64" |
941 |
%endif |
942 |
|
943 |
%ifarch %{ix86} |
944 |
CFLAGS="$CFLAGS -msse2" |
945 |
CXXFLAGS="$CXXFLAGS -msse2" |
946 |
%endif |
947 |
|
948 |
# Let Chromium set its own symbol level |
949 |
CFLAGS=${CFLAGS/-g } |
950 |
CXXFLAGS=${CXXFLAGS/-g } |
951 |
|
952 |
# https://github.com/ungoogled-software/ungoogled-chromium-archlinux/issues/123 |
953 |
CFLAGS=${CFLAGS/-fexceptions} |
954 |
CFLAGS=${CFLAGS/-fcf-protection} |
955 |
CXXFLAGS=${CXXFLAGS/-fexceptions} |
956 |
CXXFLAGS=${CXXFLAGS/-fcf-protection} |
957 |
|
958 |
# This appears to cause random segfaults when combined with ThinLTO |
959 |
# https://bugs.archlinux.org/task/73518 |
960 |
CFLAGS=${CFLAGS/-fstack-clash-protection} |
961 |
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection} |
962 |
|
963 |
# https://crbug.com/957519#c122 |
964 |
CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS} |
965 |
|
966 |
python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_more}' |
967 |
|
968 |
out/Release/gn gen --args='%{gn_more}' out/Release |
969 |
|
970 |
|
971 |
%if !%{use_gold} |
972 |
# ld.bfd needs lots of file descriptors to link chrome |
973 |
ulimit -n 4096 |
974 |
%endif |
975 |
|
976 |
|
977 |
%ninja_build -C out/Release chrome chrome_sandbox |
978 |
|
979 |
|
980 |
# man page |
981 |
sed -e "s/@@PACKAGE@@/chromium/" -e "s/@@MENUNAME@@/Chromium Web Browser/" chrome/app/resources/manpage.1.in >out/Release/chromium.1 |
982 |
|
983 |
%install |
984 |
mkdir -p %{buildroot}%{_bindir} |
985 |
mkdir -p %{buildroot}%{_crdir}/locales |
986 |
mkdir -p %{buildroot}%{_crdir}/themes |
987 |
mkdir -p %{buildroot}%{_crdir}/MEIPreload |
988 |
mkdir -p %{buildroot}%{_mandir}/man1 |
989 |
|
990 |
#squidf: add master_preferences to prevent default browser check banner, at first |
991 |
%{__install} -m 644 %{SOURCE13} %{buildroot}%{_crdir}/master_preferences |
992 |
#squidf: install chromium-wrapper from source1 |
993 |
install -m 755 %{SOURCE1} %{buildroot}%{_crdir}/ |
994 |
install -m 755 out/Release/chrome %{buildroot}%{_crdir}/ |
995 |
#squidf Explicitly strip since we don't use debuginfo here anyway |
996 |
strip %{buildroot}%{_crdir}/chrome |
997 |
install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_crdir}/chrome-sandbox |
998 |
strip %{buildroot}%{_crdir}/chrome-sandbox |
999 |
install -m 644 out/Release/chromium.1 %{buildroot}%{_mandir}/man1/%{crname}.1 |
1000 |
install -m 644 out/Release/chrome_100_percent.pak %{buildroot}%{_crdir}/ |
1001 |
install -m 644 out/Release/chrome_200_percent.pak %{buildroot}%{_crdir}/ |
1002 |
install -m 644 out/Release/resources.pak %{buildroot}%{_crdir}/ |
1003 |
install -m 644 out/Release/snapshot_blob.bin %{buildroot}%{_crdir}/ |
1004 |
install -m 755 out/Release/mksnapshot %{buildroot}%{_crdir}/ |
1005 |
install -m 755 out/Release/chrome_crashpad_handler %{buildroot}%{_crdir}/ |
1006 |
strip %{buildroot}%{_crdir}/chrome_crashpad_handler |
1007 |
install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/ |
1008 |
install -m 644 out/Release/v8_context_snapshot.bin %{buildroot}%{_crdir}/ |
1009 |
install -m 755 out/Release/libEGL.so %{buildroot}%{_crdir}/ |
1010 |
strip %{buildroot}%{_crdir}/libEGL.so |
1011 |
install -m 755 out/Release/libGLESv2.so %{buildroot}%{_crdir}/ |
1012 |
strip %{buildroot}%{_crdir}/libGLESv2.so |
1013 |
install -m 755 out/Release/libVk*.so %{buildroot}%{_crdir}/ |
1014 |
install -m 755 out/Release/libvk_swiftshader.so %{buildroot}%{_crdir}/ |
1015 |
|
1016 |
%ifarch x86_64 |
1017 |
install -m 755 out/Release/libvulkan.so.1 %{buildroot}%{_crdir} |
1018 |
install -m 755 out/Release/vk_swiftshader_icd.json %{buildroot}%{_crdir} |
1019 |
%endif |
1020 |
|
1021 |
#squidf: fix "use qt" button |
1022 |
%{__install} -m 755 out/Release/libqt5_shim.so %{buildroot}%{_crdir}/ |
1023 |
strip %{buildroot}%{_crdir}/libqt5_shim.so |
1024 |
%{__install} -m 755 out/Release/libqt6_shim.so %{buildroot}%{_crdir}/ |
1025 |
strip %{buildroot}%{_crdir}/libqt6_shim.so |
1026 |
|
1027 |
install -m 644 out/Release/MEIPreload/* %{buildroot}%{_crdir}/MEIPreload/ |
1028 |
ln -s %{_crdir}/chromium-wrapper %{buildroot}%{_bindir}/%{crname} |
1029 |
|
1030 |
find out/Release/resources/ -name "*.d" -exec rm {} \; |
1031 |
cp -r out/Release/resources %{buildroot}%{_crdir} |
1032 |
|
1033 |
# desktop file |
1034 |
mkdir -p %{buildroot}%{_datadir}/applications |
1035 |
install -m 644 %{_sourcedir}/%{crname}.desktop %{buildroot}%{_datadir}/applications/ |
1036 |
|
1037 |
%if %{system_icu} |
1038 |
# symlink to ICU data file |
1039 |
ICUDATADIR=$(icuinfo | grep \"icudata.path\" | sed -re 's/^.*>(.*)<.*$/\1/') |
1040 |
ICUDATANAME=$(icuinfo | grep \"icudata.name\" | sed -re 's/^.*>(.*)<.*$/\1/') |
1041 |
ICUDATAFILE=$(realpath --relative-to=%{_crdir}/ ${ICUDATADIR}/${ICUDATANAME}.dat) |
1042 |
ln -s ${ICUDATAFILE} %{buildroot}%{_crdir}/icudtl.dat |
1043 |
%else |
1044 |
%{__install} -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/ |
1045 |
%endif |
1046 |
|
1047 |
# icon |
1048 |
for i in 24 48 64 128 256; do |
1049 |
%{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps |
1050 |
%{__install} -m 644 chrome/app/theme/chromium/product_logo_$i.png %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/%{crname}.png |
1051 |
done |
1052 |
%{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/32x32/apps |
1053 |
%{__install} -m 644 chrome/app/theme/chromium/linux/product_logo_32.xpm %{buildroot}%{_iconsdir}/hicolor/32x32/apps/%{crname}.xpm |
1054 |
%{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/scalable/apps |
1055 |
%{__install} -m 644 chrome/app/theme/chromium/product_logo.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps/%{crname}.svg |
1056 |
|
1057 |
%files -n chromium-browser |
1058 |
|
1059 |
%files |
1060 |
%{_bindir}/%{crname} |
1061 |
%dir %{_crdir} |
1062 |
%{_crdir}/chromium-wrapper |
1063 |
%{_crdir}/chrome |
1064 |
%attr(4755,root,root) %{_crdir}/chrome-sandbox |
1065 |
%{_crdir}/icudtl.dat |
1066 |
%{_crdir}/locales |
1067 |
%{_crdir}/master_preferences |
1068 |
%{_crdir}/snapshot_blob.bin |
1069 |
%{_crdir}/v8_context_snapshot.bin |
1070 |
%{_crdir}/resources.pak |
1071 |
%{_crdir}/resources |
1072 |
%{_crdir}/chrome_100_percent.pak |
1073 |
%{_crdir}/chrome_200_percent.pak |
1074 |
%{_crdir}/mksnapshot |
1075 |
%{_crdir}/chrome_crashpad_handler |
1076 |
%{_crdir}/themes |
1077 |
%{_crdir}/libEGL.so |
1078 |
%{_crdir}/libGLESv2.so |
1079 |
%{_crdir}/libVk*.so |
1080 |
%{_crdir}/libvk_swiftshader.so |
1081 |
%{_crdir}/libqt5_shim.so |
1082 |
%{_crdir}/libqt6_shim.so |
1083 |
%ifarch x86_64 |
1084 |
%{_crdir}/libvulkan.so* |
1085 |
%{_crdir}/vk_swiftshader_icd.json |
1086 |
%endif |
1087 |
%{_mandir}/man1/%{crname}* |
1088 |
%{_datadir}/applications/*.desktop |
1089 |
%{_iconsdir}/hicolor/*/apps/%{crname}.png |
1090 |
%{_iconsdir}/hicolor/*/apps/%{crname}.xpm |
1091 |
%{_iconsdir}/hicolor/scalable/apps/%{crname}.svg |
1092 |
%{_crdir}/MEIPreload |
1093 |
|
1094 |
|