-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromium.spec
3104 lines (2412 loc) · 104 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}
# set default fuzz=2 for patch
%global _default_patch_fuzz 2
# enable|disable system build flags
%global system_build_flags 0
# disable the package notes info on f36
# workaround for linking issue
%if 0%{?fedora} == 36
%undefine _package_note_file
%endif
# set default numjobs for the koji build
%ifarch aarch64
%global numjobs 8
%else
%global numjobs %{_smp_build_ncpus}
%endif
# This flag is so I can build things very fast on a giant system.
# Enabling this in koji causes aarch64 builds to timeout indefinitely.
%global use_all_cpus 0
%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
# 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 v19.8.1
# set version for devtoolset and gcc-toolset
%global dts_version 12
# set 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
# We'd like to always have this on...
%global use_vaapi 1
%global use_v4l2_codec 0
# ... but the 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
# 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
# Debuginfo packages aren't very useful here. If you need to debug
# you should do a proper debug build (not implemented in this spec yet)
%global debug_package %{nil}
# %%{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 clang by default
%global clang 1
# set correct toolchain
%if %{clang}
%global toolchain clang
%else
%global toolchain gcc
%endif
# enable system brotli
%global bundlebrotli 0
# 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
%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
# 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.
# It exists everywhere else though.
%global bundleminizip 0
%if 0%{?rhel} == 7
%global bundleminizip 1
%endif
# enable qt backend for el >= 8 and fedora >= 35
%if 0%{?rhel} >= 8 || 0%{?fedora} >=35
%global use_qt 1
%else
%global use_qt 0
%endif
# enable gtk3 by default
%global gtk3 1
%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 bundlelibaom 1
%else
# Chromium really wants to use its bundled harfbuzz. Sigh.
%if 0%{?fedora} > 37
%global bundleharfbuzz 0
%else
%global bundleharfbuzz 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 bundlelibaom 1
# system freetype on fedora > 36
%if 0%{?fedora} > 36
%global bundlefreetype 0
%else
%global bundlefreetype 1
%endif
%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: 114.0.5735.198
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-91.0.4472.77-initial_prefs-etc-path.patch
# Use gn system files
Patch2: chromium-107.0.5304.110-gn-system.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-114-norar.patch
# Try to load widevine from other places
Patch8: chromium-108-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
# missing limits.h, error: no member named 'numeric_limits' in namespace 'std'
Patch53: chromium-110-limits.patch
# ../../third_party/perfetto/include/perfetto/base/task_runner.h:48:55: error: 'uint32_t' has not been declared
Patch56: chromium-96.0.4664.45-missing-cstdint-header.patch
# Missing <cstring> (thanks c++17)
Patch57: chromium-96.0.4664.45-missing-cstring.patch
# Fix headers to look for system paths when we are using system minizip
Patch61: chromium-109-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-108-system-brotli.patch
# disable GlobalMediaControlsCastStartStop to avoid crash
# when using the address bar media player button
Patch90: chromium-113-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-108-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-85.0.4183.83-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-99.0.4844.51-el7-extra-operator==.patch
# workaround for clang bug on el7
Patch108: chromium-114-constexpr-el7.patch
Patch109: chromium-114-wireless-el7.patch
Patch110: chromium-114-buildflag-el7.patch
# system ffmpeg
Patch114: chromium-107-ffmpeg-duration.patch
Patch115: chromium-107-proprietary-codecs.patch
# drop av_stream_get_first_dts from internal ffmpeg
Patch116: chromium-112-ffmpeg-first_dts.patch
# revert new-channel-layout-api on f36, old ffmpeg-free
Patch117: chromium-108-ffmpeg-revert-new-channel-layout-api.patch
# gcc13
Patch122: chromium-114-gcc13.patch
# revert AV1 VA-API video encode due to old libva on el9
Patch130: chromium-114-revert-av1enc-el9.patch
# Apply these patches to work around EPEL8 issues
Patch300: chromium-113-rhel8-force-disable-use_gnome_keyring.patch
# workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826
Patch302: chromium-114-workaround_clang_bug-structured_binding.patch
# missing typename
Patch303: chromium-114-typename.patch
# Qt issue
Patch320: chromium-114-add_qt6_linuxui_backend.patch
Patch321: chromium-114-qt-handle_scale_factor_changes.patch
Patch322: chromium-114-qt-fix_font_double_scaling.patch
Patch323: chromium-114-qt_deps.patch
Patch324: chromium-114-qt_enable_AllowQt_feature_flag.patch
Patch325: chromium-114-qt_logical_scale_factor.patch
Patch326: ozone-add-va-api.patch
# 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
Source11: [email protected]
Source13: master_preferences
# RHEL 8 needs newer nodejs
%if 0%{?rhel} == 8
Source19: https://nodejs.org/dist/latest-v16.x/node-%{nodejs_version}-linux-x64.tar.xz
Source21: https://nodejs.org/dist/latest-v16.x/node-%{nodejs_version}-linux-arm64.tar.xz
%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}-toolchain, %{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)
%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 ! %{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
%if 0%{?fedora} >= 30
BuildRequires: minizip-compat-devel
%else
# RHEL 8 needs to use the compat-minizip (provided by minizip1.2)
%if 0%{?rhel} >= 8
BuildRequires: minizip-compat-devel
%endif
%endif
# RHEL 8 needs newer nodejs
%if 0%{?rhel} == 8
# nothing
%else
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}
%if %{gtk3}
BuildRequires: pkgconfig(gtk+-3.0)
%else
BuildRequires: pkgconfig(gtk+-2.0)
%endif
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
# Technically, this logic probably applies to older rhel too... but whatever.
# RHEL 8 and 9 do not have gnome-keyring. Not sure why, but whatever again.
%if 0%{?fedora} || 0%{?rhel} == 7
BuildRequires: pkgconfig(gnome-keyring-1)
%endif
# 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: ia32 x86_64
# rhel 8+: ia32, x86_64, aarch64
# fedora 32 or older: ia32, x86_64, aarch64
# fedora 33+: x86_64 aarch64 only
%if 0%{?rhel} == 7
ExclusiveArch: x86_64
%else
%if 0%{?fedora} > 32
ExclusiveArch: x86_64 aarch64
%else
ExclusiveArch: x86_64 aarch64
%endif
%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) = 5.1.2
%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
# Chromium needs an explicit Requires: minizip-compat
# We put it here to cover headless too.
%if 0%{?fedora} >= 30
Requires: minizip-compat%{_isa}
%else
%if 0%{?rhel} == 7
# Do nothing
%else
%if 0%{?rhel} == 9
Requires: minizip1.2%{_isa}
%else
Requires: minizip%{_isa}
%endif
%endif
%endif
# -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 .gnsystem
%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 0%{?fedora} || 0%{?rhel} >= 8
%patch -P52 -p1 -b .unbundle-zlib
%endif
%patch -P53 -p1 -b .limits-header
%patch -P56 -p1 -b .missing-cstdint
%patch -P57 -p1 -b .missing-cstring
%if ! %{bundleminizip}
%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
%patch -P90 -p1 -b .disable-GlobalMediaControlsCastStartStop
%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}
%patch -P114 -p1 -b .system-ffmppeg
%patch -P115 -p1 -b .prop-codecs
%patch -P116 -p1 -b .first_dts
%if 0%{?fedora} == 36
%patch -P117 -p1 -b .revert-new-channel-layout-api
%endif
%endif
# EPEL specific patches
%if 0%{?rhel} == 7
%patch -P100 -p1 -b .el7-memfd-fcntl-include
%patch -P101 -p1 -b .wayland-strndup-error
%patch -P103 -p1 -b .epel7-header-workarounds
%patch -P104 -p1 -b .el7cups
%patch -P105 -p1 -b .el7-old-libdrm
%patch -P106 -p1 -b .el7-erase-fix
%patch -P107 -p1 -b .el7-extra-operator-equalequal
%patch -P108 -p1 -b .constexpr
%patch -P109 -p1 -b .wireless
%patch -P110 -p1 -b .buildflag-el7
%endif
%patch -P122 -p1 -b .gcc13
%if 0%{?rhel} == 9
%patch -P130 -p1 -b .revert-av1enc
%endif
%if 0%{?rhel} >= 8
%patch -P300 -p1 -b .disblegnomekeyring
%endif
%if %{clang}
%if 0%{?rhel} || 0%{?fedora} < 38
%patch -P302 -p1 -b .workaround_clang_bug-structured_binding
%endif
%endif
%patch -P303 -p1 -b .typename
%patch -P320 -p1 -b .add_qt6_linuxui_backend
%patch -P321 -p1 -b .handle_scale_factor_changes
%patch -P322 -p1 -b .fix_font_double_scaling
%patch -P323 -p1 -b .qt_deps
%patch -P324 -p1 -b .qt_enable_AllowQt_feature_flag
%patch -P325 -p1 -b .qt_logical_scale_factor
%patch -P326 -p1 -b .vaapiwayland
# 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]\?=#!%{__python3}=' {} +
%if 0%{?rhel} == 8
pushd third_party/node/linux
%ifarch x86_64
tar xf %{SOURCE19}
mv node-%{nodejs_version}-linux-x64 node-linux-x64
%endif
%ifarch aarch64
tar xf %{SOURCE21}
mv node-%{nodejs_version}-linux-arm64 node-linux-arm64
# This is weird, but whatever
ln -s node-linux-arm64 node-linux-x64
%endif
popd
%else
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
%endif