]> git.pld-linux.org Git - packages/chromium-browser.git/blobdiff - chromium-browser.spec
synced remove_bundled_libraries with gentoo ebuild
[packages/chromium-browser.git] / chromium-browser.spec
index 93767697c24c588bd2bde1e9d937933eb88e0c04..5bad9180c0de7aa1eab294a1de74b0da204abac3 100644 (file)
@@ -2,20 +2,23 @@
 # Conditional build:
 %bcond_without cups                    # with cups
 %bcond_without debuginfo               # disable debuginfo creation (it is huge)
+%bcond_with    dev                     # with dev optimizations (skip clean source)
 %bcond_without gconf                   # with GConf
 %bcond_without kerberos                # build with kerberos support (dlopened if support compiled, library names in net/http/http_auth_gssapi_posix.cc)
 %bcond_without keyring                 # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
 %bcond_with            gps                     # with gps support (linked), if enabled must use exactly same gpsd as shm structures may change leading to unexpected results (crash)
 %bcond_without libjpegturbo    # use libjpeg-turbo features
 %bcond_with    nacl                    # build Native Client support, disabled: http://crbug.com/269560
+%bcond_without ninja                   # use Ninja instead of make to build
 %bcond_without pulseaudio              # with pulseaudio
 %bcond_without sandboxing              # with sandboxing
 %bcond_with            selinux                 # with SELinux (need policy first)
 %bcond_with            shared_libs             # with shared libs
 %bcond_with            sse2                    # use SSE2 instructions
 %bcond_without system_flac             # system flac
-%bcond_without system_ffmpeg   # system ffmpeg instead of ffmpegsumo
+%bcond_with    system_ffmpeg   # system ffmpeg instead of ffmpegsumo
 %bcond_without system_harfbuzz # system harfbuzz
+%bcond_without system_icu      # system icu
 %bcond_without system_jsoncpp  # system jsoncpp
 %bcond_without system_libexif  # system libexif
 %bcond_without system_libmtp   # system libmtp
 %bcond_with    system_mesa             # system Mesa
 %bcond_without system_minizip  # system minizip
 %bcond_without system_opus             # system opus codec support, http://www.opus-codec.org/examples/
-%bcond_without system_protobuf # system protobuf
+# protobuf broken: https://bugs.gentoo.org/show_bug.cgi?id=525560
+%bcond_with    system_protobuf # system protobuf
 %bcond_without system_re2              # system re2
 %bcond_without system_snappy   # system snappy
 %bcond_without system_speex    # system speex
 %bcond_with    system_sqlite   # system sqlite WebSQL (http://www.w3.org/TR/webdatabase/) will not work
 %bcond_without system_libsrtp  # system srtp (can be used if using bundled libjingle)
 %bcond_with            system_v8               # system v8
-%bcond_without system_libvpx   # system libvpx
+%bcond_with    system_libvpx   # system libvpx
 %bcond_without system_yasm             # system yasm
 %bcond_without system_zlib             # system zlib
-%bcond_without tcmalloc                # use tcmalloc
+%bcond_with    tcmalloc                # use tcmalloc
 %bcond_without verbose                 # verbose build (V=1)
 
 %ifarch %{ix86}
 # GLsizeiptr different size, track: http://bugs.gentoo.org/457130
 %undefine      with_system_mesa
+
+# unable build with debuginfo on 32bit build systems
+# /usr/bin/ld.gold: fatal error: chrome: mmap: failed to allocate 2994044872 bytes for output file: Cannot allocate memory
+%undefine      with_debuginfo
+%endif
+
+%ifarch %{x8664}
+# x86_64 systems fail with debugedit crashing
+# /usr/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
+%undefine      with_debuginfo
 %endif
 
 # TODO
@@ -59,9 +73,9 @@
 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
 # - to look for new tarball, use update-source.sh script
 
-%define                branch          30.0.1599
-%define                basever         66
-%define                patchver        114
+%define                branch          42.0.2311
+%define                basever         82
+#define                patchver        118
 %define                gyp_rev 1014
 Summary:       A WebKit powered web browser
 Name:          chromium-browser
@@ -70,14 +84,14 @@ Version:    %{branch}.%{patchver}
 %else
 Version:       %{branch}.%{basever}
 %endif
