Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 1 | # Copyright (C) 2021 Mingli Yu <mingli.yu@windriver.com> |
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) |
| 3 | |
| 4 | SUMMARY = "General-purpose scalable concurrent malloc implementation" |
| 5 | |
| 6 | DESCRIPTION = "jemalloc is a general purpose malloc(3) implementation that emphasizes \ |
| 7 | fragmentation avoidance and scalable concurrency support." |
| 8 | |
| 9 | HOMEPAGE = "https://github.com/jemalloc/jemalloc" |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 10 | LICENSE = "BSD-2-Clause" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 11 | |
| 12 | SECTION = "libs" |
| 13 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea061f8731d5e6a5761dfad951ef5f5f" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 15 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 16 | SRC_URI = "git://github.com/jemalloc/jemalloc.git;branch=master;protocol=https \ |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 17 | file://run-ptest \ |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 18 | " |
Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame] | 19 | SRCREV = "54eaed1d8b56b1aa528be3bdd1877e59c56fa90c" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 23 | inherit autotools ptest |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 24 | |
| 25 | EXTRA_AUTORECONF += "--exclude=autoheader" |
| 26 | |
| 27 | EXTRA_OECONF:append:libc-musl = " --with-jemalloc-prefix=je_" |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 28 | # For some reason VERSION file populated only in tarball distribution. |
| 29 | # Adding jemalloc version since this recipe is using source code from git tag |
| 30 | EXTRA_OECONF:append = " --with-version=${PV}-0-g${SRCREV}" |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 31 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 32 | do_install:append() { |
| 33 | sed -i -e 's@${STAGING_DIR_HOST}@@g' \ |
| 34 | -e 's@${STAGING_DIR_NATIVE}@@g' \ |
| 35 | -e 's@${WORKDIR}@@g' ${D}${bindir}/jemalloc-config |
| 36 | } |
| 37 | |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 38 | do_compile_ptest() { |
| 39 | oe_runmake tests |
| 40 | } |
| 41 | |
| 42 | do_install_ptest() { |
| 43 | install -d ${D}${PTEST_PATH}/tests |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 44 | subdirs="unit integration stress " |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 45 | for tooltest in ${subdirs} |
| 46 | do |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 47 | cp -r ${B}/test/${tooltest} ${D}${PTEST_PATH}/tests |
| 48 | if find ${S}/test/${tooltest}/ -name '*.sh' -print -quit | grep -q .; then |
| 49 | cp ${S}/test/${tooltest}/*.sh ${D}${PTEST_PATH}/tests/${tooltest} |
| 50 | fi |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 51 | done |
| 52 | find ${D}${PTEST_PATH}/tests \( -name "*.d" -o -name "*.o" \) -exec rm -f {} \; |
| 53 | } |