Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/mimalloc/files/, dev-libs/mimalloc/
Date: Fri, 29 Oct 2021 22:23:19
Message-Id: 1635546152.12159ad28ed7d83cdee11e9b76dfc87480a4693f.sam@gentoo
1 commit: 12159ad28ed7d83cdee11e9b76dfc87480a4693f
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 29 21:36:02 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 29 22:22:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12159ad2
7
8 dev-libs/mimalloc: initial import
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 dev-libs/mimalloc/Manifest | 1 +
13 .../files/mimalloc-1.7.2-GNUInstallDirs.patch | 29 ++++++++++++++++++++
14 dev-libs/mimalloc/metadata.xml | 11 ++++++++
15 dev-libs/mimalloc/mimalloc-1.7.2.ebuild | 32 ++++++++++++++++++++++
16 4 files changed, 73 insertions(+)
17
18 diff --git a/dev-libs/mimalloc/Manifest b/dev-libs/mimalloc/Manifest
19 new file mode 100644
20 index 00000000000..327db3621b9
21 --- /dev/null
22 +++ b/dev-libs/mimalloc/Manifest
23 @@ -0,0 +1 @@
24 +DIST mimalloc-1.7.2.tar.gz 903317 BLAKE2B 6983a575c8e3a9ee92acc0042bc229805b7090794de6e693ff1cc344cd50e333d46f23663fbd16647ae4442b28f24bdc2043b46ed2bc16e13c3f8def08b155bb SHA512 5d78c5cc00dfff3dd7eb4bb59e8eff32397f5110d1183b4656cb56c40b88e2e648e3b18338119412b95ba9526937b16fce3aa4732f241a61a546e2bcea1efc9d
25
26 diff --git a/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch b/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch
27 new file mode 100644
28 index 00000000000..99b86f31126
29 --- /dev/null
30 +++ b/dev-libs/mimalloc/files/mimalloc-1.7.2-GNUInstallDirs.patch
31 @@ -0,0 +1,29 @@
32 +https://github.com/microsoft/mimalloc/pull/463
33 +
34 +From: Yaroslav Syrytsia <me@××.lc>
35 +Date: Tue, 28 Sep 2021 20:34:56 +0300
36 +Subject: [PATCH] cmake: removed hardcoded names for top level configuration
37 +
38 +--- a/CMakeLists.txt
39 ++++ b/CMakeLists.txt
40 +@@ -24,6 +24,7 @@ option(MI_DEBUG_UBSAN "Build with undefined-behavior sanitizer (needs clan
41 + option(MI_CHECK_FULL "Use full internal invariant checking in DEBUG mode (deprecated, use MI_DEBUG_FULL instead)" OFF)
42 + option(MI_INSTALL_TOPLEVEL "Install directly into $CMAKE_INSTALL_PREFIX instead of PREFIX/lib/mimalloc-version" OFF)
43 +
44 ++include(GNUInstallDirs)
45 + include("cmake/mimalloc-config-version.cmake")
46 +
47 + set(mi_sources
48 +@@ -208,9 +209,9 @@ endif()
49 + # -----------------------------------------------------------------------------
50 +
51 + if (MI_INSTALL_TOPLEVEL)
52 +- set(mi_install_libdir "lib")
53 +- set(mi_install_incdir "include")
54 +- set(mi_install_cmakedir "cmake")
55 ++ set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}")
56 ++ set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}")
57 ++ set(mi_install_cmakedir "${CMAKE_INSTALL_LIBDIR}/cmake/mimalloc")
58 + else()
59 + set(mi_install_libdir "lib/mimalloc-${mi_version}")
60 + set(mi_install_incdir "include/mimalloc-${mi_version}")
61
62 diff --git a/dev-libs/mimalloc/metadata.xml b/dev-libs/mimalloc/metadata.xml
63 new file mode 100644
64 index 00000000000..07fc15aa3a0
65 --- /dev/null
66 +++ b/dev-libs/mimalloc/metadata.xml
67 @@ -0,0 +1,11 @@
68 +<?xml version="1.0" encoding="UTF-8"?>
69 +<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
70 +<pkgmetadata>
71 + <maintainer type="person">
72 + <email>sam@g.o</email>
73 + <name>Sam James</name>
74 + </maintainer>
75 + <upstream>
76 + <remote-id type="github">microsoft/mimalloc</remote-id>
77 + </upstream>
78 +</pkgmetadata>
79
80 diff --git a/dev-libs/mimalloc/mimalloc-1.7.2.ebuild b/dev-libs/mimalloc/mimalloc-1.7.2.ebuild
81 new file mode 100644
82 index 00000000000..33efb631d03
83 --- /dev/null
84 +++ b/dev-libs/mimalloc/mimalloc-1.7.2.ebuild
85 @@ -0,0 +1,32 @@
86 +# Copyright 2021 Gentoo Authors
87 +# Distributed under the terms of the GNU General Public License v2
88 +
89 +EAPI=8
90 +
91 +inherit cmake
92 +
93 +DESCRIPTION="mimalloc is a compact general purpose allocator with excellent performance"
94 +HOMEPAGE="https://github.com/microsoft/mimalloc"
95 +SRC_URI="https://github.com/microsoft/mimalloc/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
96 +
97 +LICENSE="MIT"
98 +SLOT="0/1"
99 +KEYWORDS="~amd64"
100 +IUSE="test"
101 +RESTRICT="!test? ( test )"
102 +
103 +PATCHES=(
104 + "${FILESDIR}"/${PN}-1.7.2-GNUInstallDirs.patch
105 +)
106 +
107 +src_configure() {
108 + local mycmakeargs=(
109 + # TODO: build hardened variant?
110 + #-DMI_SECURE=$(usex hardened)
111 +
112 + -DMI_INSTALL_TOPLEVEL=ON
113 + -DMI_BUILD_TESTS=$(usex test)
114 + )
115 +
116 + cmake_src_configure
117 +}