# -*- 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 1.3.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  01d5cc5043236fc94ada7bd318b7fcafc048d775 \
                    sha256  76b0a9224b1e31aff49637c103b68e0d45d6b46456069e67e57b876a5c1ade59 \
                    size    68200

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

build.args-append   ENABLE_ARCH_DETECTION=0

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
    # Remove below at next upgrade
    reinplace -E {s|#define VERSION "1.2"|#define VERSION "1.3"|g} ${worksrcpath}/krep.c
}

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