From a44e547c0ba26206e8a60756ad8feab67d0c273f Mon Sep 17 00:00:00 2001 From: Artur Sinila Date: Tue, 29 Jun 2021 03:30:50 +0300 Subject: [PATCH] New package: mimalloc-1.7.2 --- common/shlibs | 1 + srcpkgs/mimalloc-devel | 1 + .../mimalloc/patches/00-fix-cmakelists.patch | 20 +++++++++++++ srcpkgs/mimalloc/patches/01-fix-test.patch | 11 ++++++++ srcpkgs/mimalloc/template | 28 +++++++++++++++++++ 5 files changed, 61 insertions(+) create mode 120000 srcpkgs/mimalloc-devel create mode 100644 srcpkgs/mimalloc/patches/00-fix-cmakelists.patch create mode 100644 srcpkgs/mimalloc/patches/01-fix-test.patch create mode 100644 srcpkgs/mimalloc/template diff --git a/common/shlibs b/common/shlibs index 8a7eef8df8c3..79fd2f5c3de0 100644 --- a/common/shlibs +++ b/common/shlibs @@ -417,6 +417,7 @@ libMAC.so.6 libMAC-5.28_1 libmad.so.0 libmad-0.15.1b_1 libmatroska.so.7 libmatroska-1.6.0_1 libmatrix_client.so.0.5.1 mtxclient-0.5.1_1 +libmimalloc.so.1.7 mimalloc-1.7.2_1 libebml.so.5 libebml-1.4.0_1 libdvdread.so.8 libdvdread-6.1.1_1 libdvdnav.so.4 libdvdnav-4.1.3_1 diff --git a/srcpkgs/mimalloc-devel b/srcpkgs/mimalloc-devel new file mode 120000 index 000000000000..9af584a917a5 --- /dev/null +++ b/srcpkgs/mimalloc-devel @@ -0,0 +1 @@ +mimalloc \ No newline at end of file diff --git a/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch b/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch new file mode 100644 index 000000000000..1d18ccd7d859 --- /dev/null +++ b/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -210,7 +210,7 @@ endif() + if (MI_INSTALL_TOPLEVEL) + set(mi_install_libdir "lib") + set(mi_install_incdir "include") +- set(mi_install_cmakedir "cmake") ++ set(mi_install_cmakedir "share/cmake") + else() + set(mi_install_libdir "lib/mimalloc-${mi_version}") + set(mi_install_incdir "include/mimalloc-${mi_version}") +@@ -224,7 +224,7 @@ else() + endif() + + string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC) +-if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel)$")) ++if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$")) + set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version + endif() + if(MI_BUILD_SHARED) diff --git a/srcpkgs/mimalloc/patches/01-fix-test.patch b/srcpkgs/mimalloc/patches/01-fix-test.patch new file mode 100644 index 000000000000..8846bfd522b5 --- /dev/null +++ b/srcpkgs/mimalloc/patches/01-fix-test.patch @@ -0,0 +1,11 @@ +--- a/test/test-api.c ++++ b/test/test-api.c +@@ -83,7 +83,7 @@ int main() { + void* p = mi_malloc(0); mi_free(p); + }); + CHECK_BODY("malloc-nomem1",{ +- result = (mi_malloc(SIZE_MAX/2) == NULL); ++ result = (mi_malloc(PTRDIFF_MAX) == NULL); + }); + CHECK_BODY("malloc-null",{ + mi_free(NULL); diff --git a/srcpkgs/mimalloc/template b/srcpkgs/mimalloc/template new file mode 100644 index 000000000000..6dece8cd5fe5 --- /dev/null +++ b/srcpkgs/mimalloc/template @@ -0,0 +1,28 @@ +# Template file for 'mimalloc' +pkgname=mimalloc +version=1.7.2 +revision=1 +build_style=cmake +configure_args="-DMI_INSTALL_TOPLEVEL=ON" +short_desc="MIcrosoft's malloc" +maintainer="Artur Sinila " +license="MIT" +homepage="https://github.com/microsoft/mimalloc" +distfiles="https://github.com/microsoft/mimalloc/archive/refs/tags/v${version}.tar.gz" +checksum=b1912e354565a4b698410f7583c0f83934a6dbb3ade54ab7ddcb1569320936bd + +post_install() { + vlicense LICENSE +} + +mimalloc-devel_package() { + depends="${pkgname}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/share/cmake + vmove usr/lib/*.a + vmove usr/lib/*.o + vmove usr/lib/*.so + } +}