From a323900c0ef23142200423d61f5271e0e85430c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 23 Feb 2014 20:02:48 +0200 Subject: [PATCH] up to 33.0.1750.117, disable system ffmpeg --- chromium-browser.spec | 44 +++++--- get-source.sh | 2 +- gn.patch | 12 +++ gnome3-volume-control.patch | 6 +- system-ffmpeg.patch | 194 +++++++++++++++--------------------- 5 files changed, 127 insertions(+), 131 deletions(-) create mode 100644 gn.patch diff --git a/chromium-browser.spec b/chromium-browser.spec index c87c1e4..f99051a 100644 --- a/chromium-browser.spec +++ b/chromium-browser.spec @@ -14,7 +14,7 @@ %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_jsoncpp # system jsoncpp %bcond_without system_libexif # system libexif @@ -59,9 +59,9 @@ # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites # - to look for new tarball, use update-source.sh script -%define branch 32.0.1700 -%define basever 77 -%define patchver 107 +%define branch 33.0.1750 +%define basever 117 +#define patchver 107 %define gyp_rev 1014 Summary: A WebKit powered web browser Name: chromium-browser @@ -73,8 +73,8 @@ Version: %{branch}.%{basever} Release: 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: 80f2651040917887c8a7b42010c2ba6c +Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/dev/%{name}-%{branch}.%{basever}.tar.gz +# Source0-md5: 1b273c1a80983ca7679a7031855a9b41 %if "%{?patchver}" != "" Patch0: http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.patch.xz # Patch0-md5: 82e3012b5510187907bba50dadbe7137 @@ -106,6 +106,7 @@ Patch28: system-mesa.patch Patch30: system-ply.patch Patch31: system-jinja.patch Patch32: remove_bundled_libraries-stale.patch +Patch33: gn.patch URL: http://www.chromium.org/Home %{?with_gconf:BuildRequires: GConf2-devel} %{?with_system_mesa:BuildRequires: Mesa-libGL-devel >= 9.1} @@ -222,6 +223,13 @@ 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 + %if %{without debuginfo} %define _enable_debug_packages 0 %endif @@ -295,14 +303,16 @@ ln -s %{SOURCE7} . %patch12 -p1 %patch16 -p1 %patch28 -p1 -%patch25 -p2 +%patch25 -p1 %{?with_nacl:%patch18 -p1} %patch24 -p2 %patch26 -p2 %patch30 -p1 %patch31 -p0 %patch32 -p1 +%patch33 -p0 +exit 0 sh -x clean-source.sh \ %{!?with_nacl:nacl=0} \ %{!?with_system_libvpx:libvpx=0} \ @@ -354,17 +364,19 @@ cd ../../../../.. fi %endif -flags=" -%ifarch %{ix86} - -Dtarget_arch=ia32 \ - -Dpython_arch=ia32 \ -%endif -%ifarch %{x8664} - -Dtarget_arch=x64 \ - -Dpython_arch=x64 \ +%if %{without system_ffmpeg} +# Re-configure bundled ffmpeg +cd third_party/ffmpeg +chromium/scripts/build_ffmpeg.sh linux %{target_arch} "$PWD" config-only +chromium/scripts/copy_config.sh +cd - %endif + +flags=" + -Dtarget_arch=%{target_arch} \ + -Dpython_arch=%{target_arch} \ -Dsystem_libdir=%{_lib} \ - -Dpython_ver=2.7 \ + -Dpython_ver=%{py_ver} \ %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0" -Dno_strict_aliasing=1 -Dgcc_version=44 \ %endif diff --git a/get-source.sh b/get-source.sh index 5256e56..6168349 100755 --- a/get-source.sh +++ b/get-source.sh @@ -64,7 +64,7 @@ set -x if [ "$CHANNEL" != "dev" ]; then patch -p1 < $WORK_DIR/remove_bundled_libraries-stale.patch - sh -x $WORK_DIR/clean-source.sh emptydirs=1 v8=0 mesa=0 sqlite=0 libwebp=0 +# sh -x $WORK_DIR/clean-source.sh emptydirs=1 v8=0 mesa=0 sqlite=0 libwebp=0 patch -p1 -R < $WORK_DIR/remove_bundled_libraries-stale.patch fi diff --git a/gn.patch b/gn.patch new file mode 100644 index 0000000..5cb8c0e --- /dev/null +++ b/gn.patch @@ -0,0 +1,12 @@ +--- build/gyp_chromium.orig 2013-12-11 03:07:03.941915587 +0000 ++++ build/gyp_chromium 2013-12-11 03:07:29.812073301 +0000 +@@ -221,9 +221,6 @@ + + supplemental_includes = GetSupplementalFiles() + +- if not RunGN(supplemental_includes): +- sys.exit(1) +- + args.extend( + ['-I' + i for i in additional_include_files(supplemental_includes, args)]) + diff --git a/gnome3-volume-control.patch b/gnome3-volume-control.patch index e71c1a5..66e7927 100644 --- a/gnome3-volume-control.patch +++ b/gnome3-volume-control.patch @@ -1,6 +1,6 @@ ---- chromium-browser-26.0.1410.12/src/media/audio/linux/audio_manager_linux.cc~ 2013-02-21 12:02:26.000000000 +0200 -+++ chromium-browser-26.0.1410.12/src/media/audio/linux/audio_manager_linux.cc 2013-02-25 15:16:54.634665398 +0200 -@@ -92,7 +92,8 @@ +--- chromium-browser-33.0.1750.117/media/audio/alsa/audio_manager_alsa.cc~ 2014-02-20 22:27:58.000000000 +0200 ++++ chromium-browser-33.0.1750.117/media/audio/alsa/audio_manager_alsa.cc 2014-02-23 10:24:29.610111342 +0200 +@@ -53,7 +53,8 @@ CommandLine command_line(CommandLine::NO_PROGRAM); switch (base::nix::GetDesktopEnvironment(env.get())) { case base::nix::DESKTOP_ENVIRONMENT_GNOME: diff --git a/system-ffmpeg.patch b/system-ffmpeg.patch index f3c2b96..da7ea1c 100644 --- a/system-ffmpeg.patch +++ b/system-ffmpeg.patch @@ -1,115 +1,87 @@ ---- a/media/filters/ffmpeg_glue.h -+++ b/media/filters/ffmpeg_glue.h -@@ -28,9 +28,9 @@ - #include "base/basictypes.h" - #include "base/memory/scoped_ptr.h" - #include "media/base/media_export.h" -+#include "media/ffmpeg/ffmpeg_common.h" +Fix HOST_OS detection in build_ffpeg.sh +https://bugs.gentoo.org/show_bug.cgi?id=491466 + +Enable gold linker +https://bugs.gentoo.org/show_bug.cgi?id=491850 + +--- a/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh ++++ b/third_party/ffmpeg/chromium/scripts/build_ffmpeg.sh +@@ -75,7 +75,7 @@ + LIBAVUTIL_VERSION_MAJOR=52 - struct AVFormatContext; --struct AVIOContext; + case $(uname -sm) in +- Linux\ i386) ++ Linux\ i?86) + HOST_OS=linux + HOST_ARCH=ia32 + JOBS=$(grep processor /proc/cpuinfo | wc -l) +@@ -85,6 +85,11 @@ + HOST_ARCH=x64 + JOBS=$(grep processor /proc/cpuinfo | wc -l) + ;; ++ Linux\ arm*) ++ HOST_OS=linux ++ HOST_ARCH=arm ++ JOBS=$(grep processor /proc/cpuinfo | wc -l) ++ ;; + Darwin\ i386) + HOST_OS=mac + HOST_ARCH=ia32 +@@ -117,14 +122,6 @@ + echo "LD = $(ld --version | head -n1)" + echo - namespace media { +-# As of this writing gold 2.20.1-system.20100303 is unable to link FFmpeg. +-if ld --version | grep -q gold; then +- echo "gold is unable to link FFmpeg" +- echo +- echo "Switch /usr/bin/ld to the regular binutils ld and try again" +- exit 1 +-fi +- + # We want to use a sufficiently recent version of yasm on Windows. + if [[ "$TARGET_OS" == "win" || "$TARGET_OS" == "win-vs2013" ]]; then + if !(which yasm 2>&1 > /dev/null); then +@@ -292,14 +289,16 @@ + add_flag_common --extra-cflags=-m32 + add_flag_common --extra-ldflags=-m32 + elif [ "$TARGET_ARCH" = "arm" ]; then +- # This if-statement essentially is for chroot tegra2. +- add_flag_common --enable-cross-compile ++ if [ "$HOST_ARCH" != "arm" ]; then ++ # This if-statement essentially is for chroot tegra2. ++ add_flag_common --enable-cross-compile ---- a/media/ffmpeg/ffmpeg_common.cc.orig 2013-01-17 00:07:51.635057013 +0000 -+++ b/media/ffmpeg/ffmpeg_common.cc 2013-01-17 00:15:50.867406811 +0000 -@@ -85,8 +85,10 @@ - return kCodecGSM_MS; - case AV_CODEC_ID_PCM_MULAW: - return kCodecPCM_MULAW; -+#ifndef CHROMIUM_OMIT_AV_CODEC_ID_OPUS - case AV_CODEC_ID_OPUS: - return kCodecOpus; -+#endif - default: - DVLOG(1) << "Unknown audio CodecID: " << codec_id; - } -@@ -130,8 +132,10 @@ - return AV_CODEC_ID_GSM_MS; - case kCodecPCM_MULAW: - return AV_CODEC_ID_PCM_MULAW; -+#ifndef CHROMIUM_OMIT_AV_CODEC_ID_OPUS - case kCodecOpus: - return AV_CODEC_ID_OPUS; -+#endif - default: - DVLOG(1) << "Unknown AudioCodec: " << audio_codec; - } -@@ -149,8 +153,10 @@ - return kCodecMPEG4; - case AV_CODEC_ID_VP8: - return kCodecVP8; -+#ifndef CHROMIUM_OMIT_AV_CODEC_ID_VP9 - case AV_CODEC_ID_VP9: - return kCodecVP9; -+#endif - default: - DVLOG(1) << "Unknown video CodecID: " << codec_id; - } -@@ -167,8 +173,10 @@ - return AV_CODEC_ID_MPEG4; - case kCodecVP8: - return AV_CODEC_ID_VP8; -+#ifndef CHROMIUM_OMIT_AV_CODEC_ID_VP9 - case kCodecVP9: - return AV_CODEC_ID_VP9; -+#endif - default: - DVLOG(1) << "Unknown VideoCodec: " << video_codec; - } ---- a/media/filters/ffmpeg_demuxer.cc.orig 2013-05-09 18:04:25.089276403 +0000 -+++ b/media/filters/ffmpeg_demuxer.cc 2013-05-09 18:05:16.289599070 +0000 -@@ -111,12 +111,15 @@ - // Get side data if any. For now, the only type of side_data is VP8 Alpha. We - // keep this generic so that other side_data types in the future can be - // handled the same way as well. -- av_packet_split_side_data(packet.get()); - int side_data_size = 0; -- uint8* side_data = av_packet_get_side_data( -+ uint8* side_data = NULL; -+#ifndef CHROMIUM_OMIT_AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL -+ av_packet_split_side_data(packet.get()); -+ side_data = av_packet_get_side_data( - packet.get(), - AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, - &side_data_size); -+#endif +- # Location is for CrOS chroot. If you want to use this, enter chroot +- # and copy ffmpeg to a location that is reachable. +- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- +- add_flag_common --target-os=linux +- add_flag_common --arch=arm ++ # Location is for CrOS chroot. If you want to use this, enter chroot ++ # and copy ffmpeg to a location that is reachable. ++ add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- ++ add_flag_common --target-os=linux ++ add_flag_common --arch=arm ++ fi - // If a packet is returned by FFmpeg's av_parser_parse2() the packet will - // reference inner memory of FFmpeg. As such we should transfer the packet ---- a/media/base/media_posix.cc.orig 2013-05-24 20:59:12.963046035 +0000 -+++ b/media/base/media_posix.cc 2013-05-24 20:59:50.593275882 +0000 -@@ -11,12 +11,15 @@ - #include "base/path_service.h" - #include "base/strings/stringize_macros.h" - #include "media/ffmpeg/ffmpeg_common.h" -+ -+#if !defined(USE_SYSTEM_FFMPEG) - #include "third_party/ffmpeg/ffmpeg_stubs.h" - - using third_party_ffmpeg::kNumStubModules; - using third_party_ffmpeg::kModuleFfmpegsumo; - using third_party_ffmpeg::InitializeStubs; - using third_party_ffmpeg::StubPathMap; -+#endif - - namespace media { - namespace internal { -@@ -46,6 +49,9 @@ - #endif - - bool InitializeMediaLibraryInternal(const base::FilePath& module_dir) { -+#if defined(USE_SYSTEM_FFMPEG) -+ return true; -+#else - StubPathMap paths; - - // First try to initialize with Chrome's sumo library. -@@ -61,6 +67,7 @@ - FILE_PATH_LITERAL(DSO_NAME("avformat", AVFORMAT_VERSION))).value()); - - return InitializeStubs(paths); -+#endif - } - - } // namespace internal + # TODO(ihf): ARM compile flags are tricky. The final options + # overriding everything live in chroot /build/*/etc/make.conf +@@ -322,11 +321,13 @@ + # NOTE: softfp/hardfp selected at gyp time. + add_flag_common --extra-cflags=-mfloat-abi=hard + elif [ "$TARGET_ARCH" = "arm-neon" ]; then +- # This if-statement is for chroot arm-generic. +- add_flag_common --enable-cross-compile +- add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- +- add_flag_common --target-os=linux +- add_flag_common --arch=arm ++ if [ "$HOST_ARCH" != "arm" ]; then ++ # This if-statement is for chroot arm-generic. ++ add_flag_common --enable-cross-compile ++ add_flag_common --cross-prefix=/usr/bin/armv7a-cros-linux-gnueabi- ++ add_flag_common --target-os=linux ++ add_flag_common --arch=arm ++ fi + add_flag_common --enable-armv6 + add_flag_common --enable-armv6t2 + add_flag_common --enable-vfp -- 2.44.0