# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           muniversal 1.1

github.setup        jemalloc jemalloc 5.3.0
revision            4
license             BSD
categories          devel
maintainers         nomaintainer

description         a general-purpose scalable concurrent malloc(3) implementation
long_description    ${name} is {*}${description}

homepage            https://jemalloc.net

use_bzip2           yes

checksums           rmd160  ff8f2958d88705927b7566d219763dda2eb7edda \
                    sha256  2db82d1e7119df3e71b7640219b6dfe84789bc0537983c3b7ac4f7189aecfeaa \
                    size    736023

github.tarball_from releases

compiler.cxx_standard 2014

patchfiles          patch-quantum.diff \
                    patch-Makefile.diff

# building as x86_64 on an arm64 Mac gives an error if rosetta is installed
# https://trac.macports.org/ticket/65671
patchfiles-append   patch-universal.diff

configure.args-append --with-jemalloc-prefix=

# provide a compatibility symlink with the older name
post-destroot {
    ln -s jeprof ${destroot}${prefix}/bin/${name}-prof
}

test.run            yes
test.target         check
