%bcond_with selinux # with SELinux (need policy first)
%bcond_with shared_libs # with shared libs
%bcond_with sse2 # use SSE2 instructions
+%bcond_with tcmalloc # use tcmalloc
%bcond_with system_sqlite # with system sqlite
%bcond_without system_flac # with system flac
%bcond_without system_libwebp # with system libwebp
# https://bugs.gentoo.org/show_bug.cgi?id=393471
# libjpeg-turbo >= 1.1.90 supports that feature
Patch11: chromium-revert-jpeg-swizzle-r2.patch
-# https://code.google.com/p/chromium/issues/detail?id=119903
+Patch12: tcmalloc.patch
URL: http://www.chromium.org/Home
%{?with_gconf:BuildRequires: GConf2-devel}
BuildRequires: OpenGL-GLU-devel
%patch9 -p1
%patch10 -p1
%{!?with_libjpegturbo:%patch11 -p0}
+%patch12 -p0
cd ..
cd src
-Duse_system_libxml=1 \
-Duse_system_libxslt=1 \
-Duse_system_xdg_utils=1 \
+ %{!?with_tcmalloc:-Dlinux_use_tcmalloc=0} \
-Dlinux_use_gold_binary=0 \
-Dlinux_use_gold_flags=0
--- /dev/null
+from gentoo chromium-tcmalloc-r1.patch
+
+--- chrome/renderer/chrome_render_process_observer.cc.orig 2012-05-16 20:01:13.000000000 +0200
++++ chrome/renderer/chrome_render_process_observer.cc 2012-05-16 20:01:41.000000000 +0200
+@@ -32,8 +32,6 @@
+ #include "net/base/net_errors.h"
+ #include "net/base/net_module.h"
+ #include "third_party/sqlite/sqlite3.h"
+-#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
+-#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCrossOriginPreflightResultCache.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
+@@ -47,6 +45,11 @@
+ #include "base/win/iat_patch_function.h"
+ #endif
+
++#if defined(USE_TCMALLOC)
++#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
++#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
++#endif
++
+ using WebKit::WebCache;
+ using WebKit::WebCrossOriginPreflightResultCache;
+ using WebKit::WebFontCache;
+--- content/renderer/render_thread_impl.cc.orig 2012-05-19 13:08:56.000000000 +0200
++++ content/renderer/render_thread_impl.cc 2012-05-19 13:09:29.000000000 +0200
+@@ -63,7 +63,6 @@
+ #include "media/base/media.h"
+ #include "net/base/net_errors.h"
+ #include "net/base/net_util.h"
+-#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorName.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
+ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h"
+@@ -98,6 +97,10 @@
+ #include "ipc/ipc_channel_posix.h"
+ #endif
+
++#if defined(USE_TCMALLOC)
++#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
++#endif
++
+ using WebKit::WebDocument;
+ using WebKit::WebFrame;
+ using WebKit::WebNetworkStateNotifier;
+--- chrome/browser/memory_purger.cc.orig 2012-05-19 16:02:27.000000000 +0200
++++ chrome/browser/memory_purger.cc 2012-05-19 16:02:50.000000000 +0200
+@@ -22,7 +22,10 @@
+ #include "net/proxy/proxy_service.h"
+ #include "net/url_request/url_request_context.h"
+ #include "net/url_request/url_request_context_getter.h"
++
++#if defined(USE_TCMALLOC)
+ #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
++#endif
+
+ using content::BrowserContext;
+ using content::BrowserThread;