Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jemalloc : new recipe #1965

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
93 changes: 93 additions & 0 deletions dev-libs/jemalloc/jemalloc-5.1.0.recipe
@@ -0,0 +1,93 @@
SUMMARY="A general-purpose scalable concurrent allocator"
DESCRIPTION="jemalloc is a general purpose malloc(3) implementation that \
emphasizes fragmentation avoidance and scalable concurrency support. \
jemalloc first came into use as the FreeBSD libc allocator in 2005, and since \
then it has found its way into numerous applications that rely on its \
predictable behavior. In 2010 jemalloc development efforts broadened to \
include developer support features such as heap profiling and extensive \
monitoring/tuning hooks. Modern jemalloc releases continue to be integrated \
back into FreeBSD, and therefore versatility remains critical. Ongoing \
development efforts trend toward making jemalloc among the best allocators \
for a broad range of demanding applications, and eliminating/mitigating \
weaknesses that have practical repercussions for real world applications."
HOMEPAGE="https://jemalloc.net/"
COPYRIGHT="2002-2017 Jason Evans
2007-2012 Mozilla Foundation
2009-2017 Facebook, Inc."
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/jemalloc/jemalloc/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="ff28aef89df724bd7b6bd6fde8597695514e0e3404d1afad2f1eb8b55ef378d3"
PATCHES="jemalloc-$portVersion.patchset"

ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86"

libVersion="2"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
jemalloc$secondaryArchSuffix = $portVersion compat >= 5
cmd:jemalloc.sh$secondaryArchSuffix
cmd:jeprof$secondaryArchSuffix
lib:libjemalloc$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"

PROVIDES_devel="
jemalloc${secondaryArchSuffix}_devel = $portVersion compat >= 5
cmd:jemalloc_config$secondaryArchSuffix
devel:libjemalloc$secondaryArchSuffix = $libVersionCompat
devel:libjemalloc_pic$secondaryArchSuffix
"
REQUIRES_devel="
jemalloc$secondaryArchSuffix == $portVersion base
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:awk
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:xsltproc #required
"

defineDebugInfoPackage jemalloc$secondaryArchSuffix \
$libDir/libjemalloc.so.2

BUILD()
{
autoconf
runConfigure ./configure \
--enable-autogen
make $jobArgs
}

INSTALL()
{
make install_bin install_include install_lib

prepareInstalledDevelLibs libjemalloc libjemalloc_pic
fixPkgconfig

# devel package
packageEntries devel \
$developDir \
$binDir/jemalloc-config
}

TEST()
{
make check
}
41 changes: 41 additions & 0 deletions dev-libs/jemalloc/patches/jemalloc-5.1.0.patchset
@@ -0,0 +1,41 @@
From 4f5e6dd0cb8b86e480e5b93a003003c4d3327cd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Tue, 26 Dec 2017 11:27:11 +0100
Subject: [PATCH] Haiku supporting patches

---
configure.ac | 4 ++++
include/jemalloc/internal/jemalloc_internal_decls.h | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 1551ded..22f8fbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -549,6 +549,10 @@ case "${host}" in
abi="elf"
force_tls="0"
;;
+ *-*-haiku*)
+ abi="elf"
+ force_tls="0"
+ ;;
*-*-bitrig*)
abi="elf"
;;
diff --git a/include/jemalloc/internal/jemalloc_internal_decls.h b/include/jemalloc/internal/jemalloc_internal_decls.h
index 8ae5ef4..57824bb 100644
--- a/include/jemalloc/internal/jemalloc_internal_decls.h
+++ b/include/jemalloc/internal/jemalloc_internal_decls.h
@@ -9,7 +9,7 @@
#else
# include <sys/param.h>
# include <sys/mman.h>
-# if !defined(__pnacl__) && !defined(__native_client__)
+# if !defined(__pnacl__) && !defined(__native_client__) && !defined(__HAIKU__)
# include <sys/syscall.h>
# if !defined(SYS_write) && defined(__NR_write)
# define SYS_write __NR_write
--
2.15.1