-Release:       1
+Release:       0.1
 License:       BSD%{!?with_system_ffmpeg:, LGPL v2+ (ffmpeg)}
 Group:         X11/Applications/Networking
-Source0:       http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{branch}.%{basever}.tar.xz
-# Source0-md5: 065e908d4b4a7ca44026a8234b336cf1
+Source0:       http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}-%{branch}.%{basever}.tar.gz
+# Source0-md5: 7bdbf015d663e082f5bbe4cf24907049
 %if "%{?patchver}" != ""
 Patch0:                http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.patch.xz
-# Patch0-md5:  ccc99af9e31d866c174d824eeed5aab2
+# Patch0-md5:  fc9cd6fd3392142db2ada6b98b89fa80
 %endif
 Source1:       %{name}.default
 Source2:       %{name}.sh
@@ -87,15 +101,13 @@ Source6:   update-source.sh
 Source7:       clean-source.sh
 Source8:       get-source.sh
 Source9:       master_preferences.json
-Patch1:                plugin-searchdirs.patch
-Patch4:                path-libpdf.patch
+# https://github.com/Kelvin-Ng/Kelvin-Gentoo-Overlay/tree/master/www-client/chromium/files
+Patch2:                enable-video-decode-accel.patch
 Patch7:                dlopen_sonamed_gl.patch
 Patch8:                chromium_useragent.patch.in
-Patch10:       system-libxnvctrl.patch
 # https://bugs.gentoo.org/show_bug.cgi?id=393471
 # libjpeg-turbo >= 1.1.90 supports that feature
 Patch11:       chromium-revert-jpeg-swizzle-r2.patch
-Patch12:       system-ffmpeg.patch
 Patch15:       nacl-build-irt.patch
 Patch16:       nacl-linkingfix.patch
 Patch18:       nacl-no-untar.patch
@@ -103,8 +115,12 @@ Patch24:   nacl-verbose.patch
 Patch25:       gnome3-volume-control.patch
 Patch26:       master-prefs-path.patch
 Patch28:       system-mesa.patch
-Patch29:       system-icu.patch
-Patch30:       system-ply.patch
+Patch31:       system-jinja.patch
+Patch32:       remove_bundled_libraries-stale.patch
+Patch35:       etc-dir.patch
+Patch36:       angle.patch
+Patch37:       %{name}-build.patch
+Patch38:       vaapi_include.patch
 URL:           http://www.chromium.org/Home
 %{?with_gconf:BuildRequires:   GConf2-devel}
 %{?with_system_mesa:BuildRequires:     Mesa-libGL-devel >= 9.1}
@@ -139,7 +155,7 @@ BuildRequires:      hicolor-icon-theme
 BuildRequires: libevent-devel
 %{?with_system_libexif:BuildRequires:  libexif-devel >= 1:0.6.21}
 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
-BuildRequires: libicu-devel >= 4.6
+%{?with_system_icu:BuildRequires:      libicu-devel >= 4.6}
 %{!?with_libjpegturbo:BuildRequires:   libjpeg-devel}
 %{?with_libjpegturbo:BuildRequires:    libjpeg-turbo-devel >= 1.2.0}
 %{?with_system_libmtp:BuildRequires:   libmtp-devel >= 1.1.3}
@@ -147,12 +163,13 @@ BuildRequires:    libpng-devel
 %{?with_selinux:BuildRequires: libselinux-devel}
 BuildRequires: libstdc++-devel
 %{?with_system_libusb:BuildRequires:   libusb-devel >= 1.0}
-%{?with_system_libvpx:BuildRequires:   libvpx-devel >= 0.9.5-2}
-%{?with_system_libwebp:BuildRequires:  libwebp-devel >= 0.1.99}
+%{?with_system_libvpx:BuildRequires:   libvpx-devel >= 1.3.0}
+%{?with_system_libwebp:BuildRequires:  libwebp-devel >= 0.4.0}
 BuildRequires: libxml2-devel
 BuildRequires: libxslt-devel
 BuildRequires: man-db
 %{?with_system_minizip:BuildRequires:  minizip-devel}
+%{?with_ninja:BuildRequires:   ninja >= 1.3.0}
 BuildRequires: nspr-devel
 BuildRequires: nss-devel >= 1:3.12.3
 %{?with_system_opus:BuildRequires:     opus-devel >= 1.0.2}
