summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFantix King2015-02-28 18:09:34 +0800
committerFantix King2015-12-20 11:53:29 +0800
commitba7755fd3c739f6c8468525ab2632f01b1e799db (patch)
treee93801f20065b52c30e407fd3e5559180b000e4e
downloadaur-ba7755fd3c739f6c8468525ab2632f01b1e799db.tar.gz
3.6.0-1.1
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD50
-rw-r--r--jemalloc-stub.h13
-rw-r--r--libx32-jemalloc.install21
4 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..3a10134be02
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+# Generated by mksrcinfo v8
+# Sun Dec 20 03:53:17 UTC 2015
+pkgbase = libx32-jemalloc
+ pkgdesc = General-purpose scalable concurrent malloc implementation (x32 ABI)
+ pkgver = 3.6.0
+ pkgrel = 1.1
+ url = http://www.canonware.com/jemalloc/
+ arch = x86_64
+ license = BSD
+ makedepends = autoconf
+ makedepends = make
+ makedepends = bash
+ depends = libx32-glibc
+ optdepends = perl: memory profiler
+ source = http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2
+ source = jemalloc-stub.h
+ sha256sums = e16c2159dd3c81ca2dc3b5c9ef0d43e1f2f45b04548f42db12e7c12d7bdf84fe
+ sha256sums = 58f8b77e15df58934d9138d298fd4005d37b78ace48de757af2fea8deaf347ff
+
+pkgname = libx32-jemalloc
+ install = libx32-jemalloc.install
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..8ceb48311c4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,50 @@
+# $Id: PKGBUILD 224120 2014-10-08 19:52:45Z bpiotrowski $
+# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Contributor: Kovivchak Evgen <oneonfire@gmail.com>
+# x32 Maintainer: Fantix King <fantix.king@gmail.com>
+
+_pkgbasename=jemalloc
+pkgname=libx32-jemalloc
+pkgver=3.6.0
+pkgrel=1.1
+pkgdesc="General-purpose scalable concurrent malloc implementation (x32 ABI)"
+arch=('x86_64')
+license=('BSD')
+url="http://www.canonware.com/jemalloc/"
+depends=('libx32-glibc')
+makedepends=('autoconf' 'make' 'bash')
+optdepends=(
+ 'perl: memory profiler'
+)
+source=(http://www.canonware.com/download/jemalloc/$_pkgbasename-$pkgver.tar.bz2
+ jemalloc-stub.h)
+
+build() {
+ cd "$srcdir/$_pkgbasename-$pkgver"
+
+ export CC="gcc -mx32"
+ export CXX="g++ -mx32"
+ export PKG_CONFIG_PATH="/usr/libx32/pkgconfig"
+
+ CFLAGS="$CFLAGS -std=gnu11" ./configure --prefix=/usr --libdir=/usr/libx32
+ make
+}
+
+package() {
+ install="${pkgname}.install"
+
+ cd "$srcdir/$_pkgbasename-$pkgver"
+ make DESTDIR="$pkgdir" install
+ rm "$pkgdir"/usr/bin/pprof
+ mv "$pkgdir"/usr/bin/jemalloc{,-x32}.sh
+ mv "$pkgdir"/usr/include/jemalloc/jemalloc{,-x32}.h
+ install -Dm644 "${srcdir}/jemalloc-stub.h" "${pkgdir}/usr/include/jemalloc/jemalloc-stub.h"
+ chmod 644 "$pkgdir"/usr/libx32/*.a
+
+ rm -r "$pkgdir/usr/share"
+ mkdir -p "$pkgdir/usr/share/licenses"
+ ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
+}
+
+sha256sums=('e16c2159dd3c81ca2dc3b5c9ef0d43e1f2f45b04548f42db12e7c12d7bdf84fe'
+ '58f8b77e15df58934d9138d298fd4005d37b78ace48de757af2fea8deaf347ff')
diff --git a/jemalloc-stub.h b/jemalloc-stub.h
new file mode 100644
index 00000000000..6bd0fdb7ca6
--- /dev/null
+++ b/jemalloc-stub.h
@@ -0,0 +1,13 @@
+// This is replaced by libx32-jemalloc.
+// Old file is renamed to jemalloc-64.h.
+
+#if !defined __x86_64__
+# include "jemalloc-64.h" // no such lib32-jemalloc yet
+#endif
+#if defined __x86_64__ && defined __LP64__
+# include "jemalloc-64.h"
+#endif
+#if defined __x86_64__ && defined __ILP32__
+# include "jemalloc-x32.h"
+#endif
+
diff --git a/libx32-jemalloc.install b/libx32-jemalloc.install
new file mode 100644
index 00000000000..3ccbee35ecb
--- /dev/null
+++ b/libx32-jemalloc.install
@@ -0,0 +1,21 @@
+post_install() {
+ mv /usr/include/jemalloc/jemalloc.h /usr/include/jemalloc/jemalloc-64.h
+ ln -s jemalloc-stub.h /usr/include/jemalloc/jemalloc.h
+}
+
+post_upgrade() {
+ if [ ! -L /usr/include/jemalloc/jemalloc.h ]; then
+ post_install
+ elif [ ${1::-2} != ${2::-2} ]; then
+ echo WARNING: libx32-jemalloc is upgraded before jemalloc,
+ echo WARNING: you probably need to reinstall libx32-jemalloc.
+ fi
+}
+
+post_remove() {
+ if [ -L /usr/include/jemalloc/jemalloc.h ]; then
+ rm /usr/include/jemalloc/jemalloc.h
+ mv /usr/include/jemalloc/jemalloc-64.h /usr/include/jemalloc/jemalloc.h
+ fi
+}
+