summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksy Grabowski2021-02-07 16:23:23 +0100
committerAleksy Grabowski2021-02-07 19:21:20 +0100
commit362bad099aa5f4336a7fe3a3b6b8b6d3e74b9eef (patch)
treedbe58c110eafd0f5be74dc7062ff7e21655be25c
downloadaur-362bad099aa5f4336a7fe3a3b6b8b6d3e74b9eef.tar.gz
Initial commit
-rw-r--r--.SRCINFO19
-rw-r--r--Dockerfile22
-rw-r--r--Makefile.patch13
-rw-r--r--PKGBUILD47
4 files changed, 101 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f94b73f441f6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = libptmalloc3
+ pkgdesc = A multi-thread malloc and memory pool implementation
+ pkgver = 3
+ pkgrel = 1
+ url = http://www.malloc.de/
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = make
+ makedepends = gcc
+ source = http://www.malloc.de//malloc/ptmalloc3-current.tar.gz
+ source = Makefile.patch
+ md5sums = c0b9dd5f16f8eae979166dc74b60015c
+ md5sums = 1c223c6d09c407d6a971ffb98330f632
+ sha1sums = 50b9cd2e0cc0c9bc1856eab19d4051a62195560f
+ sha1sums = 32c08c9daa7697f0011a99151b376a8035145600
+
+pkgname = libptmalloc3
+
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000000..02a73dc9ace6
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+# Docker image that tests if the package builds in a minimal archlinux environemnt
+
+FROM archlinux
+
+# Preparation
+RUN pacman -Syu --needed --noconfirm base-devel
+
+# Configuration
+ARG BOT=buildbot
+ARG PROJECT=libptmalloc3
+
+# Creating new user
+RUN useradd --base-dir=/ -m --comment="Build Bot,$HOSTNAME,,," "$BOT"
+RUN echo "$BOT ALL=(ALL) NOPASSWD: ALL" > "/etc/sudoers.d/$BOT"
+
+# Actual build
+WORKDIR /$BOT
+USER $BOT
+COPY --chown="$BOT" PKGBUILD Makefile.patch ./
+RUN makepkg -sric --noconfirm
+RUN pacman -Ql "$PROJECT"
+RUN pacman -Qi "$PROJECT"
diff --git a/Makefile.patch b/Makefile.patch
new file mode 100644
index 000000000000..11cb77eee282
--- /dev/null
+++ b/Makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index e46b3ff..9b1b802 100644
+--- a/Makefile
++++ b/Makefile
+@@ -114,7 +114,7 @@ tst-independent-alloc$(T_SUF): tst-independent-alloc.c $(LIB_MALLOC)
+ posix:
+ $(MAKE) THR_FLAGS='-DUSE_TSD_DATA_HACK -D_REENTRANT' \
+ OPT_FLAGS='$(OPT_FLAGS)' SYS_FLAGS='$(SYS_FLAGS)' CC='$(CC)' \
+- INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.'
++ INC_FLAGS='-Isysdeps/pthread -Isysdeps/generic -I.'\
+ THR_LIBS=-lpthread
+
+ # posix threads with explicit initialization. Known to be needed on HPUX.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..42c0c8ff913b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Aleksy Grabowski <hurufu@gmail.com>
+
+pkgname=libptmalloc3
+pkgver=3
+pkgrel=1
+pkgdesc='A multi-thread malloc and memory pool implementation'
+arch=('i686' 'x86_64')
+url='http://www.malloc.de/'
+license=('custom')
+
+makedepends=(
+ make
+ gcc
+)
+
+source=(
+ "$url/malloc/ptmalloc3-current.tar.gz"
+ 'Makefile.patch'
+)
+md5sums=(
+ c0b9dd5f16f8eae979166dc74b60015c
+ 1c223c6d09c407d6a971ffb98330f632
+)
+sha1sums=(
+ 50b9cd2e0cc0c9bc1856eab19d4051a62195560f
+ 32c08c9daa7697f0011a99151b376a8035145600
+)
+
+prepare() {
+ patch 'ptmalloc3/Makefile' Makefile.patch
+}
+
+build() {
+ make -C 'ptmalloc3' OPT_FLAGS="$CPPFLAGS $CFLAGS $LDFLAGS" linux-shared
+}
+
+check() {
+ make -C 'ptmalloc3' -k check
+}
+
+package() {
+ cd 'ptmalloc3'
+ install -Dm755 -t "$pkgdir/usr/lib" libptmalloc3.so
+ install -Dm644 -t "$pkgdir/usr/lib" libptmalloc3.a
+ install -Dm644 -T malloc-2.8.3.h "$pkgdir/usr/include/ptmalloc3.h"
+ install -Dm444 -t "$pkgdir/usr/share/licenses/ptmalloc3" COPYRIGHT
+}