summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-10-29 22:36:02 +0100
committerSam James <sam@gentoo.org>2021-10-29 23:22:32 +0100
commit12159ad28ed7d83cdee11e9b76dfc87480a4693f (patch)
tree6922966aaf33baf66b6b34971de161a51dddcb85 /dev-libs/mimalloc
parentdev-cpp/tbb: add 2021.4.0 (diff)
downloadgentoo-12159ad28ed7d83cdee11e9b76dfc87480a4693f.tar.gz
gentoo-12159ad28ed7d83cdee11e9b76dfc87480a4693f.tar.bz2
gentoo-12159ad28ed7d83cdee11e9b76dfc87480a4693f.zip
dev-libs/mimalloc: initial import
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/mimalloc')
-rw-r--r--dev-libs/mimalloc/Manifest1
-rw-r--r--dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch29
-rw-r--r--dev-libs/mimalloc/metadata.xml11
-rw-r--r--dev-libs/mimalloc/mimalloc-1.7.2.ebuild32
4 files changed, 73 insertions, 0 deletions
diff --git a/dev-libs/mimalloc/Manifest b/dev-libs/mimalloc/Manifest
new file mode 100644
index 000000000000..327db3621b93
--- /dev/null
+++ b/dev-libs/mimalloc/Manifest
@@ -0,0 +1 @@
+DIST mimalloc-1.7.2.tar.gz 903317 BLAKE2B 6983a575c8e3a9ee92acc0042bc229805b7090794de6e693ff1cc344cd50e333d46f23663fbd16647ae4442b28f24bdc2043b46ed2bc16e13c3f8def08b155bb SHA512 5d78c5cc00dfff3dd7eb4bb59e8eff32397f5110d1183b4656cb56c40b88e2e648e3b18338119412b95ba9526937b16fce3aa4732f241a61a546e2bcea1efc9d
diff --git a/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch b/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch
new file mode 100644
index 000000000000..99b86f311264
--- /dev/null
+++ b/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch
@@ -0,0 +1,29 @@
+https://github.com/microsoft/mimalloc/pull/463
+
+From: Yaroslav Syrytsia <me@ys.lc>
+Date: Tue, 28 Sep 2021 20:34:56 +0300
+Subject: [PATCH] cmake: removed hardcoded names for top level configuration
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,6 +24,7 @@ option(MI_DEBUG_UBSAN "Build with undefined-behavior sanitizer (needs clan
+ option(MI_CHECK_FULL "Use full internal invariant checking in DEBUG mode (deprecated, use MI_DEBUG_FULL instead)" OFF)
+ option(MI_INSTALL_TOPLEVEL "Install directly into $CMAKE_INSTALL_PREFIX instead of PREFIX/lib/mimalloc-version" OFF)
+
++include(GNUInstallDirs)
+ include("cmake/mimalloc-config-version.cmake")
+
+ set(mi_sources
+@@ -208,9 +209,9 @@ endif()
+ # -----------------------------------------------------------------------------
+
+ if (MI_INSTALL_TOPLEVEL)
+- set(mi_install_libdir "lib")
+- set(mi_install_incdir "include")
+- set(mi_install_cmakedir "cmake")
++ set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}")
++ set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}")
++ set(mi_install_cmakedir "${CMAKE_INSTALL_LIBDIR}/cmake/mimalloc")
+ else()
+ set(mi_install_libdir "lib/mimalloc-${mi_version}")
+ set(mi_install_incdir "include/mimalloc-${mi_version}")
diff --git a/dev-libs/mimalloc/metadata.xml b/dev-libs/mimalloc/metadata.xml
new file mode 100644
index 000000000000..07fc15aa3a03
--- /dev/null
+++ b/dev-libs/mimalloc/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">microsoft/mimalloc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-libs/mimalloc/mimalloc-1.7.2.ebuild b/dev-libs/mimalloc/mimalloc-1.7.2.ebuild
new file mode 100644
index 000000000000..33efb631d03b
--- /dev/null
+++ b/dev-libs/mimalloc/mimalloc-1.7.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="mimalloc is a compact general purpose allocator with excellent performance"
+HOMEPAGE="https://github.com/microsoft/mimalloc"
+SRC_URI="https://github.com/microsoft/mimalloc/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/1"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7.2-GNUInstallDirs.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ # TODO: build hardened variant?
+ #-DMI_SECURE=$(usex hardened)
+
+ -DMI_INSTALL_TOPLEVEL=ON
+ -DMI_BUILD_TESTS=$(usex test)
+ )
+
+ cmake_src_configure
+}