# This spec file is based on other spec files, ebuilds, PKGBUILDs available from # [1] https://repos.fedorapeople.org/repos/spot/chromium/ # [2] https://copr.fedoraproject.org/coprs/churchyard/chromium-russianfedora-tested/ # [3] https://www.archlinux.org/packages/extra/x86_64/chromium/ # [4] https://src.fedoraproject.org/rpms/chromium/ # [5] https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/ # [6] https://svnweb.freebsd.org/ports/head/www/chromium/Makefile?view=markup # [7] https://packages.altlinux.org/ru/Sisyphus/srpms/chromium/spec # [8] https://build.opensuse.org/package/show/network:chromium/chromium # [9] https://packages.ubuntu.com/search?keywords=chromium-browser # [10] http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/ # [11] https://salsa.debian.org/chromium-team/chromium/tree/master/debian/ # The script ./patches.sh helps to sync patches in spec and real files %global _build_pkgcheck_set %{nil} # eol 'fix' corrupts some .bin %define dont_fix_eol 1 %define _disable_lto 1 %define crname chromium-browser %define _crdir %{_libdir}/%{crname} %define _src %{_topdir}/SOURCES %define chromium_system_libs 1 %define icu 0 %define libva 1 %define clang 1 %define jsoncpp 0 # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys # Note: these are for use in ROSA ONLY. For your own builds, please get your own set of keys. # Keys holder: . %define google_api_key AIzaSyA2ygnywlVvVIk-uWG2Q2E7pCLi5KSKbVA %define google_default_client_id 1215987972668-ks8srss9fos6m30kj158rol7h6ni18vr.apps.googleusercontent.com %define google_default_client_secret G78Jv5Y_WbPSBaiLrrFwIdvs Summary: A fast web browser based on the Blink engine Name: chromium-browser-stable Version: 70.0.3538.77 Release: 2 License: BSD, LGPL Group: Networking/WWW Url: https://www.chromium.org/Home Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz Source1: chromium-wrapper Source2: chromium-browser.desktop # Setup toolchain for rosa builds, from gentoo # https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/toolchain/BUILD.gn Source5: BUILD.gn Source10: %{name}.rpmlintrc Source30: master_preferences Source31: default_bookmarks.html Source32: chromium.default Source100: icons.tar.bz2 Source997: depot_tools.tar.xz Source999: new-system-icons.tar.xz Patch4: openSUSE-master-prefs-path.patch Patch22: chromium-54-proprietary-codecs-assert.patch # (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. Patch32: MAGEIA-extra-media.patch Patch33: MAGEIA-wmvflvmpg.patch # (cjw) fix build with current glib... Patch36: chromium-58-glib.patch Patch500: DEBIAN-third-party-cookies-off-by-default.patch Patch501: DEBIAN-ps-print.patch # Google patched their bundled copy of icu 54 to include API functionality that wasn't added until 55. Patch502: chromium-45.0.2454.101-system-icu-54-does-not-have-detectHostTimeZone.patch # fix build with icu other than 54 Patch504: GENTOO-system-icu-r0.patch # https://aur.archlinux.org/packages/chromium-vaapi/ # https://github.com/saiarcot895/chromium-ubuntu-build # openSUSE-libva1.patch must be applied after chromium-vaapi-r*.patch Patch508: chromium-vaapi-r21.patch Patch509: openSUSE-libva1.patch Patch510: GENTOO-widevine-r2.patch Patch601: chromium-62-include-cstdlib.patch # Equal to Ubuntu's patches/fix-ffmpeg-ia32-build.patch Patch605: GENTOO-ffmpeg-ebp-r1.patch # Add "ROSA" to the user agent string Patch627: ROSA-user-agent.patch Patch710: DEBIAN-Fixes-gpu-timeout.patch Patch730: ALT-allow-to-override-clang-through-env-variables.patch Patch732: FEDORA-Fix-memcpy.patch Patch733: FEDORA-Fix-issue-where-timespec-is-not-defined-when-.patch Patch744: UBUNTU-define__libc_malloc.patch Patch745: UBUNTU-add-missing-cstddef-include.patch Patch746: UBUNTU-set-rpath-on-chromium-executables.patch Patch747: UBUNTU-suppress-newer-clang-warning-flags.patch Patch748: UBUNTU-enable-chromecast-by-default.patch Patch750: UBUNTU-fix-extra-arflags.patch Patch751: UBUNTU-touch-v35.patch Patch752: UBUNTU-revert-Xclang-instcombine-lower-dbg-declare.patch # Patch753 does not work Patch753: ROSA-allow-Gold-on-Linux.patch Patch755: openSUSE-system-libusb.patch Patch756: openSUSE-libusb_interrupt_event_handler.patch Provides: %{crname} = %{EVRD} Conflicts: chromium-browser-unstable Conflicts: chromium-browser-beta Obsoletes: chromium-browser < 1:9.0.597.94 BuildRequires: bison %if 0%{?clang} BuildRequires: clang BuildRequires: lld BuildRequires: libcxx-devel BuildRequires: libcxxabi-devel %endif # gn needs these BuildRequires: libstdc++-static-devel BuildRequires: libstdc++-devel BuildRequires: flex BuildRequires: git BuildRequires: gperf BuildRequires: gyp BuildRequires: ninja BuildRequires: nodejs >= 6.7.0 BuildRequires: util-linux BuildRequires: bzip2 xz BuildRequires: yasm BuildRequires: atomic-devel BuildRequires: bzip2-devel BuildRequires: cap-devel BuildRequires: cups-devel BuildRequires: elfutils-devel BuildRequires: jpeg-devel %if 0%{jsoncpp} BuildRequires: jsoncpp-devel %endif BuildRequires: pam-devel BuildRequires: speech-dispatcher-devel BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(atk) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gconf-2.0) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(gnome-keyring-1) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gtk+-3.0) %if 0%{icu} BuildRequires: pkgconfig(icu-i18n) %endif BuildRequires: pkgconfig(libexif) BuildRequires: pkgconfig(libgcrypt) BuildRequires: pkgconfig(libgpsd) BuildRequires: pkgconfig(libmtp) BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpci) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(libusb-1.0) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(minizip) BuildRequires: pkgconfig(nspr) BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(opus) BuildRequires: pkgconfig(speex) BuildRequires: pkgconfig(udev) BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(krb5-gssapi) BuildRequires: pythonegg(beautifulsoup4) BuildRequires: pythonegg(html5lib) # These libraries can be either system or bundled. # Commented out those which were switched from system to bundled. #BuildRequires: pkgconfig(flac) #BuildRequires: pkgconfig(zlib) #BuildRequires: pkgconfig(vpx) #BuildRequires: pkgconfig(libpng) #BuildRequires: pkgconfig(libxslt) #BuildRequires: pkgconfig(libtiff-4) #BuildRequires: pkgconfig(harfbuzz) #BuildRequires: snappy-devel Suggests: chromium-browser-pepper-flash Conflicts: chromium-widevinecdm-plugin < 54 Obsoletes: chromium-widevinecdm-plugin < 54 Conflicts: chromium-browser-beta Conflicts: chromium-browser-unstable Obsoletes: chromium-browser < 1:9.0.597.94 Obsoletes: chromium-browser-pdf-plugin < 17.0.0.169 Requires: chromium-stable-codecs-ffmpeg = %{EVRD} Provides: %{crname} = %{EVRD} ExclusiveArch: %{ix86} x86_64 armv7l %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. Note: If you are reverting from unstable to stable or beta channel, you may experience tab crashes on startup. This crash only affects tabs restored during the first launch due to a change in how tab state is stored. See http://bugs.chromium.org/34688. It's always a good idea to back up your profile before changing channels. %files %config %{_sysconfdir}/%{crname} %config %{_sysconfdir}/default/%{crname} %{_bindir}/%{crname} %{_crdir}/chromium-wrapper %{_crdir}/chrome %{_crdir}/chrome-sandbox %{_crdir}/icudtl.dat %{_crdir}/locales %{_crdir}/*.pak %{_crdir}/resources %{_crdir}/themes %{_crdir}/default_apps %{_crdir}/swiftshader %dir %{_crdir}/pepper %{_datadir}/applications/*.desktop %{_iconsdir}/hicolor/*/apps/chromium* %post # Remove chromium-browser-install package if we have it installed if [ `rpm -q chromium-browser-install | wc -w` == 1 ] then rpm -e chromium-browser-install fi #---------------------------------------------------------------------------- %package -n chromium-stable-codecs-ffmpeg Summary: FFmpeg codecs (libffmpeg.so) for Chromium-based browsers Group: System/Libraries Provides: chromium-stable-codecs-ffmpeg = %{EVRD} Provides: chromium-stable-codecs-ffmpeg-extra = %{EVRD} Provides: chromium-codecs-ffmpeg-extra = %{EVRD} Provides: chromium-codecs-ffmpeg = %{EVRD} %description -n chromium-stable-codecs-ffmpeg FFmpeg codecs (libffmpeg.so) for Chromium-based browsers. This packaged is build from Chromium's bundled FFmpeg with proprietary codecs turned on. %files -n chromium-stable-codecs-ffmpeg %{_crdir}/libffmpeg.so #---------------------------------------------------------------------------- %package -n chromium-browser Summary: A fast web browser based on the Blink engine Epoch: 1 Group: Networking/WWW # No %%{EVRD} 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. If you prefer the dev channel browser, install the chromium-browser-unstable package instead. %files -n chromium-browser #---------------------------------------------------------------------------- %package -n chromedriver Summary: WebDriver for Google Chrome/Chromium Group: Development/Other # No %%{EVRD} Requires: %{name} = %{version}-%{release} %description -n chromedriver WebDriver is an open source tool for automated testing of webapps across many browsers. It provides capabilities for navigating to web pages, user input, JavaScript execution, and more. ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium. It is being developed by members of the Chromium and WebDriver teams. %files -n chromedriver %doc LICENSE AUTHORS %{_bindir}/chromedriver %{_crdir}/chromedriver #---------------------------------------------------------------------------- %prep %setup -qn chromium-%{version} -a 997 -a 999 %patch4 -p1 -b .prefs %patch22 -p1 %patch32 -p1 %patch33 -p1 %patch36 -p1 %if 0%{icu} %patch502 -p1 -b .system-icu %patch504 -p0 -b .icu-ver %endif %if 0%{?libva} %patch508 -p1 -b .vaapiMain # We have libva1 in rosa2016.1, but will have libva2 in rosa2019.1 # This patch is needed for libva1 only (where VA_MAJOR_VERSION = 0) #define vaapi_version #(cat %{_includedir}/va/va_version.h | grep '#define VA_MAJOR_VERSION ' | awk '{print $NF}') %if %{mdvver} < 201800 %patch509 -p1 -b .vaapi1 %endif %endif %patch500 -p1 %patch501 -p1 %patch510 -p1 %patch601 -p1 %patch605 -p1 %patch627 -p1 %patch710 -p1 %patch730 -p1 %patch732 -p1 %patch733 -p1 %patch744 -p1 %patch745 -p1 %patch746 -p1 %patch747 -p1 %patch748 -p1 %patch750 -p1 %patch751 -p1 %patch752 -p1 #patch753 -p1 %patch755 -p1 %patch756 -p1 # hack for libusb stuff (from openSUSE) rm -rf third_party/libusb/src/libusb/libusb.h cp -a %{_includedir}/libusb-1.0/libusb.h third_party/libusb/src/libusb/libusb.h mkdir -p third_party/llvm-build/Release+Asserts/bin pushd third_party/llvm-build/Release+Asserts/bin ln -sf "$(which clang)" clang ln -sf "$(which clang++)" clang++ popd # 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 # 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 # setup node mkdir -p third_party/node/linux/node-linux-x64/bin ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node %build # widevinecdmadapter # Build error with widevinecdmadapter in 67.0.3396.62 (fixed) %define widevine 1 %if 0%{widevine} %define is_widevine true %else %define is_widevine false %endif # jumbo https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md # (Alzim) 1 - localhost, 0 - ABF build # jumbo 0 - jumbo off, 1 -on %define localhost 0 %define jumbo 1 %if 0%{localhost} %define is_limit 100 %else # 10 is used on ABF %define is_limit 10 %endif %if 1%{jumbo} %define jumbo_args use_jumbo_build=true jumbo_file_merge_limit = %{is_limit} %else %define jumbo_args use_jumbo_build=false %endif %if 0%{?libva} %define is_vaapi true %else %define is_vaapi false %endif %if 0%{?clang} %define is_clang true export CC=clang export CXX=clang++ export AR=ar export NM=nm %ifarch %ix86 # GNU BFD ld linker got out of memory on i586 with jumbo is_limit=10. # Gold linker worked fine with jumbo is_limit=10 on i586, but sometimes got out of memory. %define linker_args use_gold=true # These LDFLAGS fix building bundled openh264 with lld linker on i586 # "/usr/bin/ld.lld: error: can't create dynamic relocation R_386_32 against local symbol in readonly segment" # Source of the solution: https://svnweb.freebsd.org/ports?view=revision&revision=480034 # Reported it to upstream: https://crbug.com/898171 export LDFLAGS="$LDFLAGS -Wl,-znotext" %else %ifarch x86_64 # If both gold and lld are false, GNU BFD ld is used. %define linker_args use_gold=false use_lld=false is_cfi=false use_thin_lto=false # With GNU BFD ld linker, 4 GB RAM per worker on ABF really is not enough, linking takes ages # Gold is not supported on x86_64, lld is forced #define linker_args use_lld=true is_cfi=false use_thin_lto=false %endif %endif %else %define is_clang false %define linker_agrs use_gold=false use_lld=false %setup_compile_flags CC=%{__cc}; export CC CXX=%{__cxx}; export CXX AR=%{__ar}; export AR NM=%{__nm}; export NM LD=%{__cxx}; export LD # filter out some flags to fix i586 builds with GCC CFLAGS=$(echo "$CFLAGS"|sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//') CXXFLAGS=$(echo "$CXXFLAGS"|sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//') CFLAGS="$CFLAGS -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast" CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations" %endif # v NO TABS IN HERE! # set use_custom_libcxx to 'false' if glibc is new enough %define gn_config use_sysroot=false \ system_libdir="%{_lib}" \ use_custom_libcxx=true \ icu_use_data_file=true \ optimize_webui=false \ binutils_path="%{_bindir}" \ linux_use_bundled_binutils=false \ custom_toolchain="%{_sourcedir}:default" \ is_component_build=false \ is_component_ffmpeg=true \ proprietary_codecs=true \ ffmpeg_branding="ChromeOS" \ enable_ac3_eac3_audio_demuxing=true \ enable_mse_mpeg2ts_stream_parser=true \ enable_hevc_demuxing=true \ enable_widevine=%{is_widevine} \ pdf_enable_xfa=true \ use_pulseaudio=true \ link_pulseaudio=true \ use_cups=true \ use_kerberos=true \ enable_mdns=true \ use_gio=true \ use_allocator="none" \ treat_warnings_as_errors=false \ use_aura=true \ use_libpci=true \ is_debug=false \ symbol_level=0 \ remove_webcore_debug_symbols=true \ is_official_build=true \ fieldtrial_testing_like_official_build=true \ is_clang=%{is_clang} \ use_allocator="none" \ use_allocator_shim=false \ clang_use_chrome_plugins=false \ clang_base_path="%{_prefix}" \ use_system_freetype=true \ use_vaapi=%{is_vaapi} \ v8_use_external_startup_data=false \ google_api_key="%{google_api_key}" \ google_default_client_id="%{google_default_client_id}" \ google_default_client_secret="%{google_default_client_secret}" \ %{linker_args} \ fatal_linker_warnings=false \ enable_nacl=false \ %{jumbo_args} #gold_path=false must be set if bunbled binutils are used, but gold linker must be system, not bundled #enable_nacl_nonsfi=true \ #is_nacl_glibc=false \ #fatal_linker_warnings=false \ %define system_gn_list yasm libdrm fontconfig freetype libusb # libpng, libtiff # flac # libxlst # snappy # harfbuzz-ng # ffmpeg # libvpx : system libvpx will normally be much older than the bundled one # opus # icu # libevent # libwebp # System libxml must be built with icu support to be used in Chromium # libxml # jsoncpp build/linux/unbundle/replace_gn_files.py --system-libraries %{system_gn_list} third_party/libaddressinput/chromium/tools/update-strings.py python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}' out/Release/gn gen --args='%{gn_config}' out/Release ninja -C out/Release %{_smp_mflags} chrome chrome_sandbox chromedriver %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_crdir}/locales mkdir -p %{buildroot}%{_crdir}/themes mkdir -p %{buildroot}%{_crdir}/default_apps install -m 755 %{SOURCE1} %{buildroot}%{_crdir}/chromium-wrapper install -m 755 out/Release/chrome %{buildroot}%{_crdir}/ install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_crdir}/chrome-sandbox cp -a out/Release/chromedriver %{buildroot}%{_crdir}/chromedriver install -m 644 out/Release/*.pak %{buildroot}%{_crdir}/ install -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/ install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/ install -m 644 out/Release/resources.pak %{buildroot}%{_crdir}/ install -m 644 chrome/browser/resources/default_apps/* %{buildroot}%{_crdir}/default_apps/ ln -s %{_crdir}/chromium-wrapper %{buildroot}%{_bindir}/%{crname} sed -i "s!@LIBDIR@!%{_libdir}!g" %{buildroot}%{_crdir}/chromium-wrapper ln -s %{_crdir}/chromedriver %{buildroot}%{_bindir}/chromedriver cp -r out/Release/swiftshader %{buildroot}%{_crdir} # create global config file mkdir -p %{buildroot}%{_sysconfdir}/default install -m644 %{SOURCE32} %{buildroot}%{_sysconfdir}/default/%{crname} # create pepper dir. talkplugin works fine only if sylinks in pepper mkdir -p %{buildroot}%{_crdir}/pepper 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 %{SOURCE2} %{buildroot}%{_datadir}/applications/ # icon mkdir -p %{buildroot}%{_iconsdir}/hicolor/ tar xjf %{SOURCE100} -C %{buildroot}%{_iconsdir}/hicolor/ mkdir -p %{buildroot}%{_sysconfdir}/%{crname} install -m 0644 %{SOURCE30} %{buildroot}%{_sysconfdir}/%{crname}/ install -m 0644 %{SOURCE31} %{buildroot}%{_sysconfdir}/%{crname}/ # chromium-stable-codecs-ffmpeg, as chromium-codecs-ffmpeg-extra in Ubuntu install -m 0644 out/Release/libffmpeg.so %{buildroot}%{_crdir}/ # We set RPATH by UBUNTU-set-rpath-on-chromium-executables.patch # RPM helper removes RPATHs by default, so disable it export DONT_REMOVE_RPATH=1 find %{buildroot} -name "*.nexe" -exec strip {} \;