-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathchromium.spec
1046 lines (955 loc) · 42.1 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 channel stable
%if "%{channel}" == "stable"
%define namesuffix %{nil}
%else
%define namesuffix -%{channel}
%endif
%define _disable_ld_no_undefined 1
# Chromium buildmess uses its own LTO
%global _disable_lto 1
# eol 'fix' corrupts some .bin files
%define dont_fix_eol 1
#define v8_ver 3.12.8
%define crname chromium-browser
%define _crdir %{_libdir}/%{crname}
%define _src %{_topdir}/SOURCES
# For incomplete debug package support
%define _empty_manifest_terminate_build 0
%ifarch %ix86
%define _build_pkgcheck_set %{nil}
%endif
%bcond_without browser
# Disabled for now because we need libc++ anyway (therefore
# can't use it in most other applications) and rust linkage
# fails in 126.x
%bcond_with cef
# Use the internal libc++ instead of libstdc++
# This should usually be avoided because of potential symbol
# clashes when using e.g. Qt and Chromium at the same time
# (especially with cef!), but some versions of chromium make
# it necessary
# in 131.x, chromium with libstdc++ mostly works, but gets
# more "Aw, snap" errors than a libc++ build
%bcond_without libcxx
# FIXME As of 97.0.4688.2, Chromium crashes frequently when
# built with fortification enabled.
# [3784233:1:1107/202853.599120:ERROR:socket.cc(93)] sendmsg: Broken pipe (32)
# Received signal 11 <unknown> 03e900000001
#0 0x55af1960e344 (/usr/lib64/chromium-browser-dev/chrome+0x9071343)
#1 0x7fa28e947790 (/lib64/libc.so.6+0x4578f)
#2 0x7fa28e92e4f0 abort
#3 0x7fa28e98edc6 (/lib64/libc.so.6+0x8cdc5)
#4 0x7fa28ea386e2 __fortify_fail
#5 0x7fa28ea386b2 __stack_chk_fail
#6 0x55af1446e459 (/usr/lib64/chromium-browser-dev/chrome+0x3ed1458)
#7 0x7fa28e92fd8c (/lib64/libc.so.6+0x2dd8b)
#8 0x7fa28e92fe39 __libc_start_main
#9 0x55af140ab121 _start
# This should be investigated properly at some point.
%define _fortify_cflags %{nil}
%define _ssp_cflags %{nil}
# Libraries that should be unbundled (and reason why they
# aren't yet):
# openh264: Fails to compile
# icu: Causes crash when loading some websites, e.g.
# build logs from abf, anti-spiegel.ru
# libevent: Seems to be ok in 125. Observed earlier:
# Works-ish, but causes weird random freezes
# observed e.g. while running multiple Slack
# sessions in browser mode
# libvpx: Fails to compile
# re2 jsoncpp snappy: Use C++, therefore won't work while
# system uses libstdc++ but chromium
# uses use_custom_libcxx=true
# libaom (as of 118.x): Build error caused by GN insisting on in-tree version
# libwebp (as of 124.x): //third_party/libavif:libavif_enc(//build/toolchain/linux/unbundle:default) needs //third_party/libwebp:libwebp_sharpyuv(//build/toolchain/linux/unbundle:default)
# re2 (as of 124.x): //third_party/googletest:gtest_config(//build/toolchain/linux/unbundle:default) needs //third_party/re2:re2_config(//build/toolchain/linux/unbundle:default) (+ libc++/libstdc++ issue)
%if %{with libcxx}
%global system_libs brotli dav1d flac ffmpeg fontconfig harfbuzz-ng libjpeg libjxl libpng libdrm libxml libxslt opus libusb openh264 zlib freetype zstd libwebp libevent
%else
%global system_libs brotli dav1d flac ffmpeg fontconfig harfbuzz-ng libjpeg libjxl libpng libdrm libxml libxslt opus libusb openh264 zlib freetype zstd libwebp jsoncpp snappy libevent
# System absl is not quite working yet
# absl_algorithm absl_base absl_cleanup absl_container absl_crc absl_debugging absl_flags absl_functional absl_hash absl_log absl_log_internal absl_memory absl_meta absl_numeric absl_random absl_status absl_strings absl_synchronization absl_time absl_types absl_utility
%endif
%define system() %(if echo %{system_libs} |grep -q -E '(^| )%{1}( |$)'; then echo -n 1; else echo -n 0; fi)
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
# OpenMandriva key, id and secret
# For your own builds, please get your own set of keys.
%define google_api_key AIzaSyAraWnKIFrlXznuwvd3gI-gqTozL-H-8MU
%define google_default_client_id 1089316189405-m0ropn3qa4p1phesfvi2urs7qps1d79o.apps.googleusercontent.com
%define google_default_client_secret RDdr-pHq2gStY4uw0m-zxXeo
%if "%{channel}" == "stable"
Name: chromium
%else
Name: chromium-browser-%{channel}
%endif
# Working version numbers can be found at
# https://chromiumdash.appspot.com/releases?platform=Linux
Version: 132.0.6834.110
### Don't be evil!!! ###
%define ungoogled 132.0.6834.110-1
%if %{with cef}
# To find the CEF commit matching the Chromium version, look up the
# right branch at
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
# (Typically this will match the 3rd component of the version number)
# then check the commit for the branch at the branch download page,
# https://bitbucket.org/chromiumembedded/cef/downloads/?tab=branches
#
# Since we're using system libxml, we're potentially restoring
# https://github.com/chromiumembedded/cef/issues/3616 fixed in cef upstream.
# If we run into this problem, we need to either use custom libxml or build
# system libxml with TLS disabled.
%define cef 9a14dc9ff79d192b3ab810ad3736f235cd7c609a
%endif
Release: 2
Summary: A fast webkit-based web browser
Group: Networking/WWW
License: BSD, LGPL
# From : http://gsdview.appspot.com/chromium-browser-official/
Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz
Source1: chromium-wrapper
Source2: chromium-browser%{namesuffix}.desktop
Source3: master_preferences
# https://bugs.freedesktop.org/show_bug.cgi?id=106490
# Workaround from Arch Linux
# https://aur.archlinux.org/cgit/aur.git/tree/chromium-drirc-disable-10bpc-color-configs.conf?h=chromium-vaapi
Source4: chromium-drirc-disable-10bpc-color-configs.conf
%if 0%{?cef:1}
Source10: https://bitbucket.org/chromiumembedded/cef/get/%{cef}.tar.bz2
Source11: https://chromium-fonts.storage.googleapis.com/336e775eec536b2d785cc80eff6ac39051931286#/test_fonts.tar.gz
%endif
Source100: %{name}.rpmlintrc
%if 0%{?ungoogled:1}
Source1000: https://github.com/ungoogled-software/ungoogled-chromium/archive/%{ungoogled}.tar.gz
%endif
# ============================================================================
# Patches 0 to 1999 are applied in the top level Chromium directory
# after ungoogled-chromium and cef patchsets have been applied.
# ============================================================================
# "Borrowed" from other distros (note we don't copy all their patches,
# just the ones that make sense for OM -- in particular no slew of
# workarounds for prehistoric libraries and compilers):
### 0-99: Fedora
# https://src.fedoraproject.org/rpms/chromium/tree/rawhide
%if ! 0%{?ungoogled:1}
# Ungoogled Chromium already builds a PIE sandbox
Patch0: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-70.0.3538.67-sandbox-pie.patch
%endif
# Use /etc/chromium for master_prefs
Patch1: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-68.0.3440.106-master-prefs-path.patch
Patch2: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-67.0.3396.62-gn-system.patch
Patch3: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch
# Use gn system files
# Do not mangle zlib
Patch4: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-77.0.3865.75-no-zlib-mangle.patch
# Needs to be submitted..
Patch6: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-107-proprietary-codecs.patch
# Disable whitelist, allow everything
Patch7: https://src.fedoraproject.org/rpms/chromium/raw/rawhide/f/chromium-122-disable-FFmpegAllowLists.patch
### 100-199: Arch
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-dev
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-wayland-vaapi
Patch101: https://aur.archlinux.org/cgit/aur.git/plain/0001-ozone-wayland-implement-text_input_manager-fixes.patch?h=chromium-wayland-vaapi#/0001-ozone-wayland-implement-text_input_manager-fixes.patch
Patch102: https://aur.archlinux.org/cgit/aur.git/plain/chromium-qt6.patch?h=chromium-dev#/chromium-qt6.patch
### 200-299: Gentoo
Patch200: https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/chromium-124-libwebp-shim-sharpyuv.patch
### 300-399: Debian
# https://sources.debian.org/patches/chromium/
# Mostly fixes for libstdc++ related failures
Patch300: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/ps-print.patch
Patch301: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/widevine-revision.patch
Patch302: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/widevine-locations.patch
# Not needed for OM
###Patch303: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/rust-clanglib.patch
Patch304: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/material-utils.patch
Patch305: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/perfetto.patch
Patch306: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/strlcpy.patch
# Not needed for OM
###Patch307: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/bindgen.patch
Patch308: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/memory-allocator-dcheck-assert-fix.patch
Patch309: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/clang-rust-target.patch
Patch310: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/highway-include-path.patch
Patch312: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/predictor-denial-of-service.patch
Patch313: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/fix-assert-in-vnc-sessions.patch
Patch314: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/armhf-timespec.patch
Patch316: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/fixes/updater-test.patch
Patch318: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/upstream/ruy-include.patch
# (Mostly) duplicates from ungoogled patchset
###Patch320: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/tests.patch
Patch321: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/tests-swiftshader.patch
# Already disabled by ungoogled patchset
###Patch322: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/signin.patch
Patch323: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/android.patch
Patch324: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/catapult.patch
Patch325: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/font-tests.patch
# Clashes with ungoogled patchset, probably not needed
###Patch326: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/google-api-warning.patch
# Already disabled in ungoogled patchset
###Patch327: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/third-party-cookies.patch
Patch328: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/driver-chrome-path.patch
Patch329: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/widevine-cdm-cu.patch
Patch330: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/clang-version-check.patch
Patch331: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/disable/screen-ai-blob.patch
Patch332: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/icu-shim.patch
Patch333: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/jpeg.patch
%if %{system libevent}
Patch334: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/event.patch
%endif
Patch335: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/openjpeg.patch
Patch336: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/opus.patch
Patch337: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/eu-strip.patch
# Duplicate - but not sure where the other version comes from. Ungoogled?
###Patch338: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/rapidjson.patch
###Patch339: https://sources.debian.org/data/main/c/chromium/132.0.6834.83-1/debian/patches/system/rollup.patch
### 400-999: Patches from 3rd party projects that aren't distro packages
Patch400: https://codeberg.org/selfisekai/copium/raw/branch/main/cr129-ffmpeg-no-noh264parse.patch
Patch402: https://codeberg.org/selfisekai/copium/raw/branch/main/cr127-stdcpp-emplace-multiplex_router.patch
Patch403: https://codeberg.org/selfisekai/copium/raw/branch/main/cr127-stdcpp-emplace-surface_aggregator.patch
Patch406: https://codeberg.org/selfisekai/copium/raw/branch/main/cr128-stdcpp-emplace-shared_image_backing.patch
Patch407: chromium-129-system-absl.patch
#Patch408: chromium-129-libstdc++-buildfixes.patch
# https://gitlab.com/Matt.Jolly/chromium-patches
# [nothing currently relevant; make sure to check release branches, master branch is abandoned]
# https://github.com/ungoogled-software/ungoogled-chromium-fedora
Patch411: https://raw.githubusercontent.com/ungoogled-software/ungoogled-chromium-fedora/master/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch
# From OBS CEF fork
# https://github.com/obsproject/cef/commits/6261-shared-textures
Patch420: https://github.com/obsproject/cef/commit/27e977332df56c6251f4ee418d6bd51be073767d.patch
Patch421: https://github.com/obsproject/cef/commit/f88220be4c4c02db5f9f0170dfc515d86a6f0c48.patch
### 1000+: Our own patches
Patch1001: chromium-64-system-curl.patch
Patch1002: chromium-69-no-static-libstdc++.patch
Patch1003: chromium-system-zlib.patch
Patch1004: chromium-107-system-libs.patch
Patch1005: chromium-restore-jpeg-xl-support.patch
Patch1006: chromium-extra-widevine-search-paths.patch
Patch1007: chromium-116-dont-override-thinlto-cache-policy.patch
Patch1008: chromium-116-system-brotli.patch
Patch1009: gn-enable-freetype-workaround.patch
#Patch1010: chromium-131-libstdc++.patch
Patch1010: chromium-132-system-toolchain.patch
Patch1011: perfetto-system-gn.patch
Patch1012: chromium-105-minizip-ng.patch
Patch1013: chromium-132-compile.patch
Patch1014: chromium-126-fix-build-on-non-ChromeOS-linux.patch
Patch1015: chromium-113.0.5672.63-compile.patch
Patch1016: chroimum-119-workaround-crash-on-startup.patch
# More and better search engines
# https://bugs.chromium.org/p/chromium/issues/detail?id=1502905
# FIXME needs porting, currently seems to cause crash on first startup
#Patch1017: chromium-124-search-engine-choice.patch
Patch1018: chromium-81-unbundle-zlib.patch
Patch1019: chromium-121-rust-clang_lib.patch
#Patch1020: chromium-125-libstdc++.patch
Patch1021: chromium-127-system-bindgen.patch
%if 0%{?cef:1}
Patch1022: chromium-115-fix-generate_fontconfig_caches.patch
# FIXME probably needs porting
#Patch1023: cef-115-minizip-ng.patch
%if 0%{?ungoogled:1}
# FIXME needs porting
Patch1024: cef-126-rebase-to-ungoogled.patch
Patch1025: cef-125-ungoogling.patch
%endif
Patch1026: cef-zlib-linkage.patch
Patch1028: cef-126-zlib-ng.patch
%endif
Patch1029: chromium-127-minizip-ng.patch
# https://issues.chromium.org/issues/381407882
Patch1030: chromium-131-compilefix-crbug-381407882.patch
# ============================================================================
# Patches 2000 to 2999 are applied inside the CEF tree.
# ============================================================================
# (we currently don't have any such patches)
# ============================================================================
# Patches 3000+ are from the various chromium upstream repositories
# and applied inside their respective directories.
# ============================================================================
# ============================================================================
# Patches 4000+ are applied inside the ungoogled-chromium tree before
# the ungoogling scripts are run
# ============================================================================
Provides: %{crname}
Obsoletes: chromium-browser-unstable < %{EVRD}
Obsoletes: chromium-browser < %{EVRD}
%if "%{channel}" == "stable" || "%{channel}" == "beta"
Obsoletes: chromium-browser-dev < %{EVRD}
%endif
%if "%{channel}" == "stable"
Obsoletes: chromium-browser-beta < %{EVRD}
%rename chromium-browser-stable
%endif
BuildRequires: glibc-static-devel
BuildRequires: gperf
BuildRequires: bison
BuildRequires: re2c
BuildRequires: flex
BuildRequires: git
BuildRequires: rust
BuildRequires: rust-bindgen-cli
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(krb5)
BuildRequires: pkgconfig(libunwind)
BuildRequires: pkgconfig(com_err)
BuildRequires: alsa-oss-devel
BuildRequires: atomic-devel
BuildRequires: snappy-devel
BuildRequires: jsoncpp-devel
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(wayland-egl)
BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(libglvnd)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(libva-drm)
BuildRequires: pkgconfig(libva-glx)
BuildRequires: pkgconfig(libva-x11)
BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5OpenGL)
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6DBus)
BuildRequires: pkgconfig(Qt6Gui)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(Qt6OpenGL)
BuildRequires: pkgconfig(RapidJSON)
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(atspi-2)
BuildRequires: pkgconfig(atk)
BuildRequires: pkgconfig(atk-bridge-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gtk4)
BuildRequires: pkgconfig(pangocairo)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpipewire-0.3)
BuildRequires: pkgconfig(libinput)
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(xcomposite)
BuildRequires: pkgconfig(xdamage)
BuildRequires: %{_lib}GL-devel
BuildRequires: bzip2-devel
BuildRequires: pkgconfig(libcurl)
BuildRequires: clang lld
%if %{system brotli}
BuildRequires: pkgconfig(libbrotlicommon)
BuildRequires: pkgconfig(libbrotlidec)
BuildRequires: pkgconfig(libbrotlienc)
BuildRequires: brotli
%endif
%if %{system dav1d}
BuildRequires: pkgconfig(dav1d)
%endif
%if %{system ffmpeg}
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavfilter)
BuildRequires: pkgconfig(libavformat) >= 57.41.100
BuildRequires: pkgconfig(libavutil)
%endif
%if %{system flac}
BuildRequires: pkgconfig(flac)
%endif
%if %{system fontconfig}
BuildRequires: pkgconfig(fontconfig)
%endif
%if %{system harfbuzz-ng}
BuildRequires: harfbuzz-devel
%endif
%if %{system icu}
BuildRequires: pkgconfig(icu-i18n)
%endif
%if %{system libaom}
BuildRequires: pkgconfig(aom)
%endif
%if %{system libdrm}
BuildRequires: pkgconfig(libdrm)
%endif
%if %{system libevent}
BuildRequires: pkgconfig(libevent)
%endif
%if %{system libjpeg}
BuildRequires: jpeg-devel
%endif
%if %{system libjxl}
BuildRequires: pkgconfig(libjxl)
%endif
%if %{system libpng}
BuildRequires: pkgconfig(libpng)
%endif
%if %{system libusb}
BuildRequires: pkgconfig(libusb-1.0)
%endif
%if %{system libvpx}
BuildRequires: pkgconfig(vpx)
%endif
%if %{system libwebp}
BuildRequires: pkgconfig(libwebp)
%endif
%if %{system libxml}
BuildRequires: pkgconfig(libxml-2.0)
%endif
%if %{system libxslt}
BuildRequires: pkgconfig(libxslt)
%endif
%if %{system opus}
BuildRequires: pkgconfig(opus)
%endif
%if %{system openh264}
BuildRequires: pkgconfig(openh264)
%endif
%if %{system re2}
BuildRequires: pkgconfig(re2)
%endif
%if %{system zlib}
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(minizip)
%endif
BuildRequires: pkgconfig(nspr)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xshmfence)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(gl)
BuildRequires: cups-devel
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(gnome-keyring-1)
BuildRequires: pam-devel
BuildRequires: pkgconfig(xtst)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(xt)
BuildRequires: cap-devel
BuildRequires: elfutils-devel
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(snappy)
BuildRequires: pkgconfig(python)
BuildRequires: pkgconfig(protobuf)
BuildRequires: python%{pyver}dist(protobuf)
BuildRequires: python%{pyver}dist(markupsafe)
BuildRequires: yasm
BuildRequires: speech-dispatcher-devel
BuildRequires: pkgconfig(libpci)
BuildRequires: pkgconfig(libexif)
BuildRequires: ninja
BuildRequires: nodejs
BuildRequires: jdk-current
%description
Chromium is a browser that combines a minimal design with sophisticated
technology to make the web faster, safer, and easier.
This is the stable channel Chromium browser. It offers a rock solid
browser which is updated with features and fixes once they have been
thoroughly tested. If you want the latest features, install the
chromium-browser-dev package instead.
%package qt5
Summary: Qt 5.x integration for Chromium
Group: System/Libraries
Requires: %{name} = %{EVRD}
Obsoletes: chromium-browser-stable-qt5
%description qt5
Qt 5.x integration for Chromium
%package qt6
Summary: Qt 6.x integration for Chromium
Group: System/Libraries
Requires: %{name} = %{EVRD}
Supplements: %{name} = %{EVRD}
Obsoletes: chromium-browser-stable-qt6
%description qt6
Qt 6.x integration for Chromium
%package -n cef-qt5
Summary: Qt 5.x integration for CEF
Group: System/Libraries
Requires: cef = %{EVRD}
%description -n cef-qt5
Qt 5.x integration for CEF
%package -n cef-qt6
Summary: Qt 6.x integration for CEF
Group: System/Libraries
Requires: cef = %{EVRD}
Supplements: cef = %{EVRD}
%description -n cef-qt6
Qt 6.x integration for CEF
%if 0%{?cef:1}
%package -n cef
Summary: Chromium Embedded Framework - library for embeddind Chromium in custom applications
# FIXME cef hardcodes a gtk dependency somewhere. It should
# really be dropped in favor of Qt
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(gtk+-unix-print-3.0)
Group: System/Libraries
%description -n cef
Chromium Embedded Framework - library for embeddind Chromium in custom applications
%package -n cef-devel
Summary: Chromium Embedded Framework - library for embeddind Chromium in custom applications
Group: Development/Libraries
Requires: cef = %{EVRD}
%description -n cef-devel
Chromium Embedded Framework - library for embeddind Chromium in custom applications
%endif
%package -n chromedriver%{namesuffix}
Summary: WebDriver for Google Chrome/Chromium
Group: Development/Other
Requires: %{name} = %{version}-%{release}
%description -n chromedriver%{namesuffix}
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.
%prep
# Not using %%autosetup so we can apply patches after
# ungoogled-chromium patches have been applied
%setup -q -n chromium-%{version} %{?ungoogled:-a 1000}
%if 0%{?ungoogled:1}
UGDIR=$(pwd)/ungoogled-chromium-%{ungoogled}
# Add a Source1001 patch whenever UG is behind upstream
cd $UGDIR
%autopatch -p1 -m 4000
cd ..
echo %{version} >$UGDIR/chromium_version.txt
# Disable a few patches: We don't want to allow Google to spy on our
# users, but we don't want to prevent users from voluntarily using
# Google services.
# Also, disable some security-for-usability tradeoffs by default
sed -i \
-e '/disable-autofill/d' \
-e '/prefs-only-keep-cookies-until-exit/d' \
-e '/disable-webstore-urls.patch/d' \
$UGDIR/patches/series
python $UGDIR/utils/prune_binaries.py ./ $UGDIR/pruning.list --verbose
python $UGDIR/utils/patches.py apply ./ $UGDIR/patches
python $UGDIR/utils/domain_substitution.py apply -r $UGDIR/domain_regex.list -f $UGDIR/domain_substitution.list -c domainsubcache.tar.gz ./
%endif
%if 0%{?cef:1}
tar xf %{S:10}
mv chromiumembedded-cef-* cef
# CEF's scripts refuse to work outside of git repositories, so
# we have to fake it
git init
cd third_party/pdfium ; git init; cd ../..
cd cef; git init; cd ..
cd cef
%autopatch -p1 -m 2000 -M 2999
COMMIT_NUMBER=%(echo %{version} |cut -d. -f3) COMMIT_HASH=%{cef} python tools/make_version_header.py include/cef_version.h --cef_version VERSION.in --chrome_version ../chrome/VERSION --cpp_header_dir include
cd ..
cd third_party/test_fonts
tar xf %{S:11}
cd ../..
%endif
%autopatch -p1 -M 1999
cd third_party/webrtc
%autopatch -p1 -m 3000 -M 3009
cd -
cd media
%autopatch -p1 -m 3010 -M 3019
cd -
rm -rf third_party/binutils/
# Get rid of the pre-built eu-strip binary, it is x86_64 and of mysterious origin
rm -rf buildtools/third_party/eu-strip/bin/eu-strip
# Replace it with a symlink to the system copy
ln -s %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip
echo "%{revision}" > build/LASTCHANGE.in
#sed -i 's!-nostdlib++!!g' build/config/posix/BUILD.gn
sed -i 's!ffmpeg_buildflags!ffmpeg_features!g' build/linux/unbundle/ffmpeg.gn
# Allow building against system libraries in official builds
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py
%if ! %{with libcxx}
# Get rid of internal libc++ headers to make sure they aren't accidentally
# used instead of their libstdc++ counterparts
rm -rf third_party/libc++ third_party/libc++abi
%endif
# Hard code extra version
FILE=chrome/common/channel_info_posix.cc
sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"%{product_vendor} %{product_version}"/' $FILE
cmp $FILE $FILE.orig && exit 1
# use the system nodejs
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
# Remove bundled libs
# We could use build/linux/unbundle/remove_bundled_libraries.py here, but
# that requires listing the (much bigger set of) remaining libraries and
# pulls in yet another python2 dep -- so let's use the trick found in the
# Arch PKGBUILD file instead
for lib in %{system_libs}; do
# Fix mismatch between name and directory name
[ "$lib" = "libjpeg" ] && lib="libjpeg_turbo"
# libevent lives in base/third_party rather than third_party
[ "$lib" = "libevent" ] && continue
if echo $lib |grep -q ^absl_; then
continue
fi
find "third_party/$lib" -type f \
\! -path "third_party/$lib/chromium/*" \
\! -path "third_party/$lib/google/*" \
\! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \
\! -regex '.*\.\(gn\|gni\|isolate\)' \
-delete
done
python build/linux/unbundle/replace_gn_files.py \
--system-libraries %{system_libs}
# Forcing an outdated copy of what should really match system headers
# is just about as dumb as something can get
cp -f %{_includedir}/wayland-client-core.h third_party/wayland/src/src/
# workaround build failure
if [ ! -f chrome/test/data/webui/i18n_process_css_test.html ]; then
touch chrome/test/data/webui/i18n_process_css_test.html
fi
# FIXME third_party/rust-toolchain has been removed in 132,
# but at least one reference to rust-toolchain/bin/bindgen
# is hardcoded in gn files
# check if still necessary after update
mkdir -p third_party/rust-toolchain/bin
ln -sf %{_bindir}/bindgen third_party/rust-toolchain/bin/
%build
%if 0%{?ungoogled:1}
UGDIR=$(pwd)/ungoogled-chromium-%{ungoogled}
%endif
. %{_sysconfdir}/profile.d/90java.sh
%ifarch %{arm}
# Use linker flags to reduce memory consumption on low-mem architectures
mkdir -p bfd
ln -s %{_bindir}/ld.bfd bfd/ld
export PATH=$PWD/bfd:$PATH
# Use linker flags to reduce memory consumption
%global ldflags %{ldflags} -fuse-ld=bfd -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
%endif
%ifarch %{ix86}
# Workaround for build failure
%global ldflags %{ldflags} -Wl,-z,notext
%endif
%global optflags %(echo %{optflags} | sed -e 's/-g3 /-g1 /')
%global optflags %{optflags} -I%{_includedir}/libunwind
# Chromium builds tend to barf if not told precisely what to use
export CC="%{__cc}"
export CXX="%{__cxx}"
export AR="%{__ar}"
export NM="llvm-nm"
_lto_cpus="$(getconf _NPROCESSORS_ONLN)"
if [ $_lto_cpus -gt 4 ]; then
# LTO is very memory intensive, so
# 32 parallel LTO jobs may not be
# a good idea...
_lto_cpus=4
fi
# FIXME error: the option `Z` is only accepted on the nightly compiler
export RUSTC_BOOTSTRAP=1
%if "%{_lib}" != "lib"
# Something hardcodes ../../[...]/usr/lib as LIBCLANG_PATH
# which of course doesn't catch lib64 and friends...
sed -i -e "s,args.libclang_path,'%{_libdir}',g" build/rust/run_bindgen.py
sed -i -e 's,lib/clang,%{_lib}/clang,g' build/rust/rust_bindgen.gni
%endif
# We use our version of clang, regardless of what upstream wants
sed -i -E 's,(clang_version.*= *)".*,\1"19",' build/toolchain/toolchain.gni
GN_DEFINES=""
%if 0%{?ungoogled:1}
GN_DEFINES+=" $(cat $UGDIR/flags.gn |tr '\n' ' ')"
%endif
GN_DEFINES+="use_sysroot=false is_debug=false "
GN_DEFINES+=" is_clang=true clang_base_path=\"%{_prefix}\" clang_use_chrome_plugins=false "
GN_DEFINES+=" treat_warnings_as_errors=false "
%if %{with libcxx}
GN_DEFINES+=" use_custom_libcxx=true "
%else
GN_DEFINES+=" use_custom_libcxx=false "
%endif
for i in %{system_libs}; do
if [ "$i" = "harfbuzz-ng" ]; then
GN_DEFINES+=" use_system_harfbuzz=true "
else
GN_DEFINES+=" use_system_$i=true "
fi
done
GN_DEFINES+=" use_system_expat=true "
GN_DEFINES+=" use_system_lcms2=true "
GN_DEFINES+=" use_system_libffi=true "
GN_DEFINES+=" use_system_libopenjpeg2=true "
# We don't currently ship libsync
#GN_DEFINES+=" use_system_libsync=true "
GN_DEFINES+=" use_system_libwayland=true "
GN_DEFINES+=" use_system_libwayland_client=true "
GN_DEFINES+=" use_system_libwayland_server=true "
GN_DEFINES+=" use_system_lua=true "
GN_DEFINES+=" use_system_minigbm=true "
GN_DEFINES+=" use_system_openjpeg2=true "
GN_DEFINES+=" use_system_protobuf=true "
GN_DEFINES+=" use_system_wayland=true "
GN_DEFINES+=" use_system_wayland_client=true "
GN_DEFINES+=" use_system_wayland_scanner=true "
GN_DEFINES+=" use_system_wayland_server=true "
GN_DEFINES+=" use_xkbcommon=true "
GN_DEFINES+=" use_gtk=true gtk_version=4 use_qt=true use_qt6=true moc_qt6_path=\"%{_qtdir}/libexec\""
if ! echo %{system_libs} |grep -q icu; then
GN_DEFINES+=" icu_use_data_file=true"
fi
GN_DEFINES+=" fatal_linker_warnings=false "
GN_DEFINES+=" system_libdir=\"%{_libdir}\""
#GN_DEFINES+=" use_aura=true "
#GN_DEFINES+=" use_gio=true"
GN_DEFINES+=" enable_nacl=false "
GN_DEFINES+=" proprietary_codecs=true "
GN_DEFINES+=" ffmpeg_branding=\"ChromeOS\" "
GN_DEFINES+=" enable_mse_mpeg2ts_stream_parser=true "
%ifarch %{ix86}
GN_DEFINES+=" target_cpu=\"x86\""
%endif
%ifarch %{x86_64}
GN_DEFINES+=" target_cpu=\"x64\""
%endif
%ifarch %{arm}
GN_DEFINES+=" target_cpu=\"arm\""
GN_DEFINES+=" remove_webcore_debug_symbols=true"
%endif
%ifarch %{armx}
GN_DEFINES+=" rtc_build_with_neon=true"
%endif
%ifarch %{aarch64}
GN_DEFINES+=" target_cpu=\"arm64\""
# if this is true (default for non official builds) it tries to use
# a prebuilt x86 binary in the source tree
GN_DEFINES+=" devtools_skip_typecheck=false"
%endif
%if ! 0%{?ungoogled:1}
GN_DEFINES+=" google_api_key=\"%{google_api_key}\""
GN_DEFINES+=" google_default_client_id=\"%{google_default_client_id}\""
GN_DEFINES+=" google_default_client_secret=\"%{google_default_client_secret}\""
%endif
GN_DEFINES+=" thin_lto_enable_optimizations=true use_lld=true use_thin_lto=true"
GN_DEFINES+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
GN_DEFINES+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
GN_DEFINES+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:default\""
GN_DEFINES+=" symbol_level=1"
GN_DEFINES+=" use_pulseaudio=true link_pulseaudio=true"
GN_DEFINES+=" enable_nacl=false"
GN_DEFINES+=" is_component_ffmpeg=true"
GN_DEFINES+=" enable_hangout_services_extension=true"
GN_DEFINES+=" enable_widevine=true"
GN_DEFINES+=" use_vaapi=true"
GN_DEFINES+=" angle_link_glx=true angle_test_enable_system_egl=true "
GN_DEFINES+=" enable_hevc_parser_and_hw_decoder=true enable_av1_decoder=true enable_jxl_decoder=true"
GN_DEFINES+=" enable_media_drm_storage=true"
%ifarch znver1
# This really is znver1 only, as it enables SSE4.2, BMI2 and AVX2
GN_DEFINES+=" enable_perfetto_x64_cpu_opt=true"
%endif
GN_DEFINES+=" enable_precompiled_headers=true"
GN_DEFINES+=" is_official_build=true"
GN_DEFINES+=" ozone_platform_drm=true"
GN_DEFINES+=" perfetto_use_system_zlib=true"
GN_DEFINES+=" rtc_link_pipewire=true rtc_use_pipewire=true"
GN_DEFINES+=" use_libinput=true use_real_dbus_clients=true"
GN_DEFINES+=" use_vaapi_image_codecs=true"
GN_DEFINES+=' rust_sysroot_absolute="%{_prefix}"'
GN_DEFINES+=" rustc_version=\"$(rustc --version | awk '{ print $2; }')\""
# 107: Build failure: GN_DEFINES+=" enable_wayland_server=true"
# 124: Fails with
# ld.lld: error: undefined symbol: google::protobuf::compiler::CodeGenerator::GenerateAll(std::__Cr::vector<google::protobuf::FileDescriptor const*, std::__Cr::allocator<google::protobuf::FileDescriptor const*>> const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, google::protobuf::compiler::GeneratorContext*, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>>*) const
# >>> referenced by ld-temp.o
# (probably hardcoded use of bundled headers somewhere...)
#GN_DEFINES+=" perfetto_use_system_protobuf=true"
GN_DEFINES+=" use_v4lplugin=true"
# Can't use vaapi and v4l2_codec at the same time, there is no
# selection at runtime
# GN_DEFINES+=" use_v4l2_codec=true"
GN_DEFINES+=" use_webaudio_ffmpeg=true"
# -gdwarf-4 is for the sake of debugedit
# https://sourceware.org/bugzilla/show_bug.cgi?id=29773
if echo %{__cc} | grep -q clang; then
export CFLAGS="%{optflags} -Qunused-arguments -fPIE -fpie -fPIC -gdwarf-4"
export CXXFLAGS="%{optflags} -Qunused-arguments -fPIE -fpie -fPIC -gdwarf-4"
if echo %{optflags} |grep -qE -- '-O[sz]'; then
# FIXME this should get a real fix
# _Float32 acts up with -Os/-Oz [at compile time]
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2"
fi
export LDFLAGS="%{build_ldflags} -Wl,--thinlto-jobs=$_lto_cpus"
export AR="llvm-ar"
export NM="llvm-nm"
export RANLIB="llvm-ranlib"
else
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
fi
export CC="%{__cc}"
export CXX="%{__cxx}"
python tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
python third_party/libaddressinput/chromium/tools/update-strings.py
%if %{with browser}
out/Release/gn gen --script-executable=/usr/bin/python --args="${GN_DEFINES}" out/Release
#if "%{_libdir}" != "/usr/lib"
# FIXME This should really be fixed where it is created,
# not in the generated files... (but it's hard to spot
# where that is)
# Actually found it: build/rust/rust_bindgen_generator.gni clang_resource_dir
#sed -i -e 's,/usr/lib/clang,%{_libdir}/clang,g' out/Release/toolchain.ninja
#endif
%ifarch %{x86_64}
ninja -C out/Release chrome chrome_sandbox chromedriver
%else
ninja -C out/Release chrome chrome_sandbox
%endif
%endif
%if 0%{?cef:1}
# Apply CEF specific patches and build CEF...
cd cef
./tools/patch.sh
cd ..
# Lastly, try to build it...
# We have to use use_thin_lto=false because LTO in CEF causes
# an OOM while linking libcef.so even on boxes with 64 GB RAM + 64 GB swap
out/Release/gn gen --script-executable=/usr/bin/python --args="${GN_DEFINES} is_cfi=false use_thin_lto=false chrome_pgo_phase=0" out/Release-CEF
ninja -C out/Release-CEF cef chrome_sandbox
%endif
%install
%if %{with browser}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_libdir}/%{name}/locales
mkdir -p %{buildroot}%{_libdir}/%{name}/themes
mkdir -p %{buildroot}%{_libdir}/%{name}/default_apps
mkdir -p %{buildroot}%{_mandir}/man1
install -m 755 %{SOURCE1} %{buildroot}%{_libdir}/%{name}/
install -m 755 out/Release/chrome %{buildroot}%{_libdir}/%{name}/
install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_libdir}/%{name}/chrome-sandbox
install -m 644 out/Release/locales/*.pak %{buildroot}%{_libdir}/%{name}/locales/
install -m 644 out/Release/chrome_100_percent.pak %{buildroot}%{_libdir}/%{name}/
install -m 644 out/Release/resources.pak %{buildroot}%{_libdir}/%{name}/
install -m 755 out/Release/libqt5_shim.so %{buildroot}%{_libdir}/%{name}/
install -m 755 out/Release/libqt6_shim.so %{buildroot}%{_libdir}/%{name}/
# libGLESv2.so/libEGL.so look like dupes from the system, but aren't:
# Loading happens in ui/ozone/common/egl_util.cc -- indicating libGLESv2.so
# and libEGL.so (as opposed to their .1/.2 counterparts) are ANGLE (OpenGL ES
# -> native GL API wrapper)
# Now for most HW that shouldn't be necessary, so we may want to get rid of
# the custom libs and just use Mesa's libraries directly at some point.
install -m 755 out/Release/libGLESv2.so %{buildroot}%{_libdir}/%{name}/
install -m 755 out/Release/libEGL.so %{buildroot}%{_libdir}/%{name}/
# ANGLE data files (fake ICD for custom vulkan bits?), probably needed unless and
# until we drop the custom libEGL/libGLESv2
cp -a out/Release/angledata %{buildroot}%{_libdir}/%{name}/
cp out/Release/vk_swiftshader_icd.json %{buildroot}%{_libdir}/%{name}/
# FIXME is the custom vulkan needed, or is this just dupes from system vulkan
# for prehistoric distros?
install -m 755 out/Release/libvulkan.so.1 %{buildroot}%{_libdir}/%{name}/
install -m 755 out/Release/libvk_swiftshader.so %{buildroot}%{_libdir}/%{name}/
# May or may not be there depending on whether or not we use system icu
[ -e out/Release/icudtl.dat ] && install -m 644 out/Release/icudtl.dat %{buildroot}%{_libdir}/%{name}/
install -m 644 out/Release/*.bin %{buildroot}%{_libdir}/%{name}/
install -m 644 chrome/browser/resources/default_apps/* %{buildroot}%{_libdir}/%{name}/default_apps/
ln -s %{_libdir}/%{name}/chromium-wrapper %{buildroot}%{_bindir}/%{name}
%ifarch %{x86_64}
cp -a out/Release/chromedriver %{buildroot}%{_libdir}/%{name}/chromedriver
ln -s %{_libdir}/%{name}/chromedriver %{buildroot}%{_bindir}/chromedriver
%endif
find out/Release/resources/ -name "*.d" -exec rm {} \;
cp -r out/Release/resources %{buildroot}%{_libdir}/%{name}
# desktop file
mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/applications/
# icon
for i in 24 48 64 128 256; do
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
install -m 644 chrome/app/theme/chromium/product_logo_$i.png \
%{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
# Install the master_preferences file
mkdir -p %{buildroot}%{_sysconfdir}/chromium
install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/chromium
find %{buildroot} -name "*.nexe" -exec strip {} \;
# drirc workaround for VAAPI
mkdir -p %{buildroot}%{_datadir}/drirc.d/
cp %{S:4} %{buildroot}%{_datadir}/drirc.d/10-%{name}.conf
%endif
%if 0%{?cef:1}
# FIXME the packaging here is based on the filesystem layout in
# the binaries referenced in OnlyOffice's
# https://github.com/ONLYOFFICE/build_tools/blob/master/scripts/core_common/modules/cef.py
# such as
# http://d2ettrnqo7v976.cloudfront.net/cef/5414/linux_64/cef_binary.7z
# Is there a better option?
# Adding qt5_shim/qt6_shim stuff is OM specific, hoping to get Qt integration
cd out/Release-CEF
mkdir -p %{buildroot}%{_libdir}/cef/Release \
%{buildroot}%{_libdir}/cef/Resources
cp -a chrome_sandbox libcef.so libEGL.so libGLESv2.so libvk_swiftshader.so libvulkan.so.1 snapshot_blob.bin v8_context_snapshot.bin vk_swiftshader_icd.json libqt5_shim.so libqt6_shim.so %{buildroot}%{_libdir}/cef/Release
# The build process generates chrome_sandbox, but cef binary builds ship chrome-sandbox
# It's the same thing, so let's provide both names to be on the safe side
ln -s chrome_sandbox %{buildroot}%{_libdir}/cef/Release/chrome-sandbox
cp -a chrome_100_percent.pak chrome_200_percent.pak icudtl.dat locales resources.pak %{buildroot}%{_libdir}/cef/Resources
# This is expected by the OBS browser plugin
mkdir -p %{buildroot}%{_libdir}/cef/libcef_dll_wrapper
cd obj/cef
# libcef_dll_wrapper.a is a thin archive, containing references to the object
# files rather than the object files themselves
llvm-ar -t libcef_dll_wrapper.a |xargs llvm-ar cru libcef_dll_wrapper_full.a
mv -f libcef_dll_wrapper_full.a libcef_dll_wrapper.a
llvm-ranlib libcef_dll_wrapper.a
cp libcef_dll_wrapper.a %{buildroot}%{_libdir}/cef/libcef_dll_wrapper
cd ../../../..
# -devel package layout is based on what we see in OnlyOffice's
# desktop-sdk/ChromiumBasedEditors/lib/src/cef/linux
cp -a cef/include %{buildroot}%{_libdir}/cef/
cp -a out/Release-CEF/includes/cef/include/* %{buildroot}%{_libdir}/cef/include/
# Header referenced by cef but not included there
mkdir -p %{buildroot}%{_libdir}/cef/include/base/internal/net/base
cp -a net/base/net_error_list.h %{buildroot}%{_libdir}/cef/include/base/internal/net/base/
cp -a cef/libcef_dll cef/tests %{buildroot}%{_libdir}/cef
%files -n cef
%dir %{_libdir}/cef
%{_libdir}/cef/Release
%exclude %{_libdir}/cef/Release/libqt5_shim.so
%exclude %{_libdir}/cef/Release/libqt6_shim.so
%{_libdir}/cef/Resources
%files -n cef-qt5
%{_libdir}/cef/Release/libqt5_shim.so
%files -n cef-qt6
%{_libdir}/cef/Release/libqt6_shim.so
%files -n cef-devel
%{_libdir}/cef/include