-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromium.spec
3366 lines (2621 loc) · 112 KB
/
chromium.spec
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%define _lto_cflags %{nil}
# enable|disable system build flags
%global system_build_flags 0
# set default numjobs for the koji build
%ifarch aarch64
%global numjobs 8
%else
%global numjobs %{_smp_build_ncpus}
%endif
# enable|disable all cpus for the build.
%global use_all_cpus 1
%if %{use_all_cpus}
%global numjobs %{_smp_build_ncpus}
%endif
# official builds have less debugging and go faster... but we have to shut some things off.
%global official_build 1
# enable|disble bootstrap
%global bootstrap 0
# workaround for broken gn on epel 8/9
%if 0%{?rhel} == 8 || 0%{?rhel} == 9
%global bootstrap 1
%endif
# Fancy build status, so we at least know, where we are..
# %1 where
# %2 what
%global build_target() \
export NINJA_STATUS="[%2:%f/%t] " ; \
ninja -j %{numjobs} -C '%1' '%2'
# enable|disable headless client build
%global build_headless 1
# enable|disable chrome-remote-desktop build
%global build_remoting 0
# set nodejs_version
%global nodejs_version v20.6.1
%global system_nodejs 1
# RHEL 8 needs newer nodejs
%if 0%{?rhel} == 8
%global system_nodejs 0
%endif
# set esbuild_version
%global esbuild_version 0.19.2
# set latest version for devtoolset and gcc-toolset
%global dts_version 12
%if 0%{?rhel} == 8 || 0%{?rhel} == 9
%global dts_version 13
%endif
# set latest version for llvm-toolset on el7
%global llvm_toolset_version 14.0
# set name for toolset
%if 0%{?rhel} == 7
%global toolset devtoolset
%else
%global toolset gcc-toolset
%endif
%if 0%{?rhel} == 7
%global chromium_pybin /usr/bin/python3
%else
%global chromium_pybin %{__python3}
%endif
# va-api only supported in rhel >= 9 and fedora
%global use_vaapi 1
# v4l2_codec only enable for fedora aarch64
%global use_v4l2_codec 0
# libva in EL7 and EL8 is too old.
%if 0%{?rhel} == 7 || 0%{?rhel} == 8
%global use_vaapi 0
%endif
# enable v4l2 and disable vaapi for aarch64 platform
%ifarch aarch64
%if 0%{?fedora} >= 36
%global use_vaapi 0
%global use_v4l2_codec 1
%endif
%endif
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523
# Disable BTI until this is fixed upstream.
%global disable_bti 0
%ifarch aarch64
%if 0%{?fedora}
%global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /')
%global disable_bti 1
%endif
%endif
# Seems like we might need this sometimes
# Practically, no. But it's here in case we do.
%global use_gold 0
%global build_clear_key_cdm 0
# Disabled because of Google, starting with Chromium 88.
%global userestrictedapikeys 0
# We can still use the api key though. For now.
%global useapikey 1
# Leave this alone, please.
%global builddir out/Release
%global headlessbuilddir out/Headless
%global remotingbuilddir out/Remoting
# enable|disable debuginfo
%global enable_debug 1
# disable debuginfo due to a bug in debugedit on el7
# error: canonicalization unexpectedly shrank by one character
# https://bugzilla.redhat.com/show_bug.cgi?id=304121
%if 0%{?rhel} == 7
%global enable_debug 0
%endif
%if ! %{enable_debug}
%global debug_package %{nil}
%global debug_level 0
%else
%global debug_level 1
# workaround for the error empty file debugsource
%undefine _debugsource_packages
%endif
# %%{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 crd_path %{_libdir}/chrome-remote-desktop
# We don't want any libs in these directories to generate Provides
# Requires is trickier.
# To generate this list, go into %%{buildroot}%%{chromium_path} and run
# for i in `find . -name "*.so" | sort`; do NAME=`basename -s .so $i`; printf "$NAME|"; done
# for RHEL7, append libfontconfig to the end
# make sure there is not a trailing | at the end of the list
# We always filter provides. We only filter Requires when building shared.
%global __provides_exclude_from ^(%{chromium_path}/.*\\.so|%{chromium_path}/.*\\.so.*)$
%global __requires_exclude ^(%{chromium_path}/.*\\.so|%{chromium_path}/.*\\.so.*)$
# enable|disable use_custom_libcxx
%global use_custom_libcxx 1
# enable clang by default
%global clang 1
# enable|disable control flow integrity support
%global cfi 0
%if %{clang}
%if 0%{?fedora} || 0%{?rhel} > 7
%global cfi 1
%endif
%endif
# set correct toolchain
%if %{clang}
%global toolchain clang
%else
%global toolchain gcc
%endif
# enable qt backend for el >= 8 and fedora
%if 0%{?rhel} >= 8 || 0%{?fedora}
%global use_qt 1
%else
%global use_qt 0
%endif
%if 0%{?rhel} > 9 || 0%{?fedora}
%global use_qt6 1
%else
%global use_qt6 0
%endif
# enable gtk3 by default
%global gtk3 1
# Chromium's fork of ICU is now something we can't unbundle.
# This is left here to ease the change if that ever switches.
%global bundleicu 1
# system libre2.so is not supported with use_custom_libcxx=true
# because the library's interface relies on libstdc++'s std::string and std::vector.
%global bundlere2 1
# The libxml_utils code depends on the specific bundled libxml checkout
# which is not compatible with the current code in the Fedora package as of
# 2017-06-08.
%global bundlelibxml 1
%global bundlelibaom 1
# Fedora's Python 2 stack is being removed, we use the bundled Python libraries
# This can be revisited once we upgrade to Python 3
%global bundlepylibs 0
# RHEL 7.9 dropped minizip.
# enable bundleminizip for Fedora > 39 due to switch to minizip-ng
# which breaks the build
%global bundleminizip 0
%if 0%{?rhel} == 7 || 0%{?fedora} > 39
%global bundleminizip 1
%endif
%if 0%{?rhel} == 7 || 0%{?rhel} == 8
%global bundleopus 1
%global bundlelibusbx 1
%global bundleharfbuzz 1
%global bundlelibwebp 1
%global bundlelibpng 1
%global bundlelibjpeg 1
%global bundlefreetype 1
%global bundlelibdrm 1
%global bundlefontconfig 1
%global bundleffmpegfree 1
%global bundlebrotli 1
%else
%if 0%{?fedora} > 37
%global bundleharfbuzz 0
%else
%global bundleharfbuzz 1
%endif
# disable system brotli due to old system brotli on el and fedora < 38
%if 0%{?fedora} > 38
%global bundlebrotli 0
%else
%global bundlebrotli 1
%endif
%global bundleopus 0
%global bundlelibusbx 0
%global bundlelibwebp 0
%global bundlelibpng 0
%global bundlelibjpeg 0
%global bundlelibdrm 0
%global bundlefontconfig 0
%global bundleffmpegfree 0
%global bundlefreetype 0
%endif
### From 2013 until early 2021, Google permitted distribution builds of
### Chromium to access Google APIs that added significant features to
### Chromium including, but not limited to, Sync and geolocation.
### As of March 15, 2021, any Chromium builds which pass client_id and/or
### client_secret during build will prevent end-users from signing into their
### Google account.
### With Chromium 88, I have removed the calls to "google_default_client_id"
### and "google_default_client_secret" to comply with their changes.
### Honestly, at this point, you might be better off looking for a different
### FOSS browser.
### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
### Note: These are for Fedora use ONLY.
### For your own distribution, please get your own set of keys.
### http://lists.debian.org/debian-legal/2013/11/msg00006.html
%if %{useapikey}
%global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw
%else
%global api_key %nil
%endif
%if %{userestrictedapikeys}
%global default_client_id 449907151817.apps.googleusercontent.com
%global default_client_secret miEreAep8nuvTdvLums6qyLK
%global chromoting_client_id 449907151817-8vnlfih032ni8c4jjps9int9t86k546t.apps.googleusercontent.com
%else
%global default_client_id %nil
%global default_client_secret %nil
%global chromoting_client_id %nil
%endif
Name: chromium%{chromium_channel}
Version: 122.0.6238.2
Release: 1%{?dist}
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home
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)
### Chromium Fedora Patches ###
Patch0: chromium-70.0.3538.67-sandbox-pie.patch
# Use /etc/chromium for initial_prefs
Patch1: chromium-115-initial_prefs-etc-path.patch
# system libusb
Patch2: chromium-120-system-libusb.patch
# Do not mangle zlib
Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch
# Do not use unrar code, it is non-free
Patch6: chromium-119-norar.patch
# Try to load widevine from other places
Patch8: chromium-117-widevine-other-locations.patch
# Tell bootstrap.py to always use the version of Python we specify
Patch11: chromium-93.0.4577.63-py3-bootstrap.patch
# Add "Fedora" to the user agent string
Patch12: chromium-101.0.4951.41-fedora-user-agent.patch
# debian patch, disable font-test
Patch20: chromium-disable-font-tests.patch
# https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch
Patch52: chromium-81.0.4044.92-unbundle-zlib.patch
# Fix headers to look for system paths when we are using system minizip
Patch61: chromium-119-system-minizip-header-fix.patch
# Fix issue where closure_compiler thinks java is only allowed in android builds
# https://bugs.chromium.org/p/chromium/issues/detail?id=1192875
Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch
# Update rjsmin to 1.2.0
Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch
# Update six to 1.16.0
Patch70: chromium-105.0.5195.52-python-six-1.16.0.patch
# Disable tests on remoting build
Patch82: chromium-98.0.4758.102-remoting-no-tests.patch
# patch for using system brotli
Patch89: chromium-116-system-brotli.patch
# disable GlobalMediaControlsCastStartStop to avoid crash
# when using the address bar media player button
# it works with use_custom_libcxx=true
Patch90: chromium-120-disable-GlobalMediaControlsCastStartStop.patch
# patch for using system opus
Patch91: chromium-108-system-opus.patch
# need to explicitly include a kernel header on EL7 to support MFD_CLOEXEC, F_SEAL_SHRINK, F_ADD_SEALS, F_SEAL_SEAL
Patch100: chromium-116-el7-include-fcntl-memfd.patch
# add define HAVE_STRNDUP on epel7
Patch101: chromium-108-el7-wayland-strndup-error.patch
# Work around old and missing headers on EPEL7
Patch103: chromium-110-epel7-old-headers-workarounds.patch
# Use old cups (chromium's code workaround breaks on gcc)
# Revert: https://github.com/chromium/chromium/commit/c3213f8779ddc427e89d982514185ed5e4c94e91
Patch104: chromium-99.0.4844.51-epel7-old-cups.patch
# libdrm on EL7 is rather old and chromium assumes newer
# This gets us by for now
Patch105: chromium-120-el7-old-libdrm.patch
# error: no matching function for call to 'std::basic_string<char>::erase(std::basic_string<char>::const_iterator, __gnu_cxx::__normal_iterator<const char*, std::basic_string<char> >&)'
# 33 | property_name.erase(property_name.cbegin(), cur);
# Not sure how this EVER worked anywhere, but it only seems to fail on EPEL-7.
Patch106: chromium-98.0.4758.80-epel7-erase-fix.patch
# Add additional operator== to make el7 happy.
Patch107: chromium-120-el7-extra-operator.patch
# old v4l2 on el7
Patch108: chromium-118-el7_v4l2_quantization.patch
# workaround for clang bug on el7
Patch109: chromium-114-wireless-el7.patch
Patch110: chromium-115-buildflag-el7.patch
Patch111: chromium-116-constexpr.patch
Patch112: chromium-117-el7-default_constructor.patch
# old clang on el7
Patch113: chromium-120-el7-clang-version-warning.patch
Patch114: chromium-120-el7-clang-build-failure.patch
# system ffmpeg
# need for old ffmpeg 5.x on epel9 and fedora 37
Patch115: chromium-107-ffmpeg-5.x-duration.patch
# disable the check
Patch116: chromium-107-proprietary-codecs.patch
# fix tab crash with SIGTRAP error when using system ffmpeg
Patch117: chromium-118-sigtrap_system_ffmpeg.patch
# revert AV1 VAAPI video encode due to old libva on el9
Patch130: chromium-119-revert-av1enc-el9.patch
# file conflict with old kernel on el8/el9
Patch140: chromium-118-dma_buf_export_sync_file-conflict.patch
# fixes for old clang version in fedora < 38 end epel < 8 (old clang <= 15)
# compiler build errors, no matching constructor for initialization
Patch300: chromium-120-no_matching_constructor.patch
Patch301: chromium-115-compiler-SkColor4f.patch
# workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826
Patch302: chromium-120-workaround_clang_bug-structured_binding.patch
# missing typename
Patch303: chromium-120-typename.patch
# error: invalid operands to binary expression
Patch304: chromium-117-string-convert.patch
Patch306: chromium-119-assert.patch
# disable memory tagging in epel7 and epel8 on aarch64 due to new feature IFUNC-Resolver
# not supported in old glibc < 2.30, error: fatal error: 'sys/ifunc.h' file not found
Patch307: chromium-120-arm64-memory_tagging.patch
# missing include header files
Patch310: chromium-120-missing-header-files.patch
# clang warnings
Patch311: chromium-115-clang-warnings.patch
# enable fstack-protector-strong
Patch312: chromium-119-fstack-protector-strong.patch
# build error
Patch351: chromium-117-mnemonic-error.patch
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523
# https://bugs.chromium.org/p/chromium/issues/detail?id=1145581#c60
# Disable BTI until this is fixed upstream.
Patch352: chromium-117-workaround_for_crash_on_BTI_capable_system.patch
# gn workaround for the error: Assignment had no effect
Patch353: chromium-120-gn-workaround-atspi.patch
# remove flag split-threshold-for-reg-with-hint, it' not supported in clang <= 17
Patch354: chromium-120-split-threshold-for-reg-with-hint.patch
# error: unknown type name 'nullptr_t'
Patch355: chromium-120-nullptr_t-without-namespace-std.patch
# disable FFmpegAllowLists by default to allow external ffmpeg
patch356: chromium-120-disable-FFmpegAllowLists.patch
# remove ldflags -Wl,-mllvm,-disable-auto-upgrade-debug-info which is not supported
Patch357: chromium-120-clang16-disable-auto-upgrade-debug-info.patch
# upstream patches
# Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
# http://build.chromium.org/buildbot/official/
# For Chromium Fedora use chromium-latest.py --stable --ffmpegclean --ffmpegarm
# If you want to include the ffmpeg arm sources append the --ffmpegarm switch
# 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
Source4: %{chromium_browser_channel}.desktop
# Also, only used if you want to reproduce the clean tarball.
Source5: clean_ffmpeg.sh
Source6: chromium-latest.py
Source7: get_free_ffmpeg_source_files.py
# Get the names of all tests (gtests) for Linux
# Usage: get_linux_tests_name.py chromium-%%{version} --spec
Source8: get_linux_tests_names.py
# GNOME stuff
Source9: chromium-browser.xml
Source10: chrome-remote-desktop@.service
Source11: master_preferences
%if ! %{system_nodejs}
Source12: https://nodejs.org/dist/%{nodejs_version}/node-%{nodejs_version}-linux-x64.tar.xz
Source13: https://nodejs.org/dist/%{nodejs_version}/node-%{nodejs_version}-linux-arm64.tar.xz
%endif
# esbuild binary
%if 0%{?rhel}
Source14: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-%{esbuild_version}.tgz
Source15: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-%{esbuild_version}.tgz
%endif
# esbuild binary from fedora
%if 0%{?fedora}
BuildRequires: golang-github-evanw-esbuild
%endif
%if %{clang}
%if 0%{?rhel} == 7
BuildRequires: llvm-toolset-%{llvm_toolset_version}
%else
BuildRequires: clang
BuildRequires: clang-tools-extra
BuildRequires: llvm
BuildRequires: lld
%endif
# needs for libatomic
%if 0%{?rhel} >= 7
BuildRequires: %{toolset}-%{dts_version}-libatomic-devel
%endif
%else
%if 0%{?rhel} == 7 || 0%{?rhel} == 8
BuildRequires: %{toolset}-%{dts_version}-binutils, %{toolset}-%{dts_version}-libatomic-devel
%endif
%if 0%{?fedora} || 0%{?rhel} > 8
BuildRequires: gcc-c++
BuildRequires: gcc
BuildRequires: binutils
%endif
%endif
# build with system ffmpeg-free
%if ! %{bundleffmpegfree}
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
# chromium fail to start for rpmfusion users due to ABI break in ffmpeg-free-6.0.1
# bethween fedora and rpmfussion.
%if 0%{?rhel} == 9 || 0%{?fedora} == 37
Conflicts: libavformat-free%{_isa} < 5.1.4
Conflicts: ffmpeg-libs%{_isa} < 5.1.4
%else
Conflicts: libavformat-free%{_isa} < 6.0.1
Conflicts: ffmpeg-libs%{_isa} < 6.0.1-2
%endif
%endif
# build with system libaom
%if ! %{bundlelibaom}
BuildRequires: libaom-devel
%endif
BuildRequires: alsa-lib-devel
BuildRequires: atk-devel
BuildRequires: bison
BuildRequires: cups-devel
BuildRequires: dbus-devel
BuildRequires: desktop-file-utils
BuildRequires: expat-devel
BuildRequires: flex
BuildRequires: fontconfig-devel
BuildRequires: glib2-devel
BuildRequires: glibc-devel
BuildRequires: gperf
%if %{use_qt}
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Widgets)
%endif
%if %{use_qt6}
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6Widgets)
%endif
%if %{cfi}
BuildRequires: compiler-rt
%endif
%if ! %{bundleharfbuzz}
BuildRequires: harfbuzz-devel >= 2.4.0
%endif
BuildRequires: libatomic
BuildRequires: libcap-devel
BuildRequires: libcurl-devel
%if ! %{bundlelibdrm}
BuildRequires: libdrm-devel
%endif
BuildRequires: libgcrypt-devel
BuildRequires: libudev-devel
BuildRequires: libuuid-devel
%if 0%{?fedora} >= 37
BuildRequires: libusb-compat-0.1-devel
%else
BuildRequires: libusb-devel
%endif
BuildRequires: libutempter-devel
BuildRequires: libXdamage-devel
BuildRequires: libXtst-devel
BuildRequires: xcb-proto
BuildRequires: mesa-libgbm-devel
# Old Fedora (before 30) uses the 1.2 minizip by default.
# Newer Fedora needs to use the compat package
# Fedora > 39 uses minizip-ng
%if ! %{bundleminizip}
%if 0%{?fedora} > 39 || 0%{?rhel} > 9
# BuildRequires: minizip-ng-devel
BuildRequires: minizip-compat-devel
%else
BuildRequires: minizip-compat-devel
%endif
%endif
%if %{system_nodejs}
BuildRequires: nodejs
%endif
%if ! %{bootstrap}
BuildRequires: gn
%endif
BuildRequires: nss-devel >= 3.26
BuildRequires: pciutils-devel
BuildRequires: pulseaudio-libs-devel
# For screen sharing on Wayland
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: pkgconfig(libpipewire-0.3)
%endif
# for /usr/bin/appstream-util
BuildRequires: libappstream-glib
%if %{bootstrap}
# gn needs these
BuildRequires: libstdc++-static
%endif
# Fedora tries to use system libs whenever it can.
BuildRequires: bzip2-devel
BuildRequires: dbus-glib-devel
# For eu-strip
BuildRequires: elfutils
BuildRequires: elfutils-libelf-devel
BuildRequires: flac-devel
%if ! %{bundlefreetype}
BuildRequires: freetype-devel
%endif
# One of the python scripts invokes git to look for a hash. So helpful.
BuildRequires: /usr/bin/git
BuildRequires: hwdata
BuildRequires: kernel-headers
BuildRequires: libevent-devel
BuildRequires: libffi-devel
%if ! %{bundleicu}
# If this is true, we're using the bundled icu.
# We'd like to use the system icu every time, but we cannot always do that.
# Not newer than 54 (at least not right now)
BuildRequires: libicu-devel = 54.1
%endif
%if ! %{bundlelibjpeg}
# If this is true, we're using the bundled libjpeg
# which we need to do because the RHEL 7 libjpeg doesn't work for chromium anymore
BuildRequires: libjpeg-devel
%endif
%if ! %{bundlelibpng}
# If this is true, we're using the bundled libpng
# which we need to do because the RHEL 7 libpng doesn't work right anymore
BuildRequires: libpng-devel
%endif
BuildRequires: libudev-devel
%if ! %{bundlelibusbx}
Requires: libusbx >= 1.0.21-0.1.git448584a
BuildRequires: libusbx-devel >= 1.0.21-0.1.git448584a
%endif
%if %{use_vaapi}
BuildRequires: libva-devel
%endif
# We don't use libvpx anymore because Chromium loves to
# use bleeding edge revisions here that break other things
# ... so we just use the bundled libvpx.
%if ! %{bundlelibwebp}
BuildRequires: libwebp-devel
%endif
BuildRequires: libxslt-devel
BuildRequires: libxshmfence-devel
# Same here, it seems.
# BuildRequires: libyuv-devel
BuildRequires: mesa-libGL-devel
%if ! %{bundleopus}
BuildRequires: opus-devel
%endif
BuildRequires: perl(Switch)
BuildRequires: %{chromium_pybin}
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: python3-devel
BuildRequires: python3-zipp
BuildRequires: python3-simplejson
BuildRequires: python3-importlib-metadata
%if 0%{?rhel} == 7 || 0%{?rhel} == 8
BuildRequires: python3-dataclasses
%endif
%if ! %{bundlepylibs}
%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: python3-beautifulsoup4
BuildRequires: python3-html5lib
BuildRequires: python3-markupsafe
BuildRequires: python3-ply
BuildRequires: python3-jinja2
%else
BuildRequires: python-beautifulsoup4
BuildRequires: python-html5lib
BuildRequires: python-markupsafe
BuildRequires: python-ply
BuildRequires: python-jinja2
%endif
%endif
%if ! %{bundlere2}
Requires: re2 >= 20160401
BuildRequires: re2-devel >= 20160401
%endif
%if ! %{bundlebrotli}
BuildRequires: brotli-devel
%endif
BuildRequires: speech-dispatcher-devel
BuildRequires: yasm
BuildRequires: zlib-devel
# remote desktop needs this
BuildRequires: pam-devel
BuildRequires: systemd
# using the built from source version on aarch64
BuildRequires: ninja-build
# Yes, java is needed as well..
%if %{build_headless}
BuildRequires: java-1.8.0-openjdk-headless
%endif
BuildRequires: libevdev-devel
# There is a hardcoded check for nss 3.26 in the chromium code (crypto/nss_util.cc)
Requires: nss%{_isa} >= 3.26
Requires: nss-mdns%{_isa}
# GTK modules it expects to find for some reason.
%if %{gtk3}
Requires: libcanberra-gtk3%{_isa}
%else
Requires: libcanberra-gtk2%{_isa}
%endif
%if 0%{?fedora}
# This enables support for u2f tokens
Requires: u2f-hidraw-policy
%endif
Requires: chromium-common%{_isa} = %{version}-%{release}
# rhel 7: x86_64
# rhel 8+ and fedora 37+: x86_64 aarch64
%if 0%{?rhel} == 7
ExclusiveArch: x86_64
%else
ExclusiveArch: x86_64 aarch64
%endif
# Bundled bits (I'm sure I've missed some)
Provides: bundled(angle) = 2422
Provides: bundled(bintrees) = 1.0.1
# This is a fork of openssl.
Provides: bundled(boringssl)
%if %{bundlebrotli}
Provides: bundled(brotli) = 222564a95d9ab58865a096b8d9f7324ea5f2e03e
%endif
Provides: bundled(bspatch)
Provides: bundled(cacheinvalidation) = 20150720
Provides: bundled(colorama) = 799604a104
Provides: bundled(crashpad)
Provides: bundled(dmg_fp)
Provides: bundled(expat) = 2.2.0
Provides: bundled(fdmlibm) = 5.3
# Don't get too excited. MPEG and other legally problematic stuff is stripped out.
%if %{bundleffmpegfree}
Provides: bundled(ffmpeg) = 6.0
%endif
%if %{bundlelibaom}
Provides: bundled(libaom)
%endif
Provides: bundled(fips181) = 2.2.3
%if %{bundlefontconfig}
Provides: bundled(fontconfig) = 2.12.6
%endif
%if %{bundlefreetype}
Provides: bundled(freetype) = 2.11.0git
%endif
Provides: bundled(gperftools) = svn144
%if %{bundleharfbuzz}
Provides: bundled(harfbuzz) = 2.4.0
%endif
Provides: bundled(hunspell) = 1.6.0
Provides: bundled(iccjpeg)
%if %{bundleicu}
Provides: bundled(icu) = 58.1
%endif
Provides: bundled(kitchensink) = 1
Provides: bundled(leveldb) = 1.20
Provides: bundled(libaddressinput) = 0
%if %{bundlelibdrm}
Provides: bundled(libdrm) = 2.4.85
%endif
Provides: bundled(libevent) = 1.4.15
Provides: bundled(libjingle) = 9564
%if %{bundlelibjpeg}
Provides: bundled(libjpeg-turbo) = 1.4.90
%endif
Provides: bundled(libphonenumber) = a4da30df63a097d67e3c429ead6790ad91d36cf4
%if %{bundlelibpng}
Provides: bundled(libpng) = 1.6.22
%endif
Provides: bundled(libsrtp) = 2cbd85085037dc7bf2eda48d4cf62e2829056e2d
%if %{bundlelibusbx}
Provides: bundled(libusbx) = 1.0.17
%endif
Provides: bundled(libvpx) = 1.6.0
%if %{bundlelibwebp}
Provides: bundled(libwebp) = 0.6.0
%endif
%if %{bundlelibxml}
# Well, it's actually newer than 2.9.4 and has code in it that has been reverted upstream... but eh.
Provides: bundled(libxml) = 2.9.4
%endif
Provides: bundled(libXNVCtrl) = 302.17
Provides: bundled(libyuv) = 1651
Provides: bundled(lzma) = 15.14
Provides: bundled(libudis86) = 1.7.1
Provides: bundled(mesa) = 9.0.3
Provides: bundled(NSBezierPath) = 1.0
Provides: bundled(mozc)
%if %{bundleopus}
Provides: bundled(opus) = 1.1.3
%endif
Provides: bundled(ots) = 8d70cffebbfa58f67a5c3ed0e9bc84dccdbc5bc0
Provides: bundled(protobuf) = 3.0.0.beta.3
Provides: bundled(qcms) = 4
%if %{bundlere2}
Provides: bundled(re2)
%endif
Provides: bundled(sfntly) = 04740d2600193b14aa3ef24cd9fbb3d5996b9f77
Provides: bundled(skia)
Provides: bundled(SMHasher) = 0
Provides: bundled(snappy) = 1.1.4-head
Provides: bundled(speech-dispatcher) = 0.7.1
Provides: bundled(sqlite) = 3.17patched
Provides: bundled(superfasthash) = 0
Provides: bundled(talloc) = 2.0.1
Provides: bundled(usrsctp) = 0
Provides: bundled(v8) = 5.9.211.31
Provides: bundled(webrtc) = 90usrsctp
Provides: bundled(woff2) = 445f541996fe8376f3976d35692fd2b9a6eedf2d
Provides: bundled(xdg-mime)
Provides: bundled(xdg-user-dirs)
# Provides: bundled(zlib) = 1.2.11
# For selinux scriptlet
Requires(post): /usr/sbin/semanage
Requires(post): /usr/sbin/restorecon
%description
Chromium is an open-source web browser, powered by WebKit (Blink).
%package common
Summary: Files needed for both the headless_shell and full Chromium
# -common doesn't have chrome-remote-desktop bits
# but we need to clean it up if it gets disabled again
# NOTE: Check obsoletes version to be sure it matches
%if ! %{build_remoting}
Provides: chrome-remote-desktop = %{version}-%{release}
Obsoletes: chrome-remote-desktop <= 81.0.4044.138
%endif
%description common
%{summary}.
%if %{build_remoting}
%package -n chrome-remote-desktop
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires: xorg-x11-server-Xvfb
Requires: python3-psutil
Requires: chromium-common%{_isa} = %{version}-%{release}
Summary: Remote desktop support for google-chrome & chromium
%description -n chrome-remote-desktop
Remote desktop support for google-chrome & chromium.
%endif
%package -n chromedriver
Summary: WebDriver for Google Chrome/Chromium
Requires: chromium-common%{_isa} = %{version}-%{release}
%description -n chromedriver
WebDriver is an open source tool for automated testing of webapps across many
browsers. It provides capabilities for navigating to web pages, user input,
JavaScript execution, and more. ChromeDriver is a standalone server which
implements WebDriver's wire protocol for Chromium. It is being developed by
members of the Chromium and WebDriver teams.
%package headless
Summary: A minimal headless shell built from Chromium
Requires: chromium-common%{_isa} = %{version}-%{release}
%description headless
A minimal headless client built from Chromium. headless_shell is built
without support for alsa, cups, dbus, gconf, gio, kerberos, pulseaudio, or
udev.
%prep
%setup -q -n chromium-%{version}
### Chromium Fedora Patches ###
%patch -P0 -p1 -b .sandboxpie
%patch -P1 -p1 -b .etc
%patch -P2 -p1 -b .system-libusb
%patch -P5 -p1 -b .nozlibmangle
%patch -P6 -p1 -b .nounrar
%patch -P8 -p1 -b .widevine-other-locations
%patch -P11 -p1 -b .py3
%patch -P20 -p1 -b .disable-font-test
%if ! %{bundleminizip}
%patch -P52 -p1 -b .unbundle-zlib
%patch -P61 -p1 -b .system-minizip
%endif
%patch -P65 -p1 -b .java-only-allowed
%patch -P69 -p1 -b .update-rjsmin-to-1.2.0
%patch -P70 -p1 -b .update-six-to-1.16.0
%patch -P82 -p1 -b .remoting-no-tests
%if ! %{bundlebrotli}
%patch -P89 -p1 -b .system-brotli
%endif
%if ! %{use_custom_libcxx}
%patch -P90 -p1 -b .disable-GlobalMediaControlsCastStartStop
%endif
%if ! %{bundleopus}
%patch -P91 -p1 -b .system-opus
%endif
# Fedora branded user agent
%if 0%{?fedora}
%patch -P12 -p1 -b .fedora-user-agent
%endif
%if ! %{bundleffmpegfree}