@@ -165,8 +182,9 @@ BuildRequires:      pkgconfig
 %{?with_system_protobuf:BuildRequires: protobuf-devel}
 %{?with_pulseaudio:BuildRequires:      pulseaudio-devel}
 BuildRequires: python
+BuildRequires: python-BeautifulSoup
 #BuildRequires:        python-gyp >= 1-%{gyp_rev}
-BuildRequires: python-jinja2
+BuildRequires: python-jinja2 >= 2.7
 BuildRequires: python-modules
 BuildRequires: python-ply >= 3.4
 %{?with_system_re2:BuildRequires:      re2-devel >= 20130115-2}
@@ -196,9 +214,10 @@ Requires:  fonts-Type1-urw
 Requires:      hicolor-icon-theme
 Requires:      libevent >= 2.0.21
 %{?with_libjpegturbo:Requires: libjpeg-turbo >= 1.2.0}
-%{?with_system_libvpx:Requires:        libvpx >= 0.9.5-2}
+%{?with_system_libvpx:Requires:        libvpx >= 1.3.0}
 Requires:      lsb-release
 %{?with_system_re2:Requires:   re2 >= 20130115-2}
+%{?with_system_protobuf:Requires:      protobuf-libs >= 2.5.0-2}
 Requires:      shared-mime-info
 %{?with_system_sqlite:Requires:        sqlite3(icu)}
 Requires:      xdg-utils >= 1.0.2-4
@@ -221,6 +240,16 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
 %define                gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
 
+%ifarch %{ix86}
+%define                target_arch ia32
+%endif
+%ifarch %{x8664}
+%define                target_arch x64
+%endif
+
+%define                buildtype       %{?debug:Debug}%{!?debug:Release}
+%define                builddir        out/%{buildtype}
+
 %if %{without debuginfo}
 %define                _enable_debug_packages  0
 %endif
@@ -257,11 +286,11 @@ zh-TW
 %prep
 %setup -qc
 %if "%{?patchver}" != ""
-cd %{name}-%{branch}.%{basever}
+cd chromium*-%{branch}.%{basever}
 %patch0 -p1
 cd ..
 %endif
