summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <gilles@gandi.net>2013-02-06 17:11:21 +0100
committerGilles Dartiguelongue <eva@gentoo.org>2013-02-06 17:30:44 +0100
commit241093dd9eb03ef78ec08c15aed98faf22d96d15 (patch)
tree35280f8bbe9c6faefd38e9f6f48ff859edfc345d /dev-util
parentdev-lang/less: initial ebuild (diff)
downloadeva-241093dd9eb03ef78ec08c15aed98faf22d96d15.tar.gz
eva-241093dd9eb03ef78ec08c15aed98faf22d96d15.tar.bz2
eva-241093dd9eb03ef78ec08c15aed98faf22d96d15.zip
dev-util/google-perftools: re-add static-libs support
* plus a few ebuild fixes * static-libs needed for rethinkdb
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/google-perftools/Manifest11
-rw-r--r--dev-util/google-perftools/files/gperftools-2.0+glibc-2.16.patch13
-rw-r--r--dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch17
-rw-r--r--dev-util/google-perftools/google-perftools-2.0-r1.ebuild86
-rw-r--r--dev-util/google-perftools/metadata.xml23
5 files changed, 150 insertions, 0 deletions
diff --git a/dev-util/google-perftools/Manifest b/dev-util/google-perftools/Manifest
new file mode 100644
index 0000000..8c2e1b8
--- /dev/null
+++ b/dev-util/google-perftools/Manifest
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA512
+
+DIST gperftools-2.0.tar.gz 1261243 SHA256 7de3dd91f018825b1e7d332af1edace15c6211f430186febede1835069861080 SHA512 61bf7a26974058912a4165cbc363351bc735599d36ab569dc7e84a75a690adbc17a4178512a57469fc7c17befaad2a271ef4ea5c29a36b664153938939269926 WHIRLPOOL 4f49a7da976040cacdecb8e18294b09fbfe276422ba35058476a14a3c1df072f8748d70f738adafa03a3a445701ed32b6232f13962d8ec8c5a968652414797a6
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.19 (GNU/Linux)
+
+iEYEAREKAAYFAlEShPUACgkQ1fmVwcYIWAabzwCbB3AyQo1vyuEfri3PUlMpg1Uj
+iKIAoIYmB95Uez9EJRt6T7QNSEbV1yVv
+=mAM8
+-----END PGP SIGNATURE-----
diff --git a/dev-util/google-perftools/files/gperftools-2.0+glibc-2.16.patch b/dev-util/google-perftools/files/gperftools-2.0+glibc-2.16.patch
new file mode 100644
index 0000000..b17e0d5
--- /dev/null
+++ b/dev-util/google-perftools/files/gperftools-2.0+glibc-2.16.patch
@@ -0,0 +1,13 @@
+Index: gperftools-2.0/src/base/linuxthreads.cc
+===================================================================
+--- gperftools-2.0.orig/src/base/linuxthreads.cc
++++ gperftools-2.0/src/base/linuxthreads.cc
+@@ -193,7 +193,7 @@ static volatile int *sig_pids, sig_num_t
+ /* Signal handler to help us recover from dying while we are attached to
+ * other threads.
+ */
+-static void SignalHandler(int signum, siginfo_t *si, void *data) {
++static void SignalHandler(int signum, struct siginfo *si, void *data) {
+ if (sig_pids != NULL) {
+ if (signum == SIGABRT) {
+ while (sig_num_threads-- > 0) {
diff --git a/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch b/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch
new file mode 100644
index 0000000..df89a92
--- /dev/null
+++ b/dev-util/google-perftools/files/gperftools-2.0-32bit-barrier.patch
@@ -0,0 +1,17 @@
+Atomic64 not available on all architectures.
+Use AtomicWord instead.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar gperftools-2.0.orig/src/base/spinlock_internal.cc gperftools-2.0/src/base/spinlock_internal.cc
+--- gperftools-2.0.orig/src/base/spinlock_internal.cc 2012-02-02 21:36:23.000000000 +0000
++++ gperftools-2.0/src/base/spinlock_internal.cc 2013-01-20 23:44:01.629077919 +0000
+@@ -80,7 +80,7 @@
+ static int SuggestedDelayNS(int loop) {
+ // Weak pseudo-random number generator to get some spread between threads
+ // when many are spinning.
+- static base::subtle::Atomic64 rand;
++ static AtomicWord rand;
+ uint64 r = base::subtle::NoBarrier_Load(&rand);
+ r = 0x5deece66dLL * r + 0xb; // numbers from nrand48()
+ base::subtle::NoBarrier_Store(&rand, r);
diff --git a/dev-util/google-perftools/google-perftools-2.0-r1.ebuild b/dev-util/google-perftools/google-perftools-2.0-r1.ebuild
new file mode 100644
index 0000000..4b36119
--- /dev/null
+++ b/dev-util/google-perftools/google-perftools-2.0-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/google-perftools/google-perftools-2.0-r1.ebuild,v 1.1 2013/01/20 23:48:29 robbat2 Exp $
+
+EAPI="5"
+
+MY_P="gperftools-${PV}"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Fast, multi-threaded malloc() and nifty performance analysis tools"
+HOMEPAGE="http://code.google.com/p/gperftools/"
+SRC_URI="http://gperftools.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+# contains ASM code, with support for
+# freebsd x86/amd64
+# linux x86/amd64/ppc/ppc64/arm
+# OSX ppc/amd64
+# AIX ppc/ppc64
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd"
+IUSE="largepages +debug minimal static-libs test"
+
+DEPEND="sys-libs/libunwind"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ # set up the make options in here so that we can actually make use
+ # of them on both compile and install.
+
+ # Avoid building the unit testing if we're not going to execute
+ # tests; this trick here allows us to ignore the tests without
+ # touching the build system (and thus without rebuilding
+ # autotools). Keep commented as long as it's restricted.
+ use test || \
+ makeopts="${makeopts} noinst_PROGRAMS= "
+
+ # don't install _anything_ from the documentation, since it would
+ # install it in non-standard locations, and would just waste time.
+ makeopts="${makeopts} dist_doc_DATA= "
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${MY_P}+glibc-2.16.patch"
+ epatch "${FILESDIR}/${MY_P}-32bit-barrier.patch"
+}
+
+src_configure() {
+ use largepages && append-cppflags -DTCMALLOC_LARGE_PAGES
+
+ append-flags -fno-strict-aliasing -fno-omit-frame-pointer
+
+ econf \
+ --enable-fast-install \
+ $(use_enable debug debugalloc) \
+ $(use_enable minimal) \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake ${makeopts}
+}
+
+src_test() {
+ case "${LD_PRELOAD}" in
+ *libsandbox*)
+ ewarn "Unable to run tests when sanbox is enabled."
+ ewarn "See http://bugs.gentoo.org/290249"
+ return 0
+ ;;
+ esac
+
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install ${makeopts}
+
+ prune_libtool_files
+
+ dodoc README AUTHORS ChangeLog TODO NEWS
+ dohtml -r doc/*
+}
diff --git a/dev-util/google-perftools/metadata.xml b/dev-util/google-perftools/metadata.xml
new file mode 100644
index 0000000..72dcd90
--- /dev/null
+++ b/dev-util/google-perftools/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="largepages">
+ Use (experimental) larger pages for tcmalloc, this increases
+ memory usage, but should speed up the allocation/free
+ operations.
+ </flag>
+ <flag name="debug">
+ Build a set of libraries with debug support (so-called
+ debugalloc). These are available by default but are not needed
+ unless you're actually developing using tcmalloc.
+ </flag>
+ <flag name="minimal">
+ Only build the tcmalloc_minimal library, ignoring the heap
+ checker and the profilers.
+ </flag>
+ </use>
+</pkgmetadata>