chromium-browser-stable-sla.../chromium-browser-stable.spec
2017-03-23 03:49:34 +03:00

482 lines
17 KiB
RPMSpec

%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 ffmpeg 1
%define icu 0
%define libva 0
# 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 AIzaSyCV9AOzytWwWCtNE8f7ZV56fP1u9yWwhVU
%define google_default_client_id 1039996407057.apps.googleusercontent.com
%define google_default_client_secret mLT8XooDODav1OJG5G3bY61d
Summary: A fast web browser based on the Blink engine
Name: chromium-browser-stable
Version: 57.0.2987.110
Release: 1
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
Source1000: README.urpmi
Patch0: chromium-54-no-deprecated-error.patch
Patch4: chromium-30.0.1599.66-master-prefs-path.patch
Patch22: chromium-54-proprietary-codecs-assert.patch
# (cjw) fix a compilation warning
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) build pdfium with system libtiff and libpng
Patch30: chromium-52-pdfium-system-libtiff-libpng.patch
# (cjw) fix build with ffmpeg 2.8.x
Patch31: chromium-54-ffmpeg-2.8.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: chromium-55-extra-media.patch
# (cjw) Do not use ffmpeg internal header(s)
Patch34: chromium-43-no-ffmpeg-internal.patch
# (cjw) fix webrtc build with system ffmpeg
Patch35: chromium-50-system-ffmpeg-3.patch
# From Fedora
Patch40: chromium-54.0.2840.90-setopaque.patch
Patch41: chromium-54.0.2840.59-nullfix.patch
# New from Debian
Patch500: chromium-third-party-cookies-off-by-default.patch
Patch501: chromium-ps-print.patch
# Google patched their bundled copy of icu 54 to include API functionality that wasn't added until 55.
# :P
Patch502: chromium-45.0.2454.101-system-icu-54-does-not-have-detectHostTimeZone.patch
# http://bazaar.launchpad.net/~saiarcot895/chromium-browser/chromium-browser.trusty.beta/revision/230#debian/patches/enable_vaapi_on_linux.diff
Patch503: enable_vaapi_on_linux.diff
# Patch to fix build with use_system_libvpx
# Chromium bug #541273
# fix build with icu other than 54
Patch504: chromium-system-icu-r0.patch
# fix https://bugs.chromium.org/p/chromium/issues/detail?id=585513
# vaInitialize failed VA error: unknown libva error
Patch507: issue1688073002_40001.diff
Provides: %{crname} = %{EVRD}
Conflicts: chromium-browser-unstable
Conflicts: chromium-browser-beta
Obsoletes: chromium-browser < 1:9.0.597.94
BuildRequires: bison
BuildRequires: flex
BuildRequires: git
BuildRequires: gperf
BuildRequires: gyp
BuildRequires: ninja
BuildRequires: util-linux
BuildRequires: yasm
BuildRequires: atomic-devel
BuildRequires: bzip2-devel
BuildRequires: cap-devel
BuildRequires: cups-devel
BuildRequires: elfutils-devel
BuildRequires: jpeg-devel
BuildRequires: jsoncpp-devel
BuildRequires: pam-devel
BuildRequires: snappy-devel
BuildRequires: speech-dispatcher-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(atk)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(expat)
%if 0%{?ffmpeg}
BuildRequires: pkgconfig(libavcodec)
%endif
BuildRequires: pkgconfig(flac)
BuildRequires: pkgconfig(fontconfig)
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+-2.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(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
%if 0%{?libva}
BuildRequires: pkgconfig(libva)
%endif
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(zlib)
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
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. If you want the latest features, install the
chromium-browser-unstable package instead.
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}/*_blob.bin
%{_crdir}/themes
%{_crdir}/default_apps
%dir %{_crdir}/pepper
%{_crdir}/lib*.so*
%{_mandir}/man1/%{crname}*
%{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/chromium*
%{_docdir}/%{name}/README.urpmi
#----------------------------------------------------------------------------
%package -n chromium-browser
Summary: A fast web browser based on the Blink engine
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. 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
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
%patch0 -p1
%patch4 -p1 -b .prefs
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch27 -p1
%patch28 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%if 0%{?ffmpeg}
%patch34 -p1
%patch35 -p1
%endif
%patch40 -p1
%patch41 -p1
# new from debian
%patch500 -p1
%patch501 -p1
%if 0%{icu}
%patch502 -p1 -b .system-icu
%patch504 -p0 -b .icu-ver
%endif
%if 0%{?libva}
%patch503 -p1 -b .vaapi
%patch507 -p1
%endif
# files we do not want from upstream source bundles
rm -rf breakpad/src/processor/testdata/
rm -rf chrome/app/test_data/dlls/
rm -rf chrome/common/extensions/docs/
#rm -rf chrome/test/data/
touch chrome/test/data/webui/i18n_process_css_test.html
rm -rf chrome/tools/test/reference_build/chrome_linux/
rm -rf components/test/data/component_updater/jebgalgnebhfojomionfpkfelancnnkf/component1.dll
rm -rf content/test/data/
#rm -rf net/data/
#rm -rf ppapi/examples/
rm -rf ppapi/native_client/tests/
rm -rf third_party/apache-win32/
rm -rf third_party/binutils/
rm -rf third_party/expat/files/
%if 0%{?ffmpeg}
rm -rf third_party/ffmpeg/*/*
rm -rf third_party/ffmpeg/*.[ch]
%endif
rm -rf third_party/flac/{include,src}
#rm -rf third_party/icu/{android,linux,mac,patches,public,source,windows}
rm -rf third_party/lcov
#rm -rf base/third_party/libevent/*/*
#rm -rf base/third_party/libevent/*.[ch]
#rm -rf third_party/libvpx/source/libvpx
rm -rf third_party/libexif/sources
rm -rf third_party/libjpeg/*.[ch]
rm -rf third_party/libjpeg_turbo/*.[ch]
rm -rf third_party/libpng/*.[ch]
rm -rf third_party/libxslt/{libexslt,libxslt,linux,mac,win32}
#rm -rf third_party/mesa/src/src
rm -rf third_party/swig
rm -rf third_party/WebKit/LayoutTests/
rm -rf third_party/WebKit/Tools/Scripts/
rm -rf third_party/xdg-utils/tests/
rm -rf third_party/yasm/source/
rm -rf third_party/zlib/{*.[ch],contrib/minizip}
rm -rf tools/gyp/test/
#rm -rf v8/test/
rm -r third_party/pdfium/third_party/libjpeg/*.[ch]
rm -f third_party/pdfium/third_party/libtiff/*.[ch]
rm -f third_party/skia/platform_tools/android/apps/gradle/wrapper/gradle-wrapper.jar
rm -f third_party/WebKit/Source/devtools/scripts/jsdoc-validator/jsdoc-validator.jar
rm -f third_party/WebKit/Source/devtools/scripts/closure/compiler.jar
rm -f third_party/WebKit/Source/devtools/scripts/compiler-runner/closure-runner.jar
rm -rf third_party/sfntly/src/java/lib
rm -f third_party/haha/haha-2.0.2.jar
rm -f third_party/android_platform/webview/frameworks_5.1.0_r1.jar
rm -f third_party/android_platform/webview/frameworks_6.0.jar
rm -f third_party/libphonenumber/dist/tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar
rm -f third_party/libphonenumber/dist/tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar
rm -rf third_party/libphonenumber/dist/java/demo/war/WEB-INF/lib
rm -rf third_party/libphonenumber/dist/java/lib
rm -f third_party/webrtc/examples/androidapp/third_party/autobanh/autobanh.jar
rm -rf third_party/cacheinvalidation/src/example-app-build/libs
rm -f third_party/closure_compiler/runner/runner.jar
rm -f third_party/closure_compiler/compiler/compiler.jar
rm -rf third_party/proguard/lib
rm -f third_party/checkstyle/checkstyle-6.5-all.jar
rm -rf third_party/sfntly/src/cpp/ext
# 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
### build with widevine support
# Patch from crbug (chromium bugtracker)
# fix the missing define (if not, fail build) (need upstream fix) (https://crbug.com/473866)
sed '14i#define WIDEVINE_CDM_VERSION_STRING "Something fresh"' -i "third_party/widevine/cdm/stub/widevine_cdm_version.h"
# 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
%build
%define system_gn_list ffmpeg flac libxslt snappy yasm libpng zlib jsoncpp
# opus
# icu
# libevent
# libvpx
# libwebp
# System libxml must be built with icu support to be used in Chromium
# libxml
%if %{mdvver} >= 201610
%define use_gold false
%else
%define use_gold true
%endif
# v NO TABS IN HERE!
%define gn_config use_gconf=false \
use_sysroot=false \
system_libdir="%{_lib}" \
icu_use_data_file=true \
enable_nacl=false \
is_nacl_glibc=false \
binutils_path="%{_bindir}" \
linux_use_bundled_binutils=false \
use_gold=%{use_gold} \
custom_toolchain="%{_sourcedir}:default" \
proprietary_codecs=true \
linux_link_libgio = true \
linux_link_libpci = true \
linux_link_libudev = true \
linux_link_libspeechd = true \
enable_ac3_eac3_audio_demuxing=true \
enable_mse_mpeg2ts_stream_parser=true \
enable_hevc_demuxing=true \
use_system_libjpeg=true \
use_libjpeg_turbo=false \
enable_widevine=true \
pdf_enable_xfa=true \
use_pulseaudio=true \
use_allocator="none" \
use_gtk3=false \
treat_warnings_as_errors=false \
fatal_linker_warnings=false \
use_aura=true \
use_libpci = true \
is_debug=false \
is_clang=false \
is_component_build=true \
google_api_key="%{google_api_key}" \
google_default_client_id="%{google_default_client_id}" \
google_default_client_secret="%{google_default_client_secret}"
build/linux/unbundle/replace_gn_files.py --system-libraries %{system_gn_list}
third_party/libaddressinput/chromium/tools/update-strings.py
%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
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//')
python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}'
out/Release/gn gen --args='%{gn_config}' out/Release
pushd out/Release
ninja %{_smp_mflags} chrome chrome_sandbox chromedriver widevinecdmadapter clearkeycdm
popd
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_crdir}/locales
mkdir -p %{buildroot}%{_crdir}/themes
mkdir -p %{buildroot}%{_crdir}/default_apps
mkdir -p %{buildroot}%{_mandir}/man1
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/chrome.1 %{buildroot}%{_mandir}/man1/%{crname}.1
install -m 644 out/Release/*.pak %{buildroot}%{_crdir}/
install -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/
cp -a out/Release/*_blob.bin %{buildroot}%{_crdir}/
# chromium components
cp -av out/Release/lib*.so* %{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
# 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}/
find %{buildroot} -name "*.nexe" -exec strip {} \;
mkdir -p %{buildroot}%{_docdir}/%{name}
install -p -m755 %{SOURCE1000} %{buildroot}%{_docdir}/%{name}