1 |
# eu-strip crashes on chrome binary from this build |
2 |
%define _enable_debug_packages %{nil} |
3 |
%global debug_package %{nil} |
4 |
%global __debug_install_post %{nil} |
5 |
|
6 |
%global use_clang 1 |
7 |
%global system_icu 1 |
8 |
%global system_openjpeg 1 |
9 |
%global system_libtiff 1 |
10 |
# system libevent causes the renderer to get stuck |
11 |
%global system_libevent 0 |
12 |
|
13 |
%if %{system_libevent} |
14 |
%define gn_libevent libevent |
15 |
%endif |
16 |
%if %{use_clang} |
17 |
%define gn_clang is_clang=true |
18 |
%else |
19 |
%define gn_clang is_clang=false |
20 |
%endif |
21 |
|
22 |
%define crname chromium-browser |
23 |
%define _crdir %{_libdir}/%{crname} |
24 |
%define __requires_exclude_from ^%{_crdir}/libwidevinecdmadapter.so$ |
25 |
|
26 |
# eol 'fix' corrupts some .bin |
27 |
%define dont_fix_eol 1 |
28 |
|
29 |
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys |
30 |
# Note: these are for Mageia use ONLY. |
31 |
# For your own builds, please get your own set of keys. |
32 |
%define google_api_key AIzaSyDhhIHB_kQZodiWr8yDAm8E3GwEyiXmuDU |
33 |
%define google_default_client_id 1039996407057-q599ngv7i6ni4sbkd2fsns30246r9s9v.apps.googleusercontent.com |
34 |
%define google_default_client_secret mRHXPjlS4cLpp1beCiXoYbLZ |
35 |
|
36 |
Name: chromium-browser-stable |
37 |
Version: 77.0.3865.70 |
38 |
Release: %mkrel 1 |
39 |
Summary: A fast webkit-based web browser |
40 |
Group: Networking/WWW |
41 |
License: BSD, LGPL |
42 |
URL: http://www.chromium.org/Home |
43 |
# http://omahaproxy.appspot.com/ |
44 |
# http://googlechromereleases.blogspot.com/ |
45 |
Source0: http://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz |
46 |
Source1: chromium-wrapper |
47 |
Source2: chromium-browser.desktop |
48 |
Source4: widevine_cdm_version.h.in |
49 |
# from gentoo: compiler setup |
50 |
Patch1: chromium-compiler-r4.patch |
51 |
# fix googleisms in man page |
52 |
Patch2: chromium-mageia.patch |
53 |
# (cjw) Recognize mimetypes for matroska (.mkv) and AVI (.avi) formats (video/x-matroska and audio/x-matroska, video/x-msvideo) + handle A52 "AC3" and DTS compressed audio. |
54 |
Patch6: chromium-55-extra-media.patch |
55 |
# (cjw) [1/2] Recognize mimetypes for WMV (.wmv), FLV (.flv) and MPEG (.mpg) videos |
56 |
Patch7: chromium-40-wmvflvmpg.patch |
57 |
# (cjw) [2/2] Handle more video codecs. |
58 |
Patch8: chromium-40-sorenson-spark.patch |
59 |
# (cjw) disable external components -- this stops chromium from downloading hotword stuff, for example |
60 |
Patch10: chromium-45-no-external-components.patch |
61 |
# (debian) disable third party cookies by default |
62 |
Patch11: chromium-third-party-cookies-off-by-default.patch |
63 |
# (cjw) fix build error due to android-specific code |
64 |
Patch19: chromium-50-codec-warnings.patch |
65 |
# (cjw) remove assertion on "chromium" branding in combination with enabled "proprietary codecs" |
66 |
Patch22: chromium-54-proprietary-codecs-assert.patch |
67 |
# (cjw) disable werror for a compilation warning that causes the build to fail |
68 |
Patch23: chromium-53-bignum-werror-fix.patch |
69 |
# (cjw) add -Wno-error=depecated-declarations because ffmpeg deprecations cause the build to fail |
70 |
Patch24: chromium-53-ffmpeg-no-deprecation-errors.patch |
71 |
# (cjw) link several libraries directly instead of loading them using dlopen() |
72 |
Patch27: chromium-53-link-libgio-libpci-libudev-libbrlapi.patch |
73 |
# (cjw) add missing unbundle gn files (1) |
74 |
Patch28: chromium-53-gn-system-icu-jsoncpp.patch |
75 |
# (cjw) add missing unbundle gn files (2) |
76 |
Patch29: chromium-53-gn-system-opus.patch |
77 |
%if %{system_libtiff} |
78 |
# (cjw) build pdfium with system libtiff |
79 |
Patch30: chromium-52-pdfium-system-libtiff-libpng.patch |
80 |
%endif |
81 |
%if %{system_openjpeg} |
82 |
# (cjw) fix pdfium build with system openjpeg |
83 |
Patch31: chromium-74-pdfium-system-libopenjpeg2.patch |
84 |
%endif |
85 |
# (cjw) fix build with current glib... |
86 |
Patch36: chromium-58-glib.patch |
87 |
# (cjw) use system nodejs to fix build |
88 |
Patch37: chromium-58-system-nodejs.patch |
89 |
# (cjw) redefined macro |
90 |
Patch40: chromium-59-gcc5.patch |
91 |
# (cjw) fix coding errors resulting in gcc 7 warning |
92 |
Patch54: chromium-62-gcc7.patch |
93 |
# (cjw) fix gcc errors and warnings |
94 |
Patch177: chromium-64-gcc7.patch |
95 |
# (cjw) fix even more gcc warnings |
96 |
Patch179: chromium-65-gcc7.patch |
97 |
# (cjw) fix yet mmore gcc warnings |
98 |
Patch182: chromium-66-gcc7.patch |
99 |
# (cjw) try to get widevine binary plugin to work (must be taken from a chrome download bundle), v2 |
100 |
Patch183: chromium-67-widevine.patch |
101 |
# (cjw) fix a few more gcc warnings |
102 |
Patch184: chromium-67-gcc7.patch |
103 |
# (cjw) more gcc warnings |
104 |
Patch186: chromium-68-gcc7.patch |
105 |
# (cjw) moore gcc warnings |
106 |
Patch188: chromium-68-gcc8.patch |
107 |
# (cjw) and more gcc warnings |
108 |
Patch189: chromium-69-gcc7.patch |
109 |
# (cjw) fix gn bootstrapping with gcc |
110 |
Patch190: chromium-69-gn-bootstrap.patch |
111 |
# (cjw) moooore gcc warnings |
112 |
Patch192: chromium-70-gcc8.patch |
113 |
# (cjw) build fixes for 64-bit arm |
114 |
Patch193: chromium-70-aarch64.patch |
115 |
# (joequant) fix crash on cinnamon |
116 |
Patch194: chromium-69-cinnamon.patch |
117 |
# (cjw) gn bootstrap fix |
118 |
Patch195: chromium-72-gn-bootstrap.patch |
119 |
# (cjw) yet more gcc warnings |
120 |
Patch196: chromium-72-gcc8.patch |
121 |
# (cjw) use system closure compiler |
122 |
Patch197: chromium-72-system-closure-compiler.patch |
123 |
# (cjw) fix i586 build |
124 |
Patch198: chromium-72-i586.patch |
125 |
# (cjw) some more gcc warnings |
126 |
Patch199: chromium-73-gcc8.patch |
127 |
# (cjw) gcc warnings |
128 |
Patch200: chromium-74-gcc8.patch |
129 |
# (cjw) gcc warnings |
130 |
Patch201: chromium-75-gcc8.patch |
131 |
# (cjw) fixes for gcc warnings that do not work with clang |
132 |
%if !%{use_clang} |
133 |
Patch203: chromium-75-gcc-only.patch |
134 |
%endif |
135 |
# (cjw) gcc warnings |
136 |
Patch205: chromium-76-gcc8.patch |
137 |
# (cjw) system zlib build fix |
138 |
Patch206: SOURCES/chromium-77-system-zlib.patch |
139 |
# (cjw) gcc warnings |
140 |
Patch207: chromium-77-gcc9.patch |
141 |
# (cjw) fix missing const qualifiers in pulseaudio prototype |
142 |
Patch208: chromium-77-system-pulseaudio.patch |
143 |
# (cjw) fix build with system icu |
144 |
Patch209: chromium-77-system-icu.patch |
145 |
# (cjw) add missing harfbuzz library to fix link errors |
146 |
Patch210: chromium-77-system-harfbuzz.patch |
147 |
# (cjw) fixes for gcc warnings that do not work with clang |
148 |
%if !%{use_clang} |
149 |
Patch211: chromium-77-gcc-only.patch |
150 |
%endif |
151 |
# (cjw) fixes for build with gcc's libstdc++ |
152 |
Patch212: chromium-77-libstdc++.patch |
153 |
# (cjw) via gentoo, fix renderer crash at startup |
154 |
# from upstream: https://bugs.chromium.org/p/chromium/issues/detail?id=980025 |
155 |
Patch213: chromium-77-std-string.patch |
156 |
# (cjw) via gentoo, specific gcc build fix |
157 |
Patch214: chromium-77-gcc-abstract.patch |
158 |
|
159 |
|
160 |
Provides: %{crname} |
161 |
Obsoletes: chromium-browser-unstable < 26.0.1410.51 |
162 |
Obsoletes: chromium-browser-beta < 26.0.1410.51 |
163 |
Obsoletes: chromium-browser < 1:9.0.597.94 |
164 |
BuildRequires: bison |
165 |
BuildRequires: flex |
166 |
BuildRequires: gperf |
167 |
BuildRequires: icu |
168 |
BuildRequires: ninja |
169 |
BuildRequires: yasm |
170 |
BuildRequires: bzip2-devel |
171 |
#BuildRequires: closure-compiler |
172 |
BuildRequires: cups-devel |
173 |
BuildRequires: elfutils-devel |
174 |
BuildRequires: ffmpeg-devel |
175 |
BuildRequires: glib2-devel |
176 |
BuildRequires: gtk3-devel |
177 |
BuildRequires: libatomic-devel |
178 |
%if %{system_libevent} |
179 |
BuildRequires: libevent-devel |
180 |
%endif |
181 |
BuildRequires: libmesagl-devel |
182 |
BuildRequires: libpam-devel |
183 |
BuildRequires: libpulseaudio-devel |
184 |
BuildRequires: mesaglesv2-devel |
185 |
%if %mgaver >= 6 |
186 |
BuildRequires: nodejs |
187 |
%endif |
188 |
BuildRequires: osmesa-devel |
189 |
#BuildRequires: protobuf-devel |
190 |
BuildRequires: snappy-devel |
191 |
BuildRequires: perl(Switch) |
192 |
BuildRequires: pkgconfig(alsa) |
193 |
BuildRequires: pkgconfig(atk) |
194 |
BuildRequires: pkgconfig(dbus-glib-1) |
195 |
BuildRequires: pkgconfig(expat) |
196 |
BuildRequires: pkgconfig(flac) |
197 |
BuildRequires: pkgconfig(fontconfig) |
198 |
BuildRequires: pkgconfig(freetype2) |
199 |
BuildRequires: pkgconfig(glu) |
200 |
BuildRequires: pkgconfig(gnome-keyring-1) |
201 |
BuildRequires: pkgconfig(gnutls) |
202 |
%if %mgaver >= 7 |
203 |
BuildRequires: pkgconfig(harfbuzz) |
204 |
%endif |
205 |
%if %{system_icu} |
206 |
BuildRequires: pkgconfig(icu-i18n) |
207 |
%endif |
208 |
BuildRequires: pkgconfig(jsoncpp) |
209 |
BuildRequires: pkgconfig(libcap) |
210 |
BuildRequires: pkgconfig(libdrm) |
211 |
BuildRequires: pkgconfig(libexif) |
212 |
BuildRequires: pkgconfig(libjpeg) |
213 |
BuildRequires: pkgconfig(libopenjp2) |
214 |
BuildRequires: pkgconfig(libpci) |
215 |
BuildRequires: pkgconfig(libpng) |
216 |
%if %{system_libtiff} |
217 |
BuildRequires: pkgconfig(libtiff-4) |
218 |
%endif |
219 |
BuildRequires: pkgconfig(libusb-1.0) |
220 |
%if %mgaver >= 7 |
221 |
BuildRequires: pkgconfig(libvpx) |
222 |
%endif |
223 |
BuildRequires: pkgconfig(libwebp) |
224 |
BuildRequires: pkgconfig(libxml-2.0) |
225 |
BuildRequires: pkgconfig(libxslt) |
226 |
BuildRequires: pkgconfig(minizip) |
227 |
BuildRequires: pkgconfig(nspr) |
228 |
BuildRequires: pkgconfig(nss) |
229 |
BuildRequires: pkgconfig(opus) |
230 |
BuildRequires: pkgconfig(speech-dispatcher) |
231 |
BuildRequires: pkgconfig(speex) |
232 |
BuildRequires: pkgconfig(udev) |
233 |
BuildRequires: pkgconfig(xscrnsaver) |
234 |
BuildRequires: pkgconfig(xt) |
235 |
BuildRequires: pkgconfig(xtst) |
236 |
BuildRequires: pkgconfig(zlib) |
237 |
%if %{use_clang} |
238 |
BuildRequires: clang |
239 |
%endif |
240 |
|
241 |
# Unused but building gn wants it to be present |
242 |
BuildRequires: pkgconfig(gconf-2.0) |
243 |
BuildRequires: git |
244 |
ExclusiveArch: i586 x86_64 |
245 |
# aarch64 does not build without fewer than default parallel jobs config |
246 |
# armv5tl armv7hl |
247 |
|
248 |
%description |
249 |
Chromium is a browser that combines a minimal design with sophisticated |
250 |
technology to make the web faster, safer, and easier. |
251 |
|
252 |
For certain media playback features - AAC decoding - this package |
253 |
currently assumes decoder support is available, while that is only true if |
254 |
the 'tainted' variety of the libavcodec package is installed. When the 'core' |
255 |
variety of libavcodec is installed, chromium may output noise for AAC audio. |
256 |
|
257 |
%ifarch %{ix86} |
258 |
The i586 build of this package does not work on machines that do not |
259 |
support the SSE2 instruction set extension. |
260 |
%endif |
261 |
|
262 |
%package -n chromium-browser |
263 |
Summary: A fast webkit-based web browser (transition package) |
264 |
Epoch: 1 |
265 |
Group: Networking/WWW |
266 |
Requires: %{name} = %{version}-%{release} |
267 |
|
268 |
%description -n chromium-browser |
269 |
Chromium is a browser that combines a minimal design with sophisticated |
270 |
technology to make the web faster, safer, and easier. |
271 |
|
272 |
This is a transition package that installs the stable channel Chromium |
273 |
browser. |
274 |
|
275 |
%prep |
276 |
%setup -q -n chromium-%{version} |
277 |
%autopatch -p1 |
278 |
|
279 |
# files we do not want from upstream source bundles |
280 |
rm -r --interactive=never third_party/breakpad/breakpad/src/processor/testdata/ |
281 |
rm -r --interactive=never third_party/breakpad/breakpad/src/tools |
282 |
rm -r --interactive=never chrome/common/extensions/docs/ |
283 |
rm -r --interactive=never chrome/test/data/{android,app_shim,apptest,ash,autofill,automation,automation_proxy_snapshot,banners,bookmark_html_reader,bookmarks,captive_portal,chromedriver,chrome_endure,chromeos,click_modifier,components,constrained_files,content,content_setting_bubble,devtools,diagnostics,dom_automation,dom_checker,dom_distiller,downloads,drive_first_run,dromaeo,durable,edge_database_reader,edge_profile,encoding_tests,extensions,fast_shutdown,fast_tab_close,favicon,feeds,file_select_helper,find_in_page,firefox320_profile,firefox35_profile,firefox3_nss,firefox3_nss_mac,firefox3_profile,firefox_profile,firefox_searchplugins,focus,frame_dom_access,frame_tree,ftp,fullscreen_mouselock,geolocation,google,gpu,History,image_decoding,image_search,import,indexeddb,inspector,installer,interstitial_page,login,native_messaging,navigation_interception,notifications,page_cycler,page_load_metrics,password,pdf,pepper,perf,permissions,plugin_power_saver,policy,popup_blocker,predictor,prefs,pref_service,prerender,printing,profiles,push_messaging,referrer_policy,safe_browsing,save_page,scroll,session_history,session_restore,sessions,settings,speech,ssl,subresource_filter,sunspider,sync,template_url_scraper,textinput,third_party,top_sites,translate,unit,v8_benchmark_v6,viewsource,web_app_info,webrtc,websocket,webui_test_resources.grd,whitelists,workers} |
284 |
rm -r --interactive=never chrome/test/data/nacl/{pnacl_error_handling,cross_origin,irt_exception,pnacl_request_header,nonsfi,pnacl_url_loader,pnacl_hw_eh_disabled,pnacl_nmf_options,pnacl_dyncode_syscall_disabled,extension_mime_handler,ppapi_test_lib,bad,ppapi,manifest,pnacl_debug_url,extension_validation_cache,exit_status,progress_events,manifest_file,sysconf_nprocessors_onln,crash,pnacl_mime_type} |
285 |
rmdir chrome/test/data/webui/{settings,extensions}/a11y |
286 |
rmdir chrome/test/data/webui/settings/chromeos |
287 |
rmdir chrome/test/data/webui/{engagement,extensions,print_preview,cr_elements,settings,history,net_internals} |
288 |
rm -r --interactive=never components/test/data/update_client/jebgalgnebhfojomionfpkfelancnnkf/component1.dll |
289 |
rm -r --interactive=never content/test/data/ |
290 |
rm -r --interactive=never ppapi/native_client/tests/ |
291 |
rm -r --interactive=never third_party/apache-win32/ |
292 |
rm -r --interactive=never third_party/binutils/ |
293 |
rm -r --interactive=never third_party/expat/files/ |
294 |
rm -r --interactive=never third_party/ffmpeg/*/* |
295 |
rm -r --interactive=never third_party/flac/{include,src} |
296 |
rm -r --interactive=never third_party/icu/{android,android_small,common,patches,source,chromeos,ios} |
297 |
rm -r --interactive=never third_party/jsoncpp/source |
298 |
rm -r --interactive=never third_party/lcov |
299 |
rm -r --interactive=never third_party/libvpx/source/{libvpx,config} |
300 |
rm -r --interactive=never third_party/libjpeg/*.[ch] |
301 |
rm -r --interactive=never third_party/libjpeg_turbo/*.[ch] |
302 |
rm -r --interactive=never third_party/libpng/*.[ch] |
303 |
rm -r --interactive=never third_party/libxslt/{linux,mac,src,win32} |
304 |
rm -r --interactive=never third_party/xdg-utils/tests/ |
305 |
rm -r --interactive=never third_party/yasm/source/ |
306 |
rm -r --interactive=never third_party/zlib/{*.[ch],contrib/minizip} |
307 |
rm -r --interactive=never native_client_sdk/src/tools/lib/tests/data |
308 |
rm -r --interactive=never buildtools/third_party/eu-strip/bin |
309 |
rm -r --interactive=never third_party/pdfium/third_party/eu-strip |
310 |
rm --interactive=never third_party/pdfium/third_party/libopenjpeg20/*.[ch] |
311 |
rm -r --interactive=never third_party/pdfium/third_party/libpng16 |
312 |
%if %{system_libtiff} |
313 |
rm --interactive=never third_party/pdfium/third_party/libtiff/*.[ch] |
314 |
%endif |
315 |
rm -r --interactive=never third_party/pdfium/third_party/yasm/source |
316 |
rm --interactive=never third_party/swiftshader/third_party/PowerVR_SDK/Utilities/Filewrap/Windows_x86_32/Filewrap.exe |
317 |
rm --interactive=never native_client/tools/redirector.exe |
318 |
rm --interactive=never third_party/webrtc/data/voice_engine/stereo_rtp_files/rtpplay.exe |
319 |
rm -r --interactive=never third_party/llvm |
320 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/SanOGLES-Gerbera.exe |
321 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/SanOGLES-PVRSDK.exe |
322 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/libGLES_CM.dll |
323 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/bob/bob |
324 |
rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/glut/SanOGLES |
325 |
rm --interactive=never third_party/lzma_sdk/Executable/7za.exe |
326 |
rm --interactive=never third_party/lzma_sdk/7zr.exe |
327 |
rm --interactive=never third_party/breakpad/symupload.exe |
328 |
rm -r --interactive=never third_party/catapult/third_party/google-endpoints/setuptools |
329 |
rm -r --interactive=never third_party/catapult/third_party/vinn/third_party/v8 |
330 |
rm --interactive=never third_party/depot_tools/ninja.exe |
331 |
rm --interactive=never third_party/depot_tools/ninja-linux32 |
332 |
rm --interactive=never third_party/depot_tools/ninja-linux64 |
333 |
rm -r --interactive=never native_client/tools/hermetic_cygwin |
334 |
rm -r --interactive=never base/test/data/pe_image/ |
335 |
rm -r --interactive=never base/test/data/file_version_info_unittest |
336 |
rm -r --interactive=never chrome/chrome_cleaner/test/resources/signed_dll |
337 |
rm --interactive=never third_party/crashpad/crashpad/handler/win/z7_test.dll |
338 |
rm -r --interactive=never third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_fuzzer_corpus |
339 |
rm -r --interactive=never third_party/boringssl/src/util/ar/testdata |
340 |
rm -r --interactive=never third_party/pyelftools/test/testfiles_for_unittests |
341 |
rm -r --interactive=never third_party/pyelftools/test/external_tools |
342 |
rm -r --interactive=never third_party/pyelftools/test/testfiles_for_readelf |
343 |
rm -r --interactive=never third_party/pyelftools/examples |
344 |
rm -r --interactive=never third_party/skia/platform_tools/android/bin |
345 |
rm --interactive=never third_party/nasm/travis/test/tmap.o.t |
346 |
rm -r --interactive=never third_party/chromite/lib/datafiles |
347 |
rm -r --interactive=never components/test/data/update_client |
348 |
rm -r --interactive=never build/android/tests/symbolize |
349 |
|
350 |
rm --interactive=never third_party/skia/platform_tools/android/apps/gradle/wrapper/gradle-wrapper.jar |
351 |
rm -r --interactive=never third_party/sfntly/src/java/lib |
352 |
rm --interactive=never third_party/libphonenumber/dist/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar |
353 |
rm --interactive=never third_party/libphonenumber/dist/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar |
354 |
rm -r --interactive=never third_party/libphonenumber/dist/java/demo/war/WEB-INF/lib |
355 |
rm -r --interactive=never third_party/libphonenumber/dist/java/lib |
356 |
rm --interactive=never third_party/webrtc/examples/androidapp/third_party/autobanh/lib/autobanh.jar |
357 |
rm -r --interactive=never third_party/cacheinvalidation/src/example-app-build/libs |
358 |
rm --interactive=never third_party/closure_compiler/compiler/compiler.jar |
359 |
rm -r --interactive=never third_party/sfntly/src/cpp/ext |
360 |
rm --interactive=never third_party/bazel/desugar/Desugar-runtime.jar |
361 |
rm --interactive=never third_party/flatbuffers/src/android/gradle/wrapper/gradle-wrapper.jar |
362 |
rm --interactive=never third_party/flatbuffers/src/samples/android/gradle/wrapper/gradle-wrapper.jar |
363 |
rm --interactive=never third_party/blink/renderer/devtools/scripts/closure/compiler.jar |
364 |
rm --interactive=never third_party/blink/renderer/devtools/scripts/closure/closure_runner/closure_runner.jar |
365 |
rm --interactive=never third_party/blink/renderer/devtools/scripts/jsdoc_validator/jsdoc_validator.jar |
366 |
rm --interactive=never third_party/gradle_wrapper/gradle/wrapper/gradle-wrapper.jar |
367 |
rm --interactive=never third_party/webgl/src/conformance-suites/2.0.0/deqp/compiler.jar |
368 |
|
369 |
%if %{system_libevent} |
370 |
find base/third_party/libevent -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete |
371 |
%endif |
372 |
|
373 |
%if %{system_icu} |
374 |
# Remove bundled ICU; its header files appear to get picked up instead of |
375 |
# the system ones, leading to errors during the final link stage. |
376 |
# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q |
377 |
find third_party/icu -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete |
378 |
%endif |
379 |
|
380 |
# Hard code extra version |
381 |
FILE=chrome/common/channel_info_posix.cc |
382 |
sed -i.orig -re 's/char\s*\*(.*)getenv\("CHROME_VERSION_EXTRA"\)/char const *\1"%{product_vendor} %{product_version}"/' $FILE |
383 |
if diff -u $FILE $FILE.orig >/dev/null; then |
384 |
exit 1 |
385 |
fi |
386 |
|
387 |
# version taken from: strings opt/google/chrome-unstable/chrome | grep -C 1 " (version:" |
388 |
%define widevine_version 1.4.8.1008 |
389 |
for chrome_arch in ia32 x64; do |
390 |
mkdir -p third_party/widevine/cdm/linux/${chrome_arch} |
391 |
sed -e "s/@WIDEVINE_VERSION@/%{widevine_version}/" %{SOURCE4} > third_party/widevine/cdm/linux/${chrome_arch}/widevine_cdm_version.h |
392 |
done |
393 |
|
394 |
%build |
395 |
%if %mgaver >= 7 |
396 |
%define system_gn_list ffmpeg flac libwebp libxml libxslt snappy yasm libvpx libpng icu zlib jsoncpp opus libdrm %{?gn_libevent} |
397 |
%else |
398 |
%define system_gn_list ffmpeg flac libwebp libxml libxslt snappy yasm libpng icu zlib jsoncpp opus libdrm |
399 |
%endif |
400 |
# handled by upstream regular build scripts? : freetype harfbuzz-ng |
401 |
# mesa |
402 |
|
403 |
# v NO TABS IN HERE! |
404 |
%define gn_config use_sysroot=false \ |
405 |
system_libdir="%{_lib}" \ |
406 |
icu_use_data_file=true \ |
407 |
enable_nacl=false \ |
408 |
is_nacl_glibc=false \ |
409 |
binutils_path="%{_bindir}" \ |
410 |
linux_use_bundled_binutils=false \ |
411 |
custom_toolchain="//build/toolchain/linux/unbundle:default" \ |
412 |
host_toolchain="//build/toolchain/linux/unbundle:default" \ |
413 |
proprietary_codecs=true \ |
414 |
enable_ac3_eac3_audio_demuxing=true \ |
415 |
enable_mse_mpeg2ts_stream_parser=true \ |
416 |
enable_hevc_demuxing=true \ |
417 |
use_system_libjpeg=true \ |
418 |
use_system_libopenjpeg2=true \ |
419 |
use_libjpeg_turbo=false \ |
420 |
enable_widevine=true \ |
421 |
pdf_enable_xfa=true \ |
422 |
gtk_version=3 \ |
423 |
fatal_linker_warnings=false \ |
424 |
use_libpci = true \ |
425 |
use_pulseaudio=true \ |
426 |
use_allocator="none" \ |
427 |
is_debug=false \ |
428 |
%{?gn_clang} \ |
429 |
clang_use_chrome_plugins=false \ |
430 |
use_lld=false \ |
431 |
use_system_freetype=true \ |
432 |
use_system_harfbuzz=true \ |
433 |
use_system_libpng=true \ |
434 |
use_custom_libcxx=false \ |
435 |
closure_compile=false \ |
436 |
google_api_key="%{google_api_key}" \ |
437 |
google_default_client_id="%{google_default_client_id}" \ |
438 |
google_default_client_secret="%{google_default_client_secret}" |
439 |
|
440 |
|
441 |
# enable_browser_cdms=true \ |
442 |
|
443 |
build/linux/unbundle/replace_gn_files.py --system-libraries %{system_gn_list} |
444 |
third_party/libaddressinput/chromium/tools/update-strings.py |
445 |
|
446 |
%setup_compile_flags |
447 |
%if %{use_clang} |
448 |
CC=clang; export CC |
449 |
CXX=clang++; export CXX |
450 |
%else |
451 |
CC=%{__cc}; export CC |
452 |
CXX=%{__cxx}; export CXX |
453 |
%endif |
454 |
AR=%{__ar}; export AR |
455 |
NM=%{__nm}; export NM |
456 |
LD="%{__cxx} -fuse-ld=gold"; export LD |
457 |
|
458 |
# filter out -g from CFLAGS and CXXFLAGS to fix builds |
459 |
CFLAGS=$(echo "$CFLAGS"|sed -e 's/-g //') |
460 |
CXXFLAGS=$(echo "$CXXFLAGS"|sed -e 's/-g //') |
461 |
CXXFLAGS="$CXXFLAGS -faligned-new -Wno-attributes" |
462 |
%if %{use_clang} |
463 |
CFLAGS="$CFLAGS -Wno-error=unused-result" |
464 |
CXXFLAGS="$CXXFLAGS -Wno-error=deprecated-declarations" |
465 |
%else |
466 |
CXXFLAGS="$CXXFLAGS -Wno-error=class-memaccess -Wno-error=unknown-pragmas -Wno-error=array-bounds" |
467 |
%endif |
468 |
%ifarch %ix86 |
469 |
LDFLAGS="$LDFLAGS -Wl,--no-keep-files-mapped" |
470 |
%endif |
471 |
|
472 |
%ifarch %{ix86} |
473 |
CFLAGS="$CFLAGS -msse2" |
474 |
CXXFLAGS="$CXXFLAGS -msse2" |
475 |
%endif |
476 |
|
477 |
python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}' |
478 |
|
479 |
out/Release/gn gen --args='%{gn_config}' out/Release |
480 |
|
481 |
pushd out/Release |
482 |
ninja %{_smp_mflags} chrome chrome_sandbox |
483 |
popd |
484 |
|
485 |
# man page |
486 |
sed -e "s/@@PACKAGE@@/chromium/" -e "s/@@MENUNAME@@/Chromium Web Browser/" chrome/app/resources/manpage.1.in >out/Release/chromium.1 |
487 |
|
488 |
%install |
489 |
ls out/Release |
490 |
mkdir -p %{buildroot}%{_bindir} |
491 |
mkdir -p %{buildroot}%{_crdir}/locales |
492 |
mkdir -p %{buildroot}%{_crdir}/themes |
493 |
mkdir -p %{buildroot}%{_crdir}/default_apps |
494 |
mkdir -p %{buildroot}%{_mandir}/man1 |
495 |
install -m 755 %{_sourcedir}/chromium-wrapper %{buildroot}%{_crdir}/ |
496 |
install -m 755 out/Release/chrome %{buildroot}%{_crdir}/ |
497 |
install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_crdir}/chrome-sandbox |
498 |
install -m 644 out/Release/chromium.1 %{buildroot}%{_mandir}/man1/%{crname}.1 |
499 |
install -m 644 out/Release/chrome_100_percent.pak %{buildroot}%{_crdir}/ |
500 |
install -m 644 out/Release/chrome_200_percent.pak %{buildroot}%{_crdir}/ |
501 |
install -m 644 out/Release/resources.pak %{buildroot}%{_crdir}/ |
502 |
install -m 644 out/Release/natives_blob.bin %{buildroot}%{_crdir}/ |
503 |
install -m 644 out/Release/snapshot_blob.bin %{buildroot}%{_crdir}/ |
504 |
install -m 755 out/Release/mksnapshot %{buildroot}%{_crdir}/ |
505 |
install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/ |
506 |
install -m 644 chrome/browser/resources/default_apps/* %{buildroot}%{_crdir}/default_apps/ |
507 |
install -m 644 out/Release/v8_context_snapshot.bin %{buildroot}%{_crdir}/ |
508 |
ln -s %{_crdir}/chromium-wrapper %{buildroot}%{_bindir}/%{crname} |
509 |
|
510 |
%ifarch %{ix86} x86_64 |
511 |
mkdir -p %{buildroot}%{_crdir}/swiftshader |
512 |
install -m 755 out/Release/swiftshader/*.so %{buildroot}%{_crdir}/swiftshader/ |
513 |
%endif |
514 |
|
515 |
find out/Release/resources/ -name "*.d" -exec rm {} \; |
516 |
cp -r out/Release/resources %{buildroot}%{_crdir} |
517 |
|
518 |
# desktop file |
519 |
mkdir -p %{buildroot}%{_datadir}/applications |
520 |
install -m 644 %{_sourcedir}/%{crname}.desktop %{buildroot}%{_datadir}/applications/ |
521 |
|
522 |
%if %{system_icu} |
523 |
# symlink to ICU data file |
524 |
ICUDATADIR=$(icuinfo | grep \"icudata.path\" | sed -re 's/^.*>(.*)<.*$/\1/') |
525 |
ICUDATANAME=$(icuinfo | grep \"icudata.name\" | sed -re 's/^.*>(.*)<.*$/\1/') |
526 |
ICUDATAFILE=$(realpath --relative-to=%{_crdir}/ ${ICUDATADIR}/${ICUDATANAME}.dat) |
527 |
ln -s ${ICUDATAFILE} %{buildroot}%{_crdir}/icudtl.dat |
528 |
%else |
529 |
install -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/ |
530 |
%endif |
531 |
|
532 |
# icon |
533 |
for i in 22_mono 24 48 64 128 256; do |
534 |
mkdir -p %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps |
535 |
install -m 644 chrome/app/theme/chromium/product_logo_$i.png \ |
536 |
%{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/%{crname}.png |
537 |
done |
538 |
|
539 |
for i in 16 32; do |
540 |
mkdir -p %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps |
541 |
install -m 644 chrome/app/theme/default_100_percent/chromium/product_logo_$i.png \ |
542 |
%{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/%{crname}.png |
543 |
done |
544 |
|
545 |
%files -n chromium-browser |
546 |
|
547 |
%files |
548 |
%{_bindir}/%{crname} |
549 |
%dir %{_crdir} |
550 |
%{_crdir}/chromium-wrapper |
551 |
%{_crdir}/chrome |
552 |
%attr(4755,root,root) %{_crdir}/chrome-sandbox |
553 |
%{_crdir}/icudtl.dat |
554 |
%{_crdir}/locales |
555 |
%{_crdir}/natives_blob.bin |
556 |
%{_crdir}/snapshot_blob.bin |
557 |
%{_crdir}/resources.pak |
558 |
%{_crdir}/resources |
559 |
%{_crdir}/chrome_100_percent.pak |
560 |
%{_crdir}/chrome_200_percent.pak |
561 |
%{_crdir}/mksnapshot |
562 |
%{_crdir}/themes |
563 |
%{_crdir}/default_apps |
564 |
%ifarch %{ix86} x86_64 |
565 |
%{_crdir}/swiftshader |
566 |
%endif |
567 |
%{_crdir}/v8_context_snapshot.bin |
568 |
%{_mandir}/man1/%{crname}* |
569 |
%{_datadir}/applications/*.desktop |
570 |
%{_iconsdir}/hicolor/*/apps/%{crname}.png |