2018-04-24 14:28:44 +03:00
# 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/
2018-10-14 13:14:10 +03:00
# [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
2018-10-17 00:10:58 +03:00
# [9] https://packages.ubuntu.com/search?keywords=chromium-browser
2018-10-26 23:18:32 +03:00
# [10] http://svnweb.mageia.org/packages/cauldron/chromium-browser-stable/current/
2018-10-28 04:13:44 +03:00
# [11] https://salsa.debian.org/chromium-team/chromium/tree/master/debian/
2018-04-24 14:28:44 +03:00
2018-10-26 18:23:44 +03:00
# The script ./patches.sh helps to sync patches in spec and real files
2018-04-24 14:28:44 +03:00
2014-11-24 14:25:53 +03:00
%global _build_pkgcheck_set %{nil}
2014-11-24 10:50:36 +03:00
2015-11-11 18:16:42 +03:00
# eol 'fix' corrupts some .bin
%define dont_fix_eol 1
2016-02-25 12:05:16 +03:00
%define _disable_lto 1
2015-11-11 18:16:42 +03:00
2012-07-04 11:57:27 +04:00
%define crname chromium-browser
%define _crdir %{_libdir}/%{crname}
2018-11-07 13:19:05 +03:00
# Yandex Browser and other proprietary forks of Chromium look for libffmpeg.so in /usr/lib/chromium-browser,
# while we use /usr/lib64/chromium-browser on x86_64
%define _crdir_compat %{_prefix}/lib/%{crname}
2012-07-04 11:57:27 +04:00
%define _src %{_topdir}/SOURCES
2016-03-08 19:43:38 +03:00
%define icu 0
2018-10-14 13:08:58 +03:00
%define libva 1
2018-04-24 14:28:44 +03:00
%define clang 1
2018-05-28 14:04:45 +03:00
%define jsoncpp 0
2018-10-30 17:30:34 +03:00
%define AdditionalMediaPlayback 0
2018-10-31 10:02:21 +03:00
%define ffmpegBranding ChromeOS
2015-02-09 22:50:26 +03:00
2016-11-17 23:12:20 +10:00
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
2018-10-28 22:32:18 +03:00
# Note: these are for use in ROSA ONLY. For your own builds, please get your own set of keys.
# Keys holder: <m.novosyolov@rosalinux.ru>.
%define google_api_key AIzaSyA2ygnywlVvVIk-uWG2Q2E7pCLi5KSKbVA
2018-11-01 18:48:34 +03:00
%define google_default_client_id 215987972668-ks8srss9fos6m30kj158rol7h6ni18vr.apps.googleusercontent.com
2018-10-28 22:32:18 +03:00
%define google_default_client_secret G78Jv5Y_WbPSBaiLrrFwIdvs
2016-11-17 23:12:20 +10:00
2015-06-22 21:51:15 +10:00
Summary : A fast web browser based on the Blink engine
Name : chromium-browser-stable
2018-10-26 18:20:45 +03:00
Version : 70.0.3538.77
2018-11-07 13:19:05 +03:00
Release : 6
2015-06-22 21:51:15 +10:00
License : BSD, LGPL
Group : Networking/WWW
2017-01-31 10:51:58 +03:00
Url : https://www.chromium.org/Home
2015-06-22 21:51:15 +10:00
Source0 : https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version} .tar.xz
Source1 : chromium-wrapper
Source2 : chromium-browser.desktop
2016-11-17 23:12:20 +10:00
# 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
2018-10-31 10:02:21 +03:00
# rosa.sh is a script that makes some changes into the source code of bundled FFmpeg to build Chromium with support for playing H265 (HEVC) videos
# rosa.sh and ROSA-enable-H265.patch must be used together (don't forget to set enable_hevc_demuxing=true)
2018-10-31 10:08:37 +03:00
# rosa.sh is copied from https://abf.io/mikhailnov/chromium-source (https://abf.io/mikhailnov/chromium-source/blob/master/rosa.sh)
2018-10-31 10:02:21 +03:00
Source20 : rosa.sh
2015-06-22 21:51:15 +10:00
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
2016-12-06 19:54:52 +03:00
2018-10-28 04:13:44 +03:00
Patch4 : openSUSE-master-prefs-path.patch
2016-11-17 23:12:20 +10:00
Patch22 : chromium-54-proprietary-codecs-assert.patch
2018-10-30 17:30:34 +03:00
# (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
# These patches allow playing additional formats of video and audio instead of just downloading them
# But as we now use built-in FFmpeg, not the system one, we have to either carefully sync third_party/ffmpeg/chromium/scripts/build_ffmpeg.py with these patches, or just don't use them.
2018-10-28 04:13:44 +03:00
Patch32 : MAGEIA-extra-media.patch
Patch33 : MAGEIA-wmvflvmpg.patch
2017-08-09 15:04:16 +03:00
# (cjw) fix build with current glib...
Patch36 : chromium-58-glib.patch
2018-10-28 04:13:44 +03:00
Patch500 : DEBIAN-third-party-cookies-off-by-default.patch
Patch501 : DEBIAN-ps-print.patch
2016-01-03 00:58:07 +03:00
# Google patched their bundled copy of icu 54 to include API functionality that wasn't added until 55.
2016-11-17 23:12:20 +10:00
Patch502 : chromium-45.0.2454.101-system-icu-54-does-not-have-detectHostTimeZone.patch
2016-01-22 11:33:10 +03:00
# fix build with icu other than 54
2018-10-28 04:13:44 +03:00
Patch504 : GENTOO-system-icu-r0.patch
2018-01-23 08:13:40 +03:00
# https://aur.archlinux.org/packages/chromium-vaapi/
2018-10-14 13:08:58 +03:00
# https://github.com/saiarcot895/chromium-ubuntu-build
2018-10-26 18:20:45 +03:00
# openSUSE-libva1.patch must be applied after chromium-vaapi-r*.patch
Patch508 : chromium-vaapi-r21.patch
Patch509 : openSUSE-libva1.patch
2018-10-28 04:13:44 +03:00
Patch510 : GENTOO-widevine-r2.patch
2017-11-02 05:09:14 +03:00
Patch601 : chromium-62-include-cstdlib.patch
2018-10-26 18:20:45 +03:00
# Equal to Ubuntu's patches/fix-ffmpeg-ia32-build.patch
2018-10-28 04:13:44 +03:00
Patch605 : GENTOO-ffmpeg-ebp-r1.patch
2018-09-22 00:11:52 +03:00
# Add "ROSA" to the user agent string
2018-10-28 04:13:44 +03:00
Patch627 : ROSA-user-agent.patch
Patch710 : DEBIAN-Fixes-gpu-timeout.patch
2018-10-16 01:34:36 +03:00
Patch730 : ALT-allow-to-override-clang-through-env-variables.patch
2018-10-16 11:52:08 +03:00
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
2018-10-17 00:10:58 +03:00
Patch750 : UBUNTU-fix-extra-arflags.patch
Patch751 : UBUNTU-touch-v35.patch
2018-10-27 00:17:29 +03:00
Patch752 : UBUNTU-revert-Xclang-instcombine-lower-dbg-declare.patch
2018-10-22 00:58:38 +03:00
# Patch753 does not work
2018-10-20 13:04:50 +03:00
Patch753 : ROSA-allow-Gold-on-Linux.patch
2018-10-26 18:20:45 +03:00
Patch755 : openSUSE-system-libusb.patch
Patch756 : openSUSE-libusb_interrupt_event_handler.patch
2018-10-30 17:44:08 +03:00
Patch757 : ROSA-enable-H265.patch
2018-10-14 01:55:18 +03:00
2018-10-31 06:06:49 +03:00
# Pathes from Ungoogle Chromium (https://github.com/Eloston/ungoogled-chromium/blob/master/patches/ungoogled-chromium)
# This patch should speed up openning a blank new tab
2018-10-31 10:05:23 +03:00
Patch810 : UNGOOGLED-promo-disable-Google-promotion-fetching.patch
Patch820 : UNGOOGLED-enable-page-saving-on-more-pages.patch
2018-10-31 06:06:49 +03:00
2015-06-22 21:51:15 +10:00
Provides : %{crname} = %{EVRD}
Conflicts : chromium-browser-unstable
Conflicts : chromium-browser-beta
Obsoletes : chromium-browser < 1:9.0.597.94
2018-10-28 04:13:44 +03:00
2015-06-22 21:51:15 +10:00
BuildRequires : bison
2018-10-31 10:02:21 +03:00
# for rosa.sh
BuildRequires : bash
2018-04-24 14:28:44 +03:00
%if 0%{?clang}
BuildRequires : clang
BuildRequires : lld
BuildRequires : libcxx-devel
BuildRequires : libcxxabi-devel
%endif
2018-09-22 00:11:52 +03:00
# gn needs these
BuildRequires : libstdc++-static-devel
2018-10-16 01:30:36 +03:00
BuildRequires : libstdc++-devel
2016-11-17 23:12:20 +10:00
BuildRequires : flex
BuildRequires : git
BuildRequires : gperf
BuildRequires : gyp
BuildRequires : ninja
2017-04-22 14:06:55 +03:00
BuildRequires : nodejs >= 6.7.0
2016-11-17 23:12:20 +10:00
BuildRequires : util-linux
2018-10-25 09:32:01 +03:00
BuildRequires : bzip2 xz
2016-11-17 23:12:20 +10:00
BuildRequires : yasm
BuildRequires : atomic-devel
2015-06-22 21:51:15 +10:00
BuildRequires : bzip2-devel
BuildRequires : cap-devel
BuildRequires : cups-devel
BuildRequires : elfutils-devel
2018-08-13 15:03:08 +03:00
BuildRequires : jpeg-devel
2018-05-28 14:04:45 +03:00
%if 0%{jsoncpp}
2016-11-17 23:12:20 +10:00
BuildRequires : jsoncpp-devel
2018-05-28 14:04:45 +03:00
%endif
2015-06-22 21:51:15 +10:00
BuildRequires : pam-devel
2016-11-17 23:12:20 +10:00
BuildRequires : speech-dispatcher-devel
2015-06-22 21:51:15 +10:00
BuildRequires : pkgconfig(alsa)
BuildRequires : pkgconfig(atk)
BuildRequires : pkgconfig(dbus-glib-1)
BuildRequires : pkgconfig(expat)
2016-01-02 20:32:51 +03:00
BuildRequires : pkgconfig(fontconfig)
2017-08-09 15:04:16 +03:00
BuildRequires : pkgconfig(freetype2)
2015-06-22 21:51:15 +10:00
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)
2016-03-08 19:51:23 +03:00
BuildRequires : pkgconfig(gtk+-3.0)
2016-03-08 19:43:38 +03:00
%if 0%{icu}
2016-01-02 20:32:51 +03:00
BuildRequires : pkgconfig(icu-i18n)
2016-03-08 19:43:38 +03:00
%endif
2015-06-22 21:51:15 +10:00
BuildRequires : pkgconfig(libexif)
BuildRequires : pkgconfig(libgcrypt)
BuildRequires : pkgconfig(libgpsd)
BuildRequires : pkgconfig(libmtp)
2016-11-17 23:12:20 +10:00
BuildRequires : pkgconfig(libopenjp2)
2015-06-22 21:51:15 +10:00
BuildRequires : pkgconfig(libpci)
BuildRequires : pkgconfig(libpulse)
BuildRequires : pkgconfig(libusb-1.0)
2016-01-10 21:49:52 +03:00
BuildRequires : pkgconfig(libxml-2.0)
2016-01-21 16:07:13 +03:00
BuildRequires : pkgconfig(libva)
2015-06-22 21:51:15 +10:00
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)
2018-10-14 13:00:06 +03:00
BuildRequires : pkgconfig(krb5-gssapi)
2018-09-22 00:11:52 +03:00
BuildRequires : pythonegg(beautifulsoup4)
BuildRequires : pythonegg(html5lib)
2015-09-02 15:09:51 +03:00
2018-10-28 04:13:44 +03:00
# 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
2015-06-22 21:51:15 +10:00
Suggests : chromium-browser-pepper-flash
2016-11-19 02:30:47 +10:00
Conflicts : chromium-widevinecdm-plugin < 54
Obsoletes : chromium-widevinecdm-plugin < 54
2015-06-22 21:51:15 +10:00
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
2018-10-27 00:46:31 +03:00
Requires : chromium-stable-codecs-ffmpeg = %{EVRD}
2015-06-22 21:51:15 +10:00
Provides : %{crname} = %{EVRD}
ExclusiveArch : %{ix86} x86_64 armv7l
2012-07-04 11:57:27 +04:00
%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
2018-04-24 14:28:44 +03:00
thoroughly tested.
2012-07-04 11:57:27 +04:00
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.
2015-06-22 21:51:15 +10:00
%files
%config %{_sysconfdir} /%{crname}
%config %{_sysconfdir} /default/%{crname}
%{_bindir} /%{crname}
%{_crdir} /chromium-wrapper
%{_crdir} /chrome
%{_crdir} /chrome-sandbox
2016-03-08 19:43:38 +03:00
%{_crdir} /icudtl.dat
2015-06-22 21:51:15 +10:00
%{_crdir} /locales
2017-03-11 21:09:25 +03:00
%{_crdir} /*.pak
2015-06-22 21:51:15 +10:00
%{_crdir} /resources
%{_crdir} /themes
%{_crdir} /default_apps
2018-01-23 08:13:40 +03:00
%{_crdir} /swiftshader
2015-06-22 21:51:15 +10:00
%dir %{_crdir} /pepper
%{_datadir} /applications/*.desktop
%{_iconsdir} /hicolor/*/apps/chromium*
2017-07-29 03:30:57 +03:00
%post
2017-07-28 19:13:43 +03:00
# 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
2015-06-22 21:51:15 +10:00
#----------------------------------------------------------------------------
2018-10-27 00:46:31 +03:00
%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}
2018-10-27 01:42:20 +03:00
%description -n chromium-stable-codecs-ffmpeg
2018-10-27 00:46:31 +03:00
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
2018-11-07 13:19:05 +03:00
%ifarch x86_64
%{_crdir _compat}/libffmpeg.so
%endif
2018-10-27 00:46:31 +03:00
#----------------------------------------------------------------------------
2012-07-04 11:57:27 +04:00
%package -n chromium-browser
2015-06-22 21:51:15 +10:00
Summary : A fast web browser based on the Blink engine
Epoch : 1
Group : Networking/WWW
2018-09-22 00:11:52 +03:00
# No %%{EVRD}
2015-06-22 23:25:15 +10:00
Requires : %{name} = %{version} -%{release}
2012-07-04 11:57:27 +04:00
%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.
2015-06-22 21:51:15 +10:00
%files -n chromium-browser
#----------------------------------------------------------------------------
2013-01-25 15:10:50 +04:00
%package -n chromedriver
2015-06-22 21:51:15 +10:00
Summary : WebDriver for Google Chrome/Chromium
Group : Development/Other
2018-09-22 00:11:52 +03:00
# No %%{EVRD}
Requires : %{name} = %{version} -%{release}
2013-01-25 15:10:50 +04:00
%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.
2012-07-24 13:18:14 +04:00
2015-06-22 21:51:15 +10:00
%files -n chromedriver
%doc LICENSE AUTHORS
%{_bindir} /chromedriver
%{_crdir} /chromedriver
#----------------------------------------------------------------------------
2012-07-04 11:57:27 +04:00
%prep
2016-11-17 23:12:20 +10:00
%setup -qn chromium-%{version} -a 997 -a 999
2015-12-11 11:28:48 +03:00
2012-07-24 16:01:58 +04:00
%patch4 -p1 -b .prefs
2016-11-17 23:12:20 +10:00
%patch22 -p1
2018-10-30 17:30:34 +03:00
%patch36 -p1
2018-10-30 17:44:08 +03:00
%if 0%{?AdditionalMediaPlayback}
2016-12-06 19:54:52 +03:00
%patch32 -p1
2018-10-26 23:27:14 +03:00
%patch33 -p1
2018-10-30 17:30:34 +03:00
%endif
2015-09-07 09:49:47 +03:00
2016-03-08 19:43:38 +03:00
%if 0%{icu}
2016-01-29 18:38:34 +03:00
%patch502 -p1 -b .system-icu
%patch504 -p0 -b .icu-ver
2016-03-08 19:43:38 +03:00
%endif
2016-03-08 19:46:48 +03:00
%if 0%{?libva}
2018-10-26 18:20:45 +03:00
%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)
2018-10-28 23:02:58 +03:00
#define vaapi_version #(cat %{_includedir}/va/va_version.h | grep '#define VA_MAJOR_VERSION ' | awk '{print $NF}')
2018-10-28 00:18:54 +03:00
%if %{mdvver} < 201800
2018-10-26 18:20:45 +03:00
%patch509 -p1 -b .vaapi1
%endif
2016-03-08 19:46:48 +03:00
%endif
2018-10-16 11:52:08 +03:00
%patch500 -p1
%patch501 -p1
2018-10-26 18:20:45 +03:00
%patch510 -p1
2017-09-19 14:51:35 +03:00
%patch601 -p1
2018-05-28 14:04:45 +03:00
%patch605 -p1
2018-09-22 00:11:52 +03:00
%patch627 -p1
2018-10-14 01:55:18 +03:00
%patch710 -p1
2018-10-16 01:34:36 +03:00
%patch730 -p1
2018-10-16 11:52:08 +03:00
%patch732 -p1
%patch733 -p1
%patch744 -p1
%patch745 -p1
%patch746 -p1
%patch747 -p1
%patch748 -p1
2018-10-17 00:10:58 +03:00
%patch750 -p1
%patch751 -p1
2018-10-27 00:17:29 +03:00
%patch752 -p1
2018-10-22 00:58:38 +03:00
#patch753 -p1
2018-10-26 18:20:45 +03:00
%patch755 -p1
%patch756 -p1
2018-10-30 17:44:08 +03:00
%patch757 -p1
2018-10-26 18:20:45 +03:00
2018-10-31 06:06:49 +03:00
%patch810 -p1
%patch820 -p1
2018-10-26 18:20:45 +03:00
# 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
2018-10-14 01:55:18 +03:00
2018-04-24 14:28:44 +03:00
mkdir -p third_party/llvm-build/Release+Asserts/bin
pushd third_party/llvm-build/Release+Asserts/bin
2018-10-26 18:20:45 +03:00
ln -sf " $ ( w h i c h c l a n g ) " clang
ln -sf " $ ( w h i c h c l a n g + + ) " clang++
2018-04-24 14:28:44 +03:00
popd
2017-03-29 01:04:37 +03:00
2016-11-17 23:12:20 +10:00
# 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
2016-01-02 20:32:51 +03:00
2012-07-04 11:57:27 +04:00
# Hard code extra version
2015-10-22 13:02:58 +03:00
FILE=chrome/common/channel_info_posix.cc
2012-07-04 11:57:27 +04:00
sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"%{product_vendor} %{product_version}"/' $FILE
cmp $FILE $FILE.orig && exit 1
2017-04-22 13:40:30 +03:00
# 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
2018-10-31 10:38:20 +03:00
install -m 0755 %{SOURCE20} ./
2018-10-31 10:02:21 +03:00
env Ffmpeg_branding=%{ffmpegBranding} Platform=%{_arch} BUILD=1 ./rosa.sh
2018-10-17 16:13:17 +03:00
%build
2018-04-24 14:28:44 +03:00
2018-08-13 15:03:08 +03:00
# widevinecdmadapter
2018-09-26 00:21:20 +03:00
# Build error with widevinecdmadapter in 67.0.3396.62 (fixed)
2018-08-13 15:03:08 +03:00
%define widevine 1
2018-09-22 16:40:06 +03:00
%if 0%{widevine}
2018-08-13 15:03:08 +03:00
%define is_widevine true
%else
%define is_widevine false
%endif
2018-09-26 00:21:20 +03:00
# jumbo https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md
# (Alzim) 1 - localhost, 0 - ABF build
2018-10-23 03:59:34 +03:00
# jumbo 0 - jumbo off, 1 -on
2018-09-27 01:06:31 +03:00
%define localhost 0
2018-10-23 10:31:37 +03:00
%define jumbo 1
2018-09-26 00:21:20 +03:00
%if 0%{localhost}
2018-10-23 10:31:37 +03:00
%define is_limit 100
2018-09-22 16:40:06 +03:00
%else
2018-10-23 17:58:43 +03:00
# 10 is used on ABF
2018-09-27 01:06:31 +03:00
%define is_limit 10
2018-09-26 00:21:20 +03:00
%endif
2018-10-23 03:59:34 +03:00
%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
2018-09-26 00:21:20 +03:00
%if 0%{?libva}
%define is_vaapi true
%else
%define is_vaapi false
2018-09-22 16:40:06 +03:00
%endif
2018-10-16 01:30:36 +03:00
%if 0%{?clang}
2018-10-18 22:31:25 +03:00
%define is_clang true
2018-10-16 01:30:36 +03:00
export CC=clang
export CXX=clang++
export AR=ar
export NM=nm
2018-10-21 02:31:14 +03:00
2018-10-22 21:08:07 +03:00
%ifarch %ix86
2018-10-23 17:58:43 +03:00
# 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.
2018-10-26 16:44:25 +03:00
%define linker_args use_gold=true
2018-10-23 17:58:43 +03:00
# 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=" $ L D F L A G S - W l , - z n o t e x t "
2018-10-23 03:43:47 +03:00
%else
2018-10-23 07:10:11 +03:00
%ifarch x86_64
2018-10-23 17:58:43 +03:00
# If both gold and lld are false, GNU BFD ld is used.
2018-10-26 16:44:25 +03:00
%define linker_args use_gold=false use_lld=false is_cfi=false use_thin_lto=false
2018-10-24 15:39:28 +03:00
# With GNU BFD ld linker, 4 GB RAM per worker on ABF really is not enough, linking takes ages
2018-10-24 18:23:22 +03:00
# Gold is not supported on x86_64, lld is forced
2018-10-26 16:44:25 +03:00
#define linker_args use_lld=true is_cfi=false use_thin_lto=false
2018-10-23 07:10:11 +03:00
%endif
2018-10-16 01:30:36 +03:00
%endif
%else
2018-10-18 22:31:25 +03:00
%define is_clang false
2018-10-22 21:08:07 +03:00
%define linker_agrs use_gold=false use_lld=false
2018-10-16 01:30:36 +03:00
%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 " $ C F L A G S " |sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//' )
CXXFLAGS=$(echo " $ C X X F L A G S " |sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//' )
CFLAGS=" $ C F L A G S - W n o - e r r o r = p o i n t e r - t o - i n t - c a s t - W n o - e r r o r = i n t - t o - p o i n t e r - c a s t "
CXXFLAGS=" $ C X X F L A G S - W n o - e r r o r = a t t r i b u t e s - W n o - e r r o r = c o m m e n t - W n o - e r r o r = u n u s e d - v a r i a b l e - W n o - e r r o r = s t r i c t - o v e r f l o w - W n o - e r r o r = d e p r e c a t e d - d e c l a r a t i o n s "
%endif
2016-11-17 23:12:20 +10:00
# v NO TABS IN HERE!
2018-10-17 18:36:28 +03:00
# set use_custom_libcxx to 'false' if glibc is new enough
2018-05-28 14:04:45 +03:00
%define gn_config use_sysroot=false \
2016-11-17 23:12:20 +10:00
system_libdir=" % { _ l i b } " \
2018-10-17 18:36:28 +03:00
use_custom_libcxx=true \
2016-11-17 23:12:20 +10:00
icu_use_data_file=true \
2018-10-27 09:03:06 +03:00
optimize_webui=false \
2016-11-17 23:12:20 +10:00
binutils_path=" %{_bindir} " \
linux_use_bundled_binutils=false \
custom_toolchain=" %{_sourcedir} : d e f a u l t " \
2018-10-22 11:15:57 +03:00
is_component_build=false \
is_component_ffmpeg=true \
2016-11-17 23:12:20 +10:00
proprietary_codecs=true \
2018-10-31 10:02:21 +03:00
ffmpeg_branding=" %{ffmpegBranding} " \
2016-11-17 23:12:20 +10:00
enable_ac3_eac3_audio_demuxing=true \
enable_mse_mpeg2ts_stream_parser=true \
enable_hevc_demuxing=true \
2018-08-13 15:03:08 +03:00
enable_widevine=%{is_widevine} \
2016-11-17 23:12:20 +10:00
pdf_enable_xfa=true \
use_pulseaudio=true \
2018-10-14 13:50:30 +03:00
link_pulseaudio=true \
use_cups=true \
2018-10-14 13:00:06 +03:00
use_kerberos=true \
2018-10-22 11:15:57 +03:00
enable_mdns=true \
use_gio=true \
2016-11-17 23:12:20 +10:00
use_allocator=" n o n e " \
treat_warnings_as_errors=false \
2016-11-19 02:16:30 +10:00
use_aura=true \
2018-10-14 13:00:06 +03:00
use_libpci=true \
2016-11-17 23:12:20 +10:00
is_debug=false \
2018-10-16 01:30:36 +03:00
symbol_level=0 \
remove_webcore_debug_symbols=true \
is_official_build=true \
2018-10-22 11:15:57 +03:00
fieldtrial_testing_like_official_build=true \
2018-04-24 14:28:44 +03:00
is_clang=%{is_clang} \
2018-10-16 01:30:36 +03:00
use_allocator=" n o n e " \
use_allocator_shim=false \
2018-04-24 14:28:44 +03:00
clang_use_chrome_plugins=false \
2018-10-14 22:19:18 +03:00
clang_base_path=" %{_prefix} " \
2018-01-06 00:13:37 +03:00
use_system_freetype=true \
2018-09-26 00:21:20 +03:00
use_vaapi=%{is_vaapi} \
2018-05-28 14:04:45 +03:00
v8_use_external_startup_data=false \
2016-11-17 23:12:20 +10:00
google_api_key=" %{google_api_key} " \
google_default_client_id=" %{google_default_client_id} " \
2018-10-17 14:50:41 +03:00
google_default_client_secret=" %{google_default_client_secret} " \
2018-10-22 21:08:07 +03:00
%{linker_args} \
2018-10-21 11:07:44 +03:00
fatal_linker_warnings=false \
2018-10-20 13:48:40 +03:00
enable_nacl=false \
2018-10-23 03:59:34 +03:00
%{jumbo_args}
2018-10-20 13:04:50 +03:00
#gold_path=false must be set if bunbled binutils are used, but gold linker must be system, not bundled
2018-10-20 13:48:40 +03:00
#enable_nacl_nonsfi=true \
#is_nacl_glibc=false \
2018-10-21 10:45:33 +03:00
#fatal_linker_warnings=false \
2016-11-17 23:12:20 +10:00
2018-10-28 03:33:53 +03:00
%define system_gn_list yasm libdrm fontconfig freetype libusb
2018-10-16 11:52:08 +03:00
# libpng, libtiff
2018-10-28 03:33:53 +03:00
# flac
# libxlst
# snappy
Built-in FFmpeg did not build with system harfbuzz-ng
../../third_party/ffmpeg/../../third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc:320:5: error: use of undeclared identifier 'hb_font_funcs_set_glyph_h_advances_func'; did you mean 'hb_font_funcs_set_glyph_h_advance_func'?
hb_font_funcs_set_glyph_h_advances_func(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb_font_funcs_set_glyph_h_advance_func
/usr/include/harfbuzz/hb-font.h:247:1: note: 'hb_font_funcs_set_glyph_h_advance_func' declared here
hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
^
In file included from gen/third_party/blink/renderer/platform/platform_jumbo_23.cc:9:
../../third_party/ffmpeg/../../third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc:321:16: error: cannot initialize a parameter of type 'hb_font_get_glyph_h_advance_func_t' (aka 'int (*)(hb_font_t *, void *, unsigned int, void *)') with an lvalue of type 'void (hb_font_t *, void *, unsigned int, hb_codepoint_t *, unsigned int, hb_position_t *, unsigned int, void *)' (aka 'void (hb_font_t *, void *, unsigned int, unsigned int *, unsigned int, int *, unsigned int, void *)'): different number of parameters (4 vs 8)
funcs, HarfBuzzGetGlyphHorizontalAdvances, nullptr, nullptr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/harfbuzz/hb-font.h:248:41: note: passing argument to parameter 'func' here
hb_font_get_glyph_h_advance_func_t func,
2018-10-28 00:23:09 +03:00
# harfbuzz-ng
2018-10-26 18:20:45 +03:00
# ffmpeg
2018-10-15 00:31:42 +03:00
# libvpx : system libvpx will normally be much older than the bundled one
2018-10-14 13:50:30 +03:00
# opus
# icu
# libevent
# libwebp
# System libxml must be built with icu support to be used in Chromium
# libxml
# jsoncpp
2016-11-17 23:12:20 +10:00
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
2018-10-28 16:53:57 +03:00
ninja -C out/Release %{_smp_mflags} chrome chrome_sandbox chromedriver
2012-07-04 11:57:27 +04:00
%install
mkdir -p %{buildroot} %{_bindir}
mkdir -p %{buildroot} %{_crdir} /locales
mkdir -p %{buildroot} %{_crdir} /themes
mkdir -p %{buildroot} %{_crdir} /default_apps
2016-12-06 19:54:52 +03:00
install -m 755 %{SOURCE1} %{buildroot} %{_crdir} /chromium-wrapper
2012-07-04 11:57:27 +04:00
install -m 755 out/Release/chrome %{buildroot} %{_crdir} /
install -m 4755 out/Release/chrome_sandbox %{buildroot} %{_crdir} /chrome-sandbox
2013-01-25 15:10:50 +04:00
cp -a out/Release/chromedriver %{buildroot} %{_crdir} /chromedriver
2014-04-10 12:38:43 +04:00
install -m 644 out/Release/*.pak %{buildroot} %{_crdir} /
2016-03-08 19:43:38 +03:00
install -m 644 out/Release/icudtl.dat %{buildroot} %{_crdir} /
2015-02-09 22:50:26 +03:00
2012-07-04 11:57:27 +04:00
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}
2014-05-14 17:35:50 +04:00
sed -i " s ! @ L I B D I R @ ! %{_libdir} ! g " %{buildroot} %{_crdir} /chromium-wrapper
2013-01-25 15:10:50 +04:00
ln -s %{_crdir} /chromedriver %{buildroot} %{_bindir} /chromedriver
2012-07-04 11:57:27 +04:00
2018-01-23 08:13:40 +03:00
cp -r out/Release/swiftshader %{buildroot} %{_crdir}
2014-05-14 17:35:50 +04:00
# 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
2012-07-04 11:57:27 +04:00
find out/Release/resources/ -name " * . d " -exec rm {} \;
cp -r out/Release/resources %{buildroot} %{_crdir}
# desktop file
mkdir -p %{buildroot} %{_datadir} /applications
2017-01-16 16:04:48 +03:00
install -m 644 %{SOURCE2} %{buildroot} %{_datadir} /applications/
2012-07-04 11:57:27 +04:00
# icon
2014-05-29 12:59:28 +04:00
mkdir -p %{buildroot} %{_iconsdir} /hicolor/
tar xjf %{SOURCE100} -C %{buildroot} %{_iconsdir} /hicolor/
2012-07-04 11:57:27 +04:00
2012-07-24 16:01:58 +04:00
mkdir -p %{buildroot} %{_sysconfdir} /%{crname}
install -m 0644 %{SOURCE30} %{buildroot} %{_sysconfdir} /%{crname} /
install -m 0644 %{SOURCE31} %{buildroot} %{_sysconfdir} /%{crname} /
2018-11-07 13:19:05 +03:00
%ifarch x86_64
# Yandex Browser and other proprietary forks of Chromium look for libffmpeg.so in /usr/lib/chromium-browser,
# while we use /usr/lib64/chromium-browser on x86_64
mkdir -p %{buildroot} %{_crdir _compat}
ln -sr %{buildroot} %{_crdir} /libffmpeg.so %{buildroot} %{_crdir _compat}/libffmpeg.so
%endif
2018-10-28 16:53:57 +03:00
# chromium-stable-codecs-ffmpeg, as chromium-codecs-ffmpeg-extra in Ubuntu
install -m 0644 out/Release/libffmpeg.so %{buildroot} %{_crdir} /
2018-10-28 17:03:39 +03:00
# 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
2018-10-28 16:53:57 +03:00
2012-10-23 15:04:10 +04:00
find %{buildroot} -name " * . n e x e " -exec strip {} \;