From 9d3cc048243533687334bfb2ecbdbca9cd2877fb Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Sun, 8 Jan 2023 11:21:49 +1100 Subject: [PATCH 1/2] New package: mimalloc-2.0.9 Closes: #35283 --- common/shlibs | 1 + srcpkgs/mimalloc-devel | 1 + .../mimalloc/patches/secure-basename.patch | 15 ++++++++ srcpkgs/mimalloc/template | 34 +++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 120000 srcpkgs/mimalloc-devel create mode 100644 srcpkgs/mimalloc/patches/secure-basename.patch create mode 100644 srcpkgs/mimalloc/template diff --git a/common/shlibs b/common/shlibs index 0f9c75af44bc..f4636d51ae31 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4238,3 +4238,4 @@ libdate-tz.so.3 chrono-date-3.0.1_1 libayatana-ido3-0.4.so.0 ayatana-ido-0.9.2_1 libayatana-indicator3.so.7 libayatana-indicator-0.9.3_1 libayatana-appindicator3.so.1 libayatana-appindicator-0.5.91_1 +libmimalloc.so.2 mimalloc-2.0.9_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/secure-basename.patch b/srcpkgs/mimalloc/patches/secure-basename.patch new file mode 100644 index 000000000000..ec0d0679f93c --- /dev/null +++ b/srcpkgs/mimalloc/patches/secure-basename.patch @@ -0,0 +1,15 @@ +# Set basename to always be 'mimalloc' for compatibility +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74c1f29..dfce140 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -311,9 +311,6 @@ else() + endif() + + set(mi_basename "mimalloc") +-if(MI_SECURE) +- set(mi_basename "${mi_basename}-secure") +-endif() + if(MI_VALGRIND) + set(mi_basename "${mi_basename}-valgrind") + endif() diff --git a/srcpkgs/mimalloc/template b/srcpkgs/mimalloc/template new file mode 100644 index 000000000000..af96d562697b --- /dev/null +++ b/srcpkgs/mimalloc/template @@ -0,0 +1,34 @@ +# Template file for 'mimalloc' +pkgname=mimalloc +version=2.0.9 +revision=1 +build_style=cmake +configure_args="$(vopt_bool secure MI_SECURE)" +short_desc="General purpose allocator with excellent performance characteristics" +maintainer="Peter Wang " +license="MIT" +homepage="https://github.com/microsoft/mimalloc" +distfiles="https://github.com/microsoft/mimalloc/archive/v${version}.tar.gz" +checksum=4a29edae32a914a706715e2ac8e7e4109e25353212edeed0888f4e3e15db5850 + +build_options="secure" +desc_option_secure="Build mimalloc in secure mode" + +if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + makedepends+=" libatomic-devel" +fi + +post_install() { + vlicense LICENSE +} + +mimalloc-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/cmake + vmove usr/lib/mimalloc-2.0 + vmove usr/lib/pkgconfig + } +} From f2f4cb49196fd2a9a7f454dbad4ee600a2d97045 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Sat, 21 Jan 2023 15:53:18 +1100 Subject: [PATCH 2/2] New package: mold-1.10.1 Closes: #34820 --- .../mold/patches/test-target-machine.patch | 19 +++++++++++++ srcpkgs/mold/template | 27 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 srcpkgs/mold/patches/test-target-machine.patch create mode 100644 srcpkgs/mold/template diff --git a/srcpkgs/mold/patches/test-target-machine.patch b/srcpkgs/mold/patches/test-target-machine.patch new file mode 100644 index 000000000000..a76b7fc236b6 --- /dev/null +++ b/srcpkgs/mold/patches/test-target-machine.patch @@ -0,0 +1,19 @@ +Allow tests to run when targeting i686 on a host where uname -m returns x86_64. + +diff --git a/test/elf/common.inc b/test/elf/common.inc +index 1366db94..c67e35e5 100644 +--- a/test/elf/common.inc ++++ b/test/elf/common.inc +@@ -13,7 +13,11 @@ canonical_name() { + esac + } + +-HOST=$(canonical_name $(uname -m)) ++if [ -n "$XBPS_TARGET_MACHINE" ]; then ++ HOST=$(canonical_name "${XBPS_TARGET_MACHINE%-musl}") ++else ++ HOST=$(canonical_name $(uname -m)) ++fi + + if [ -n "$TRIPLE" ]; then + MACHINE=$(canonical_name $(echo $TRIPLE | sed 's/-.*//')) diff --git a/srcpkgs/mold/template b/srcpkgs/mold/template new file mode 100644 index 000000000000..1098f159e5e2 --- /dev/null +++ b/srcpkgs/mold/template @@ -0,0 +1,27 @@ +# Template file for 'mold' +pkgname=mold +version=1.10.1 +revision=1 +build_style=cmake +configure_args="-DMOLD_USE_SYSTEM_MIMALLOC=ON + -Dmimalloc_DIR=${XBPS_CROSS_BASE}/cmake/mimalloc-2.0" +makedepends="mimalloc-devel openssl-devel zlib-devel libzstd-devel" +# It's probably not worth pulling in clang/llvm to run the few tests that +# depend on them. +checkdepends="tar zstd libdwarf gdb" +short_desc="Faster drop-in replacement for existing Unix linkers" +maintainer="Peter Wang " +license="AGPL-3.0-only" +homepage="https://github.com/rui314/mold" +distfiles="https://github.com/rui314/mold/archive/refs/tags/v${version}.tar.gz" +checksum=19e4aa16b249b7e6d2e0897aa1843a048a0780f5c76d8d7e643ab3a4be1e4787 + +if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + makedepends+=" libatomic-devel" + configure_args+=" -DCMAKE_CXX_STANDARD_LIBRARIES=-latomic" +fi + +post_install() { + vlicense LICENSE + rm -v ${DESTDIR}/usr/share/doc/mold/LICENSE +}