-mv %{name}-%{branch}.%{basever}/* .
+mv chromium*-%{branch}.%{basever}/* .
 
 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
@@ -272,9 +301,6 @@ test "$chrome" = %{version}
 gyp_rev=$(grep googlecode_url.*gyp DEPS | cut -d'"' -f6 | cut -d@ -f2)
 test "$gyp_rev" = %{gyp_rev} || :
 
-. ./v8.sh
-v8=$MAJOR_VERSION.$MINOR_VERSION.$BUILD_NUMBER.$PATCH_LEVEL
-
 # add chromium and pld to useragent
 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
@@ -285,21 +311,24 @@ sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
 %{__sed} -e 's,@localedir@,%{_datadir}/%{name},' %{SOURCE5} > find-lang.sh
 ln -s %{SOURCE7} .
 
-%patch1 -p1
-%patch4 -p3
+#%patch2 -p1 CHECK
 %patch7 -p1
-%patch10 -p1
 %patch15 -p2
 %{!?with_libjpegturbo:%patch11 -p0}
-%patch12 -p1
 %patch16 -p1
 %patch28 -p1
-%patch25 -p2
+%patch25 -p1
 %{?with_nacl:%patch18 -p1}
-%patch24 -p2
+%patch24 -p1
 %patch26 -p2
-%patch29 -p0
-%patch30 -p0
+%patch31 -p0
+%patch32 -p1
+%patch35 -p1
+%patch36 -p1
+%patch37 -p1
+#%patch38 -p1 CHECK
+
+%{?with_dev:exit 0}
 
 sh -x clean-source.sh \
        %{!?with_nacl:nacl=0} \
@@ -311,7 +340,9 @@ sh -x clean-source.sh \
        %{!?with_system_snappy:snappy=0} \
        %{!?with_system_sqlite:sqlite=0} \
        %{!?with_system_v8:v8=0} \
+       %{!?with_system_libwebp:libwebp=0} \
        %{!?with_system_zlib:zlib=0} \
+       %{!?with_system_ffmpeg:ffmpeg=0} \
        %{nil}
 
 %build
@@ -351,25 +382,34 @@ cd ../../../../..
 fi
 %endif
 
-flags="
-%ifarch %{ix86}
-       -Dtarget_arch=ia32 \
-%endif
-%ifarch %{x8664}
-       -Dtarget_arch=x64 \
+%if %{without system_ffmpeg}
+if [ ! -d third_party/ffmpeg/build.%{target_arch}.linux ]; then
+       # Re-configure bundled ffmpeg
+       cd third_party/ffmpeg
+       chromium/scripts/build_ffmpeg.py linux %{target_arch} \
+               --branding Chromium
+       chromium/scripts/copy_config.sh
+       chromium/scripts/generate_gyp.py
+       cd -
+fi
 %endif
+
+third_party/libaddressinput/chromium/tools/update-strings.py
+
+flags="
+       -Dtarget_arch=%{target_arch} \
+       -Dpython_arch=%{target_arch} \
+       -Dffmpeg_branding=Chromium \
+       -Dsystem_libdir=%{_lib} \
+       -Dpython_ver=%{py_ver} \
 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
        -Dno_strict_aliasing=1 -Dgcc_version=44 \
 %endif
-%if %{with sandboxing}
-       -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
-       -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
-%endif
-       %{!?debug:-Dwerror=} \
+       %{!?debug:-Dwerror= -Ddisable_fatal_linker_warnings=} \
        %{!?debuginfo:-Dfastbuild=1 -Dremove_webcore_debug_symbols=1} \
        %{?with_shared_libs:-Dlibrary=shared_library} \
-       %{!?with_system_ffmpeg:-Dbuild_ffmpegsumo=1} -Dproprietary_codecs=1 \
-       -Dinclude_tests=0 \
+       %{!?with_system_ffmpeg:-Dbuild_ffmpegsumo=1} \
+       -Dinclude_tests__=0 \
 %if %{with nacl}
        -Dnaclsdk_mode=custom:/usr/x86_64-nacl \
        -Ddisable_glibc_untar=1 \
@@ -386,9 +426,12 @@ flags="
        -Dusb_ids_path=$(pkg-config --variable usbids usbutils) \
        -Dlinux_link_libpci=1 \
        -Dlinux_link_libspeechd=1 -Dlibspeechd_h_prefix=speech-dispatcher/ \
-       %{!?with_tcmalloc:-Dlinux_use_tcmalloc=0} \
+       -Duse_allocator=%{!?with_tcmalloc:none}%{?with_tcmalloc:tcmalloc} \
        %{?with_gps:-Dlinux_use_libgps=1 -Dlinux_link_libgps=1} \
-       -Dlinux_use_gold_binary=0 \
+       -Dclang=0 \
+       -Dhost_clang=0 \
+       -Dlinux_use_bundled_binutils=0 \
+       -Dlinux_use_bundled_gold=0 \
        -Dlinux_use_gold_flags=0 \
        -Dlogging_like_official_build=1 \
        -Dgoogle_api_key=%{google_api_key} \
@@ -402,12 +445,13 @@ flags="
        %{gyp_with system_ffmpeg} -Dmedia_use_ffmpeg=1 \
        %{gyp_with system_flac} \
        %{gyp_with system_harfbuzz} \
+       %{gyp_with system_icu} %{?with_system_icu:-Dicu_use_data_file_flag=0} \
        %{gyp_with system_jsoncpp} \
        %{gyp_with system_libexif} \
        %{gyp_with system_libmtp} \
        %{gyp_with system_libsrtp} \
        %{gyp_with system_libusb} \
-       %{gyp_with system_libvpx} -Dmedia_use_libvpx=0 \
+       %{gyp_with system_libvpx} -Dmedia_use_libvpx=1 \
        %{gyp_with system_libwebp} \
        %{gyp_with system_libxnvctrl} \
        %{gyp_with system_mesa} \
@@ -423,7 +467,6 @@ flags="
        %{gyp_with system_zlib} \
        -Duse_system_bzip2=1 \
        -Duse_system_expat=1 \
-       -Duse_system_icu=1 \
        -Duse_system_libevent=1 \
        -Duse_system_libjpeg=1 \
        -Duse_system_libpng=1 \
@@ -435,8 +478,13 @@ flags="
 
 build/linux/unbundle/replace_gyp_files.py $flags
 
-test %{_specdir}/%{name}.spec -nt Makefile && %{__rm} -f Makefile
-test -e Makefile || \
+%if %{with ninja}
+chkfile=%{builddir}/build.ninja
+%else
+chkfile=Makefile
+%endif
+test %{_specdir}/%{name}.spec -nt $chkfile && %{__rm} -f $chkfile
+test -e $chkfile || \
        CC="%{__cc}" \
        CXX="%{__cxx}" \
        LDFLAGS="%{rpmldflags} -fuse-ld=gold" \
@@ -446,20 +494,26 @@ test -e Makefile || \
        CXX_host="%{__cxx}" \
        LD_host="%{__cxx}" \
 %{__python} build/gyp_chromium \
-       --format=make \
+       --format=%{?with_ninja:ninja}%{!?with_ninja:make} \
        --depth=. \
        build/all.gyp \
        $flags
 
+%if %{with ninja}
+ninja %{?_smp_mflags} %{?with_verbose:-v} -C %{builddir} \
+%else
 # need {CC/CXX/LDFLAGS}.host overrides for v8 build
-%{__make} -r chrome %{?with_sandboxing:chrome_sandbox} \
-       BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
+%{__make} -r \
+       BUILDTYPE=%{buildtype} \
        %{?with_verbose:V=1} \
        CC.host="%{__cc}" \
        CXX.host="%{__cxx}" \
        LDFLAGS.host="%{rpmldflags} -fuse-ld=gold" \
+%endif
+       chrome %{?with_sandboxing:chrome_sandbox} \
+       %{nil}
 
-cd out/%{!?debug:Release}%{?debug:Debug}
+cd %{builddir}
 MANWIDTH=80 man ./chrome.1 > man.out
 %{__sed} -e '1,/OPTIONS/d; /ENVIRONMENT/,$d' man.out > options.txt
 
@@ -467,9 +521,10 @@ MANWIDTH=80 man ./chrome.1 > man.out
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins \
        $RPM_BUILD_ROOT%{_datadir}/%{name}/{locales,resources} \
-       $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/%{name},%{_mandir}/man1,%{_desktopdir}}
+       $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir}} \
+       $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{native-messaging-hosts,policies/managed}
 
-cd out/%{!?debug:Release}%{?debug:Debug}
+cd %{builddir}
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default
 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
 %{__sed} -i -e '
@@ -481,12 +536,12 @@ install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
        }
 ' $RPM_BUILD_ROOT%{_bindir}/%{name}
 cp -a locales resources $RPM_BUILD_ROOT%{_datadir}/%{name}
-cp -a *.pak $RPM_BUILD_ROOT%{_libdir}/%{name}
+cp -p *.pak *.bin $RPM_BUILD_ROOT%{_libdir}/%{name}
 ln -s %{_datadir}/%{name}/locales $RPM_BUILD_ROOT%{_libdir}/%{name}/locales
 ln -s %{_datadir}/%{name}/resources $RPM_BUILD_ROOT%{_libdir}/%{name}/resources
 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
-install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
+install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome-sandbox
 %if %{without system_ffmpeg}
 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
 %endif
@@ -562,6 +617,9 @@ fi
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/master_preferences
+%dir %{_sysconfdir}/%{name}/native-messaging-hosts
+%dir %{_sysconfdir}/%{name}/policies
+%dir %{_sysconfdir}/%{name}/policies/managed
 %attr(755,root,root) %{_bindir}/%{name}
 %{_mandir}/man1/%{name}.1*
 %{_desktopdir}/*.desktop
@@ -569,7 +627,10 @@ fi
 %dir %{_libdir}/%{name}
 %{_libdir}/%{name}/chrome*.pak
 %{_libdir}/%{name}/content_resources.pak
+%{_libdir}/%{name}/keyboard_resources.pak
 %{_libdir}/%{name}/resources.pak
+%{_libdir}/%{name}/natives_blob.bin
+%{_libdir}/%{name}/snapshot_blob.bin
 %{_libdir}/%{name}/locales
 %{_libdir}/%{name}/resources
 
@@ -582,7 +643,7 @@ fi
 %dir %{_libdir}/%{name}/plugins
 %attr(755,root,root) %{_libdir}/%{name}/%{name}
 # These unique permissions are intentional and necessary for the sandboxing
-%attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
+%attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
 
 # ffmpeg libs
 %if %{without system_ffmpeg}
This page took 0.128143 seconds and 4 git commands to generate.