# eu-strip crashes on chrome binary from this build %define _enable_debug_packages 0 %global debug_package %{nil} %global __debug_install_post %{nil} %global use_gold 0 %global use_clang 0 %global use_vaapi 1 #squidf:build error with chromium 97:%%global warnings_as_errors 1 %global warnings_as_errors 0 %global system_icu 1 %global system_harfbuzz 1 %global system_openjpeg 1 %global system_libtiff 1 %global system_libvpx 0 %global system_dav1d 1 %global system_re2 1 %global system_fontconfig 1 %global system_freetype 1 # system libevent causes the renderer to get stuck %global system_libevent 0 %if %{use_gold} %define gn_gold use_gold=true %else %define gn_gold use_gold=false %endif %if %{system_icu} %define gn_icu icu %endif %if %{system_libvpx} %define gn_libvpx libvpx %endif %if %{system_dav1d} %define gn_dav1d dav1d %endif %if %{system_re2} %define gn_re2 re2 %endif %if %{system_fontconfig} %define gn_fontconfig fontconfig %endif %if %{system_freetype} %define gn_freetype use_system_freetype=true %endif %if %{system_libevent} %define gn_libevent libevent %endif %if %{use_vaapi} %define gn_vaapi use_vaapi=true %else %define gn_vaapi use_vaapi=false %endif %if %{use_clang} %define gn_clang is_clang=true %else %define gn_clang is_clang=false %endif %if %{warnings_as_errors} #squidf: added as above for consistency %define gn_warnings_as_errors treat_warnings_as_errors=true %else %define gn_warnings_as_errors treat_warnings_as_errors=false %endif #squidf:test added here to be independant of Mageia version %if %{system_harfbuzz} %define gn_harfbuzz use_system_harfbuzz=true %else %define gn_harfbuzz use_system_harfbuzz=false %endif %define crname chromium-browser %define _crdir %{_libdir}/%{crname} %define __requires_exclude_from ^%{_crdir}/libwidevinecdmadapter.so$ # eol 'fix' corrupts some .bin %define dont_fix_eol 1 # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys # Note: these are for Mageia use ONLY. # For your own builds, please get your own set of keys. %define google_api_key AIzaSyDhhIHB_kQZodiWr8yDAm8E3GwEyiXmuDU Name: chromium-browser-stable Version: 97.0.4692.99 Release: %mkrel 1 Summary: A fast webkit-based web browser Group: Networking/WWW License: BSD, LGPL URL: http://www.chromium.org/Home # http://omahaproxy.appspot.com/ # http://googlechromereleases.blogspot.com/ Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz Source1: chromium-wrapper Source2: chromium-browser.desktop #Applications preferences at startup Source13: master_preferences # from gentoo: compiler setup #squidf: update for 97_71 Patch1: chromium-97-compiler-r4.patch # fix googleisms in man page Patch2: chromium-mageia.patch # (ns80) use a patch rather than a source file for widevine Patch3: chromium-71.0.3578.98-widevine-r3.patch # (ns80) remove unrar #squidf: adjusted for ungg already applied patch and 95.0.4606.61 # - conflict with chrome/services/file_util/safe_archive_analyzer.cc patch # - conflict with chrome/common/safe_browsing/BUILD.gn patch Patch4: chromium-96-norar.patch # (cjw) [1/4] 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. #squidf: extra-media.patch splitted to account for Chromium 95 code update #squidf: update for 97_71 Patch6: chromium-97-extra-media.patch # (cjw) [2/4] Recognize mimetypes for WMV (.wmv), FLV (.flv) and MPEG (.mpg) videos #squidf: splitted for chromium 95.0.4638.54 and merged with chromium-95-extra-media.patch Patch7: chromium-95-wmvflvmpg.patch # (cjw) [3/4] Handle more video codecs. #squidf: splitted for chromium 95.0.4638.54 and merged with chromium-95-extra-media.patch Patch8: chromium-95-sorenson-spark.patch # (cjw) [4/4] Add a profile for each added video codec and merged with chromium-95-extra-media.patch #squidf: splitted for chromium 95.0.4638.54 Patch9: chromium-95-extra-media-video-profiles.patch # (cjw) disable external components -- this stops chromium from downloading hotword stuff, for example Patch10: chromium-96-no-external-components.patch # (debian) disable third party cookies by default Patch11: chromium-third-party-cookies-off-by-default.patch # (cjw) fix build error due to android-specific code Patch19: chromium-50-codec-warnings.patch # (cjw) remove assertion on "chromium" branding in combination with enabled "proprietary codecs" Patch22: chromium-54-proprietary-codecs-assert.patch # (cjw) disable werror for a compilation warning that causes the build to fail Patch23: chromium-53-bignum-werror-fix.patch # (cjw) add -Wno-error=depecated-declarations because ffmpeg deprecations cause the build to fail Patch24: chromium-53-ffmpeg-no-deprecation-errors.patch # (cjw) link several libraries directly instead of loading them using dlopen() Patch27: chromium-53-link-libgio-libpci-libudev-libbrlapi.patch # (cjw) add missing unbundle gn files (1) Patch28: chromium-53-gn-system-icu-jsoncpp.patch # (cjw) add missing unbundle gn files (2) Patch29: chromium-53-gn-system-opus.patch %if %{system_libtiff} # (cjw) build pdfium with system libtiff #squidf: update for chromium 96.0.4664.45 Patch30: chromium-96-pdfium-system-libtiff-libpng.patch %endif %if %{system_openjpeg} # (cjw) fix pdfium build with system openjpeg Patch31: chromium-74-pdfium-system-libopenjpeg2.patch %endif # (cjw) fix build with current glib... Patch36: chromium-58-glib.patch # (cjw) use system nodejs to fix build Patch37: chromium-58-system-nodejs.patch # (cjw) use system closure compiler #squidf: update for 97_71 Patch38: chromium-97-system-closure-compiler.patch # (cjw) fix build with system icu Patch39: chromium-77-system-icu.patch # (cjw) support using system dav1d Patch41: chromium-79-system-dav1d.patch # (cjw) gcc errors: redefined macros Patch80: chromium-gcc-macro-redefined.patch # (cjw) gcc errors: include files #squidf: update for 97_71 Patch81: chromium-97-gcc-includes.patch # (cjw) gcc warnings: suggested parentheses #squidf: update for 96 Patch82: chromium-96-gcc-parentheses.patch # (cjw) gcc warnings: missing casts #squidf: update for 97_71 Patch84: chromium-97-gcc-type-errors.patch # (cjw) gcc errors: multiple character literals #squidf: to handle code change in Chromium 95.0.4638.54 Patch85: chromium-95-gcc-character-literals.patch # (cjw) gcc constexpr problems #squidf: ajustment for 96 Patch87: chromium-96-gcc-constexpr.patch # (cjw) gcc anonymous namespace problems #squidf: update for 97_71 Patch88: chromium-97-gcc-anonymous-namespace.patch # (cjw) gcc noexcept problems #squidf: update for 96 Patch89: chromium-96-gcc-noexcept.patch # (cjw) gcc warnings: variable assigned in own assignment rhs Patch90: chromium-gcc-double-assignment.patch # (cjw) gcc warnings: optional constructs Patch91: chromium-gcc-optional.patch # (cjw) gcc - unclear... #squidf: update for 97_71 Patch93: chromium-97-gcc-unsorted.patch %if !%{use_clang} # (cjw) gcc disabled warnings #squidf: to handle code change in Chromium 96... Patch94: chromium-96-gcc-disabled-warnings.patch Patch95: chromium-gcc-va_args.patch %endif # (cjw) gcc warnings: suggest explicit braces to avoid ambiguous else [-Werror=dangling-else] #squidf: update for 97_71 Patch97: chromium-97-gcc-braces.patch # (cjw) alignment problems Patch188: chromium-68-gcc8.patch # (cjw) fix gn bootstrapping with gcc Patch190: chromium-69-gn-bootstrap.patch # (cjw) gn bootstrap fix Patch195: chromium-72-gn-bootstrap.patch # (cjw) fix i586 build Patch198: chromium-72-i586.patch # (cjw) fix build with system zlib Patch240: chromium-85-system-zlib.patch # (cjw) fix angle-vulkan build with system zlib Patch243: chromium-87-system-zlib.patch # (cjw) fix broken system libvpx build Patch244: chromium-88-system-libvpx.patch #squidf: additional fix build with system zlib for Chromium 96 Patch245: chromium-96-system-zlib.patch # (cjw) fix i586 build #Patch248: chromium-87-i586.patch # (ns80) try to fix mga#28631 / updated patch from gentoo Patch250: chromium-96-EnumTable-crash.patch # (cjw) fix build with "old" system freetype Patch254: chromium-94-system-freetype.patch # (cjw) fix build with system ffmpeg Patch255: chromium-94-system-ffmpeg.patch # (cjw) fix crash in DCHECK() while logging metrics Patch256: chromium-94-GetNeverPromptSitesBetween-crash.patch %if %{use_clang} %if %mgaver <= 8 #squidf: to use clang11 instead of clang13 (unknown option -ffile-compilation-dir) #squidf: update for 97_71 Patch259: chromium-97-clang_compiler.patch %else #squidf:geentoo patch to pass sandbox/linux/services/credentials.cc:103:16: error: variable-sized object may not be initialized # https://bugs.gentoo.org/823857 Patch261: chromium-97-clang-variable-size-object.patch #squidf:from openSUSE tumbleweed Patch262: chromium-97-compiler.patch %endif Patch260: chromium-clang-nomerge.patch %endif #squidf: additional patch, usually, to fix compilation errors #From Arch linux to fix compiler error media/filters/ffmpeg_demuxer.cc:1599:9: error: use of undeclared identifier 'av_stream_get_first_dts' Patch300: chromium-97-ffmpeg-av_stream_get_first_dts.patch #squidf:FIX ME. Temporary patch to fix math_extras.h:130:18: error: constexpr function never produces a constant expression Patch301: chromium-97-constexpr-compiler.patch #squidf:from openSUSE tumbleweed Patch302: chromium-97-ScrollView-reference.patch Patch303: chromium-91-sql-standard-layout-type.patch Patch304: chromium-94-sql-no-assert.patch Patch305: chromium-gcc11.patch Provides: %{crname} Obsoletes: chromium-browser-unstable < 26.0.1410.51 Obsoletes: chromium-browser-beta < 26.0.1410.51 Obsoletes: chromium-browser < 1:9.0.597.94 BuildRequires: bison BuildRequires: flex BuildRequires: gperf %if %{system_icu} BuildRequires: icu %endif BuildRequires: ninja #squidf: move to Python3: BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python3-beautifulsoup4 BuildRequires: python3-html5lib BuildRequires: python3-markupsafe BuildRequires: python3-ply BuildRequires: python3-simplejson #BuildRequires: yasm BuildRequires: bzip2-devel #BuildRequires: closure-compiler BuildRequires: cups-devel BuildRequires: elfutils-devel BuildRequires: ffmpeg-devel BuildRequires: glib2-devel BuildRequires: gtk3-devel BuildRequires: libatomic-devel %if %{system_libevent} BuildRequires: libevent-devel %endif BuildRequires: libmesagl-devel BuildRequires: libpam-devel BuildRequires: libpulseaudio-devel BuildRequires: mesaglesv2-devel %if %mgaver >= 6 BuildRequires: nodejs %endif BuildRequires: osmesa-devel #BuildRequires: protobuf-devel BuildRequires: snappy-devel BuildRequires: perl(Switch) BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(atk) %if %{system_dav1d} BuildRequires: pkgconfig(dav1d) %endif BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(flac) %if %{system_fontconfig} BuildRequires: pkgconfig(fontconfig) %endif BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(gnome-keyring-1) BuildRequires: pkgconfig(gnutls) #squidf:test not based on Mageia version anymore %if %{system_harfbuzz} BuildRequires: pkgconfig(harfbuzz) %endif %if %{system_icu} BuildRequires: pkgconfig(icu-i18n) %endif BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(libcap) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libexif) BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpci) BuildRequires: pkgconfig(libpng) %if %{system_libtiff} BuildRequires: pkgconfig(libtiff-4) %endif BuildRequires: pkgconfig(libusb-1.0) %if %{system_libvpx} BuildRequires: pkgconfig(libvpx) %endif BuildRequires: pkgconfig(libwebp) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(minizip) BuildRequires: pkgconfig(nspr) BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(opus) %if %{system_re2} BuildRequires: pkgconfig(re2) %endif BuildRequires: pkgconfig(speech-dispatcher) BuildRequires: pkgconfig(speex) BuildRequires: pkgconfig(udev) BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(zlib) %if %{use_clang} BuildRequires: clang BuildRequires: lld %endif BuildRequires: clang-tools-extra # Unused but building gn wants it to be present BuildRequires: pkgconfig(gconf-2.0) BuildRequires: git ExclusiveArch: i586 x86_64 # aarch64 does not build without fewer than default parallel jobs config # armv5tl armv7hl %description Chromium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. For certain media playback features - AAC decoding - this package currently assumes decoder support is available, while that is only true if the 'tainted' variety of the libavcodec package is installed. When the 'core' variety of libavcodec is installed, chromium may output noise for AAC audio. %ifarch %{ix86} The i586 build of this package does not work on machines that do not support the SSE2 instruction set extension. %endif %package -n chromium-browser Summary: A fast webkit-based web browser (transition package) Epoch: 1 Group: Networking/WWW Requires: %{name} = %{version}-%{release} %description -n chromium-browser Chromium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. This is a transition package that installs the stable channel Chromium browser. %prep %setup -q -n chromium-%{version} %autopatch -p1 # files we do not want from upstream source bundles rm -r --interactive=never third_party/breakpad/breakpad/src/processor/testdata/ rm -r --interactive=never third_party/breakpad/breakpad/src/tools 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,focus,frame_dom_access,frame_tree,fullscreen_mouselock,geolocation,google,gpu,History,image_decoding,image_search,import,indexeddb,inspector,installer,interstitial_page,login,native_messaging,navigation_interception,notifications,page_cycler,page_load_metrics,password,pepper,perf,permissions,plugin_power_saver,policy,popup_blocker,predictor,prefs,pref_service,prerender,printing,profiles,push_messaging,referrer_policy,safe_browsing,save_page,scroll,session_history,session_restore,sessions,settings,speech,ssl,sunspider,sync,template_url_scraper,textinput,third_party,top_sites,translate,unit,viewsource,web_app_info,webrtc,websocket,webui_test_resources.grd,workers} 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} rmdir chrome/test/data/webui/{settings,extensions}/a11y rmdir chrome/test/data/webui/settings/chromeos/app_management rmdir chrome/test/data/webui/history/history_clusters rmdir chrome/test/data/webui/{engagement,extensions,history} rm -r --interactive=never components/test/data/update_client/jebgalgnebhfojomionfpkfelancnnkf/component1.dll rm -r --interactive=never content/test/data/ rm -r --interactive=never ppapi/native_client/tests/ rm -r --interactive=never third_party/apache-win32/ rm -r --interactive=never third_party/expat/{fuzz,include,src} %if %{system_freetype} rm -r --interactive=never third_party/freetype/{include,src} %endif rm -r --interactive=never third_party/ffmpeg/*/* rm -r --interactive=never third_party/flac/{include,src} %if %{system_icu} rm -r --interactive=never third_party/icu/{android,android_small,common,patches,source,chromeos,ios} %endif rm -r --interactive=never third_party/jsoncpp/source rm -r --interactive=never third_party/lcov %if %{system_libevent} rm -r --interactive=never base/third_party/libevent/*/* rm -r --interactive=never base/third_party/libevent/*.[ch] %endif %if %{system_libvpx} rm -r --interactive=never third_party/libvpx/source/{libvpx,config} %endif rm -r --interactive=never third_party/libaom/source %if %{system_dav1d} rm -r --interactive=never third_party/dav1d/{libdav1d,version} %endif rm -r --interactive=never third_party/libjpeg_turbo/*.[ch] rm -r --interactive=never third_party/libpng/*.[ch] rm -r --interactive=never third_party/libxslt/{linux,mac,src,win32} rm -r --interactive=never third_party/xdg-utils/tests/ rm -r --interactive=never third_party/zlib/{*.[ch],contrib/minizip} rm -r --interactive=never native_client_sdk/src/tools/lib/tests/data rm -r --interactive=never buildtools/third_party/eu-strip/bin rm --interactive=never third_party/pdfium/third_party/libopenjpeg20/*.[ch] rm -r --interactive=never third_party/pdfium/third_party/libpng16 %if %{system_libtiff} rm --interactive=never third_party/pdfium/third_party/libtiff/*.[ch] %endif %if %{system_re2} rm -r --interactive=never third_party/re2/src %endif %if %{system_fontconfig} rm -r --interactive=never third_party/fontconfig/{src,include,chromium} %endif rm --interactive=never native_client/tools/redirector.exe rm --interactive=never third_party/webrtc/data/voice_engine/stereo_rtp_files/rtpplay.exe rm -r --interactive=never third_party/llvm rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/SanOGLES-Gerbera.exe rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/SanOGLES-PVRSDK.exe rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/t/libGLES_CM.dll rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/gles/bob/bob rm --interactive=never third_party/webgl/src/sdk/demos/google/san-angeles/glut/SanOGLES rm --interactive=never third_party/lzma_sdk/Executable/7za.exe rm --interactive=never third_party/lzma_sdk/7zr.exe rm --interactive=never third_party/breakpad/symupload.exe rm -r --interactive=never third_party/catapult/third_party/google-endpoints/setuptools rm -r --interactive=never third_party/catapult/third_party/vinn/third_party/v8 rm --interactive=never third_party/depot_tools/ninja.exe rm --interactive=never third_party/depot_tools/ninja-linux32 rm --interactive=never third_party/depot_tools/ninja-linux64 rm -r --interactive=never native_client/tools/hermetic_cygwin rm -r --interactive=never base/test/data/pe_image/ rm -r --interactive=never base/test/data/file_version_info_unittest rm -r --interactive=never chrome/chrome_cleaner/test/resources/signed_dll rm --interactive=never third_party/crashpad/crashpad/handler/win/z7_test.dll rm -r --interactive=never third_party/crashpad/crashpad/snapshot/elf/elf_image_reader_fuzzer_corpus rm -r --interactive=never third_party/boringssl/src/util/ar/testdata rm -r --interactive=never third_party/pyelftools/test/testfiles_for_unittests rm -r --interactive=never third_party/pyelftools/test/external_tools rm -r --interactive=never third_party/pyelftools/test/testfiles_for_readelf rm -r --interactive=never third_party/pyelftools/examples rm -r --interactive=never third_party/skia/platform_tools/android/bin rm --interactive=never third_party/nasm/travis/test/tmap.o.t rm -r --interactive=never components/test/data/update_client rm -r --interactive=never build/android/tests/symbolize rm --interactive=never third_party/skia/platform_tools/android/apps/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/libphonenumber/dist/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar rm --interactive=never third_party/libphonenumber/dist/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar rm -r --interactive=never third_party/libphonenumber/dist/java/demo/war/WEB-INF/lib rm -r --interactive=never third_party/libphonenumber/dist/java/lib rm --interactive=never third_party/webrtc/examples/androidapp/third_party/autobanh/lib/autobanh.jar rm --interactive=never third_party/closure_compiler/compiler/compiler.jar rm --interactive=never third_party/flatbuffers/src/android/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/flatbuffers/src/kotlin/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/gradle_wrapper/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/webgl/src/conformance-suites/2.0.0/deqp/compiler.jar rm --interactive=never third_party/grpc/src/examples/android/helloworld/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/grpc/src/src/android/test/interop/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/tflite/src/tensorflow/lite/java/ovic/demo/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/tflite/src/tensorflow/lite/java/demo/gradle/wrapper/gradle-wrapper.jar rm --interactive=never third_party/checkstyle/checkstyle-all.jar rm --interactive=never build/android/stacktrace/java_deobfuscate.jar %if %{system_libevent} find base/third_party/libevent -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete %endif %if %{system_icu} # Remove bundled ICU; its header files appear to get picked up instead of # the system ones, leading to errors during the final link stage. # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q find third_party/icu -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete %endif # Hard code extra version FILE=chrome/common/channel_info_posix.cc sed -i.orig -r -e 's/env = getenv\("CHROME_VERSION_EXTRA"\).*;/env = "%{product_vendor} %{product_version}";/' -e 's/return env \? (.*) : .*;/return \1;/' $FILE if diff -u $FILE $FILE.orig >/dev/null; then exit 1 fi # version taken from: strings opt/google/chrome-unstable/chrome | grep -C 1 " (version:" #define widevine_version 1.4.8.1008 #for chrome_arch in ia32 x64; do # mkdir -p third_party/widevine/cdm/linux/${chrome_arch} # sed -e "s/@WIDEVINE_VERSION@/%{widevine_version}/" %{SOURCE4} > third_party/widevine/cdm/linux/${chrome_arch}/widevine_cdm_version.h #done %build %define unbundle_list ffmpeg flac %{?gn_fontconfig} libwebp libxml libxslt snappy %{?gn_libvpx} libpng %{?gn_icu} zlib jsoncpp opus %{?gn_re2} libdrm %{?gn_dav1d} %{?gn_libevent} # handled by upstream regular build scripts: freetype harfbuzz-ng # mesa # v NO TABS IN HERE! %define gn_mga use_sysroot=false \ system_libdir="%{_lib}" \ icu_use_data_file=true \ enable_nacl=false \ is_nacl_glibc=false \ linux_use_bundled_binutils=false \ custom_toolchain="//build/toolchain/linux/unbundle:default" \ host_toolchain="//build/toolchain/linux/unbundle:default" \ proprietary_codecs=true \ linux_link_libudev = true \ linux_link_libspeechd = true \ linux_link_libbrlapi = true \ linux_link_xlib = true \ enable_platform_ac3_eac3_audio = true \ enable_mse_mpeg2ts_stream_parser=true \ enable_platform_hevc=true \ use_system_libjpeg=true \ use_system_libopenjpeg2=true \ use_libjpeg_turbo=false \ enable_widevine=true \ pdf_enable_xfa=true \ gtk_version=3 \ fatal_linker_warnings=false \ use_libpci = true \ use_pulseaudio=true \ use_allocator="none" \ is_debug=false \ %{?gn_clang} \ clang_use_chrome_plugins=false \ use_lld=false \ %{?gn_gold} \ %{?gn_freetype} \ %{?gn_harfbuzz} \ use_system_libpng=true \ enable_dav1d_decoder=true enable_libaom=false \ use_custom_libcxx=false \ enable_mojom_closure_compile=false \ enable_js_type_check=false \ dcheck_always_on=false \ %{?gn_warnings_as_errors} \ google_api_key="%{google_api_key}" #squidf:additional arguments: from rpmfusion to pass the link step of bootstrap # and to use vaapi from the system with Chromium 96 %define gn_more %{gn_mga} \ %{?gn_vaapi} \ fatal_linker_warnings=false build/linux/unbundle/replace_gn_files.py --system-libraries %{unbundle_list} third_party/libaddressinput/chromium/tools/update-strings.py %set_build_flags %if %{use_clang} CC=clang; export CC CXX=clang++; export CXX LDFLAGS="-fuse-ld=lld $LDFLAGS" %else CC=%{__cc}; export CC CXX=%{__cxx}; export CXX LD="%{__cxx}"; export LD %endif AR=%{__ar}; export AR NM=%{_bindir}/nm; export NM %if %{use_gold} LD="$LD -fuse-ld=gold" %endif # filter out -g from CFLAGS and CXXFLAGS to fix builds %if %{_enable_debug_packages} %else CFLAGS=$(echo "$CFLAGS"|sed -e 's/-g //') CXXFLAGS=$(echo "$CXXFLAGS"|sed -e 's/-g //') %endif CXXFLAGS="$CXXFLAGS -faligned-new -Wno-attributes -Wno-ignored-attributes" #squidf:form Arch: This appears to cause random segfaults CFLAGS=${CFLAGS/-fstack-clash-protection} CXXFLAGS=${CXXFLAGS/-fstack-clash-protection} #squidf: all the below flags are from openSUSE export CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument -Wno-unknown-warning-option" # extra flags to reduce warnings that aren't very useful export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations" # ignore warnings for minor mistakes that are too common export CXXFLAGS="${CXXFLAGS} -Wno-return-type -Wno-parentheses -Wno-misleading-indentation" # ignore warnings due to gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84055) export CXXFLAGS="${CXXFLAGS} -Wno-ignored-attributes" %if %mgaver <= 8 %if %{use_clang} #squidf:FIX ME??: Mageia official adds -std=gnu++17 CFLAGS="$CFLAGS -Wno-error=unused-result" CXXFLAGS="$CXXFLAGS -Wno-error=deprecated-declarations -Wno-error=deprecated-copy -Wno-error=psabi -Wno-error=implicit-const-int-float-conversion -Wno-error=non-c-typedef-for-linkage -Wno-error=unused-const-variable" %else #squidf:WARNING: so far, building with gcc on Mageia does not work for chromium version higher than 96 CXXFLAGS="$CXXFLAGS -Wno-error=class-memaccess -Wno-error=unknown-pragmas -Wno-error=array-bounds -Wno-return-type -Wno-error=nonnull -Wno-error=free-nonheap-object -Wno-error=stringop-overflow -Wno-error=unused -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=invalid-offsetof -std=gnu++17" %endif %else #squidf:this part aims at reflecting Cauldron spec %if %{use_clang} CFLAGS="$CFLAGS -Wno-error=unused-result" CXXFLAGS="$CXXFLAGS -Wno-error=deprecated-declarations -Wno-error=deprecated-copy -Wno-error=psabi -Wno-error=implicit-const-int-float-conversion -Wno-error=non-c-typedef-for-linkage -Wno-error=unused-const-variable -std=gnu++17" %else CXXFLAGS="$CXXFLAGS -Wno-error=class-memaccess -Wno-error=unknown-pragmas -Wno-error=array-bounds -Wno-return-type -Wno-error=nonnull -Wno-error=free-nonheap-object -Wno-error=stringop-overread -Wno-error=unused -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=invalid-offsetof -std=gnu++17" %endif %endif %if %{use_gold} %ifarch %ix86 LDFLAGS="$LDFLAGS -Wl,--no-keep-files-mapped" %endif %else LDFLAGS="$LDFLAGS -fno-use-linker-plugin" %endif # for debugging: %if %{_enable_debug_packages} CFLAGS="$(echo $CFLAGS|sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-D_FORTIFY_SOURCE=2//') -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -gdwarf64" CXXFLAGS="$(echo $CXXFLAGS|sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//' -e 's/-D_FORTIFY_SOURCE=2//') -Og -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -Wno-error=return-type -gdwarf64" %endif %ifarch %{ix86} CFLAGS="$CFLAGS -msse2" CXXFLAGS="$CXXFLAGS -msse2" %endif python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_more}' out/Release/gn gen --args='%{gn_more}' out/Release %if !%{use_gold} # ld.bfd needs lots of file descriptors to link chrome ulimit -n 4096 %endif JOBS=$(echo %{_smp_mflags}|sed -re 's#^-j##') %{__ninja} -j${JOBS} -C out/Release chrome chrome_sandbox # man page sed -e "s/@@PACKAGE@@/chromium/" -e "s/@@MENUNAME@@/Chromium Web Browser/" chrome/app/resources/manpage.1.in >out/Release/chromium.1 %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_crdir}/locales mkdir -p %{buildroot}%{_crdir}/themes mkdir -p %{buildroot}%{_crdir}/MEIPreload mkdir -p %{buildroot}%{_mandir}/man1 #squidf: add master_preferences to prevent default browser check banner, at first %{__install} -m 644 %{SOURCE13} %{buildroot}%{_crdir}/master_preferences install -m 755 %{_sourcedir}/chromium-wrapper %{buildroot}%{_crdir}/ install -m 755 out/Release/chrome %{buildroot}%{_crdir}/ install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_crdir}/chrome-sandbox install -m 644 out/Release/chromium.1 %{buildroot}%{_mandir}/man1/%{crname}.1 install -m 644 out/Release/chrome_100_percent.pak %{buildroot}%{_crdir}/ install -m 644 out/Release/chrome_200_percent.pak %{buildroot}%{_crdir}/ install -m 644 out/Release/resources.pak %{buildroot}%{_crdir}/ install -m 644 out/Release/snapshot_blob.bin %{buildroot}%{_crdir}/ install -m 755 out/Release/mksnapshot %{buildroot}%{_crdir}/ install -m 755 out/Release/chrome_crashpad_handler %{buildroot}%{_crdir}/ install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/ install -m 644 out/Release/v8_context_snapshot.bin %{buildroot}%{_crdir}/ install -m 755 out/Release/libEGL.so %{buildroot}%{_crdir}/ install -m 755 out/Release/libGLESv2.so %{buildroot}%{_crdir}/ install -m 644 out/Release/MEIPreload/* %{buildroot}%{_crdir}/MEIPreload/ ln -s %{_crdir}/chromium-wrapper %{buildroot}%{_bindir}/%{crname} %ifarch %{ix86} x86_64 mkdir -p %{buildroot}%{_crdir}/swiftshader install -m 755 out/Release/swiftshader/*.so %{buildroot}%{_crdir}/swiftshader/ %endif find out/Release/resources/ -name "*.d" -exec rm {} \; cp -r out/Release/resources %{buildroot}%{_crdir} # desktop file mkdir -p %{buildroot}%{_datadir}/applications install -m 644 %{_sourcedir}/%{crname}.desktop %{buildroot}%{_datadir}/applications/ %if %{system_icu} # symlink to ICU data file ICUDATADIR=$(icuinfo | grep \"icudata.path\" | sed -re 's/^.*>(.*)<.*$/\1/') ICUDATANAME=$(icuinfo | grep \"icudata.name\" | sed -re 's/^.*>(.*)<.*$/\1/') ICUDATAFILE=$(realpath --relative-to=%{_crdir}/ ${ICUDATADIR}/${ICUDATANAME}.dat) ln -s ${ICUDATAFILE} %{buildroot}%{_crdir}/icudtl.dat %else %{__install} -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/ %endif # icon for i in 22_mono 24 32 48 64 128 256; do %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps if [ -f chrome/app/theme/chromium/product_logo_$i.png ]; then %{__install} -m 644 chrome/app/theme/chromium/product_logo_$i.png \ %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/%{crname}.png else %{__install} -m 644 chrome/app/theme/chromium/linux/product_logo_$i.xpm \ %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/%{crname}.xpm fi done %files -n chromium-browser %files %{_bindir}/%{crname} %dir %{_crdir} %{_crdir}/chromium-wrapper %{_crdir}/chrome %attr(4755,root,root) %{_crdir}/chrome-sandbox %{_crdir}/icudtl.dat %{_crdir}/locales %{_crdir}/master_preferences %{_crdir}/snapshot_blob.bin %{_crdir}/v8_context_snapshot.bin %{_crdir}/resources.pak %{_crdir}/resources %{_crdir}/chrome_100_percent.pak %{_crdir}/chrome_200_percent.pak %{_crdir}/mksnapshot %{_crdir}/chrome_crashpad_handler %{_crdir}/themes %{_crdir}/libEGL.so %{_crdir}/libGLESv2.so %ifarch %{ix86} x86_64 %{_crdir}/swiftshader %endif %{_mandir}/man1/%{crname}* %{_datadir}/applications/*.desktop %{_iconsdir}/hicolor/*/apps/%{crname}.png %{_iconsdir}/hicolor/*/apps/%{crname}.xpm %{_crdir}/MEIPreload