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

PortSystem          1.0
PortGroup           github          1.0
PortGroup           legacysupport   1.1
PortGroup           makefile        1.0

# clock_gettime
legacysupport.newest_darwin_requires_legacy 15

github.setup        davidesantangelo krep 3.0.0 v
github.tarball_from archive
revision            0

description         A High-Performance String Search Utility

long_description    \
    ${name} is a blazingly fast string search utility designed for \
    performance-critical applications. It implements multiple optimized \
    search algorithms and leverages modern hardware capabilities to deliver \
    maximum throughput.

checksums           rmd160  7f3cc6bdfc1f0e7eea06b2252626dff27ffaba78 \
                    sha256  78ed8e36051145d523c9a7be878f7af82bd26405ff28d1ebdcae07efe4c52fdf \
                    size    89770

categories          textproc
installs_libs       no
license             BSD
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

compiler.c_standard 2011
# krep.h:15:10: fatal error: 'stdatomic.h' file not found
compiler.blacklist-append \
                    {clang < 700}

patch {
    reinplace -E {s|CC =|CC ?=|g}           ${worksrcpath}/Makefile
    reinplace -E {s|CFLAGS =|CFLAGS ?=|g}   ${worksrcpath}/Makefile
    reinplace -E {s|LDFLAGS =|LDFLAGS ?=|g} ${worksrcpath}/Makefile
}

variant native description "Build for native performance" {
    build.args-append \
                    NATIVE=1
}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}
