diff --git a/chromium.spec b/chromium.spec index c864af0..148359f 100644 --- a/chromium.spec +++ b/chromium.spec @@ -18,6 +18,7 @@ %define chromium_no_dlopen 1 %define chromium_system_libs 0%{?suse_version} > 1220 +%define with_chromedriver 0 Name: chromium Version: 31.0.1632.7 @@ -249,6 +250,7 @@ t will allow a process to execute a target executable that will be able to drop This is convenient because an executable can be launched, load libraries and open files and get chroot()-ed to an empty directory when it wants to drop filesystem access. +%if 0%{?with_chromedriver} %package -n chromedriver Summary: WebDriver for Google Chrome/Chromium @@ -258,6 +260,7 @@ Url: http://code.google.com/p/chromedriver/ %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. +%endif %prep %setup -q -n %{name}-%{version} @@ -276,7 +279,46 @@ sed "s:RPM_VERSION:%{version}:" %{SOURCE20} | patch -p0 sed -i 's|icu)|icu-i18n)|g' build/linux/system.gyp +myconf+="-Dwerror= + -Dlinux_sandbox_chrome_path=%{_libdir}/chromium/chromium + -Ddisable_nacl=1 + -Ddisable_glibc=1 + -Ddisable_pnacl=1 + -Ddisable_newlib_untar=1 + -Duse_openssl=0 + -Duse_system_ffmpeg=0 + -Dbuild_ffmpegsumo=1 + -Dremove_webcore_debug_symbols=1 + -Dproprietary_codecs=1 + -Duse_system_libxml=1 + -Dlogging_like_official_build=1 + -Ddisable_sse2=1 + -Duse_system_xdg_utils=1 " + + +%ifarch x86_64 +myconf+="-Dtarget_arch=x64 " +%endif + %if 0%{?chromium_system_libs} +myconf+="-Duse_system_flac=1 + -Duse_system_speex=1 + -Duse_system_libexif=1 + -Duse_system_libevent=1 + -Duse_system_libmtp=1 + -Duse_system_bzip2=1 + -Duse_system_icu=1 + -Duse_system_harfbuzz=1 + -Duse_system_libjpeg=1 + -Duse_system_libpng=1 + -Duse_system_libxml=1 + -Duse_system_libxslt=1 + -Duse_system_libyuv=1 + -Duse_system_nspr=1 + -Duse_system_opus=1 + -Duse_system_protobuf=1 + -Duse_system_yasm=1 " + # Remove most bundled libraries. Some are still needed. ./build/linux/unbundle/remove_bundled_libraries.py \ 'base/third_party/dmg_fp' \ @@ -341,6 +383,7 @@ sed -i 's|icu)|icu-i18n)|g' build/linux/system.gyp 'third_party/trace-viewer' \ 'third_party/undoview' \ 'third_party/usrsctp' \ + 'third_party/usb_ids' \ 'third_party/webdriver' \ 'third_party/webrtc' \ 'third_party/widevine' \ @@ -354,136 +397,47 @@ sed -i 's|icu)|icu-i18n)|g' build/linux/system.gyp %endif -%build -PARSED_OPT_FLAGS=`echo \'%{optflags} -D_GNU_SOURCE\' | sed "s/ /',/g" | sed "s/',/', '/g"` -for i in build/common.gypi; do - sed -i "s|'-O<(release_optimize)'|$PARSED_OPT_FLAGS|g" $i -done -# ' - -build/linux/unbundle/replace_gyp_files.py \ --Dwerror= \ --Dlinux_sandbox_chrome_path=%{_libdir}/chromium/chromium \ --Ddisable_nacl=1 \ --Ddisable_glibc=1 \ --Ddisable_pnacl=1 \ --Ddisable_newlib_untar=1 \ --Duse_openssl=0 \ --Duse_system_ffmpeg=0 \ --Dbuild_ffmpegsumo=1 \ --Dremove_webcore_debug_symbols=1 \ --Dproprietary_codecs=1 \ --Duse_system_libxml=1 \ --Dlogging_like_official_build=1 \ --Ddisable_sse2=1 \ --Duse_system_xdg_utils=1 \ -%ifarch x86_64 --Dtarget_arch=x64 \ -%endif -%if 0%{?chromium_system_libs} --Duse_system_flac=1 \ --Duse_system_speex=1 \ --Duse_system_libusb=1 \ --Duse_system_libexif=1 \ --Duse_system_libevent=1 \ --Duse_system_libmtp=1 \ --Duse_system_bzip2=1 \ --Duse_system_icu=1 \ --Duse_system_harfbuzz=1 \ --Duse_system_libjpeg=1 \ --Duse_system_libpng=1 \ --Duse_system_libxml=1 \ --Duse_system_libxslt=1 \ --Duse_system_libyuv=1 \ --Duse_system_nspr=1 \ --Duse_system_opus=1 \ --Duse_system_protobuf=1 \ --Duse_system_yasm=1 \ --Dusb_ids_path=/usr/share/usb.ids \ -%endif %if 0%{?chromium_no_dlopen} --Duse_pulseaudio=1 \ --Duse_kerberos=0 \ --Dlinux_link_libpci=1 \ --Dlinux_link_gnome_keyring=1 \ --Dlinux_link_gsettings=1 \ --Dlinux_link_libgps=1 \ +myconf+="-Duse_pulseaudio=1 + -Dlinux_link_libpci=1 + -Dlinux_link_gnome_keyring=1 + -Dlinux_link_gsettings=1 + -Dlinux_link_libgps=1 " %endif --Djavascript_engine=v8 \ --Dlinux_use_gold_binary=0 \ --Dlinux_use_gold_flags=0 \ --Dgoogle_api_key='AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q' \ --Dgoogle_default_client_id='4139804441.apps.googleusercontent.com' \ --Dgoogle_default_client_secret='KDTRKEZk2jwT_7CDpcmMA--P' -export GYP_GENERATORS='ninja' -./build/gyp_chromium build/all.gyp \ ---depth . \ --Dwerror= \ --Dlinux_sandbox_chrome_path=%{_libdir}/chromium/chromium \ --Ddisable_nacl=1 \ --Ddisable_glibc=1 \ --Ddisable_pnacl=1 \ --Ddisable_newlib_untar=1 \ --Duse_openssl=0 \ --Duse_system_ffmpeg=0 \ --Dbuild_ffmpegsumo=1 \ --Dremove_webcore_debug_symbols=1 \ --Dproprietary_codecs=1 \ --Duse_system_libxml=1 \ --Dlogging_like_official_build=1 \ --Ddisable_sse2=1 \ --Duse_system_xdg_utils=1 \ -%ifarch x86_64 --Dtarget_arch=x64 \ -%endif -%if 0%{?chromium_system_libs} --Duse_system_flac=1 \ --Duse_system_speex=1 \ --Duse_system_libusb=1 \ --Duse_system_libexif=1 \ --Duse_system_libevent=1 \ --Duse_system_libmtp=1 \ --Duse_system_bzip2=1 \ --Duse_system_icu=1 \ --Duse_system_harfbuzz=1 \ --Duse_system_libjpeg=1 \ --Duse_system_libpng=1 \ --Duse_system_libxml=1 \ --Duse_system_libxslt=1 \ --Duse_system_libyuv=1 \ --Duse_system_nspr=1 \ --Duse_system_opus=1 \ --Duse_system_protobuf=1 \ --Duse_system_yasm=1 \ --Dusb_ids_path=/usr/share/usb.ids \ -%endif -%if 0%{?chromium_no_dlopen} --Duse_pulseaudio=1 \ --Duse_kerberos=0 \ --Dlinux_link_libpci=1 \ --Dlinux_link_gnome_keyring=1 \ --Dlinux_link_gsettings=1 \ --Dlinux_link_libgps=1 \ -%endif --Djavascript_engine=v8 \ --Dlinux_use_gold_binary=0 \ --Dlinux_use_gold_flags=0 \ --Dgoogle_api_key='AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q' \ --Dgoogle_default_client_id='4139804441.apps.googleusercontent.com' \ --Dgoogle_default_client_secret='KDTRKEZk2jwT_7CDpcmMA--P' +myconf+="-Djavascript_engine=v8 + -Dlinux_use_gold_binary=0 + -Dlinux_use_gold_flags=0 " + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys # Note: these are for the openSUSE Chromium builds ONLY. For your own distribution, # please get your own set of keys. +myconf+="-Dgoogle_api_key='AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q' + -Dgoogle_default_client_id='4139804441.apps.googleusercontent.com' + -Dgoogle_default_client_secret='KDTRKEZk2jwT_7CDpcmMA--P'" + + +%build + +PARSED_OPT_FLAGS=`echo \'%{optflags} -D_GNU_SOURCE\' | sed "s/ /',/g" | sed "s/',/', '/g"` +sed -i "s|'-O<(release_optimize)'|$PARSED_OPT_FLAGS|g" build/common.gypi + +build/linux/unbundle/replace_gyp_files.py ${myconf} + +export GYP_GENERATORS='ninja' +./build/gyp_chromium build/all.gyp --depth . ${myconf} + ninja -C out/Release chrome # Build the required SUID_SANDBOX helper ninja -C out/Release chrome_sandbox +%if 0%{?with_chromedriver} # Build the ChromeDriver test suite ninja -C out/Release chromedriver2_server +%endif %install mkdir -p %{buildroot}%{_libdir}/chromium/ @@ -510,7 +464,9 @@ cp -a chrome_sandbox %{buildroot}%{_prefix}/lib/ ln -s -f %{_prefix}/lib/chrome_sandbox %{buildroot}/%{_libdir}/chromium/chrome-sandbox cp -a *.pak locales xdg-mime %{buildroot}%{_libdir}/chromium/ +%if 0%{?with_chromedriver} cp -a chromedriver2_server %{buildroot}%{_libdir}/chromium/ +%endif # Patch xdg-settings to use the chromium version of xdg-mime as that the system one is not KDE4 compatible sed "s|xdg-mime|%{_libdir}/chromium/xdg-mime|g" xdg-settings > %{buildroot}%{_libdir}/chromium/xdg-settings @@ -651,8 +607,10 @@ fi %verify(not mode) %{_prefix}/lib/chrome_sandbox %{_libdir}/chromium/chrome-sandbox +%if 0%{?with_chromedriver} %files -n chromedriver %defattr(-,root,root,-) %{_libdir}/chromium/chromedriver2_server +%endif %changelog