# -*- 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           legacysupport 1.0

# requires legacysupport
# src/main.c:81:30: error: '_SC_NPROCESSORS_ONLN' undeclared (first use in this function)

name                the_silver_searcher
version             2.2.0
categories          textproc
maintainers         nomaintainer
platforms           darwin
license             Apache-2
description         A code-searching tool similar to ack, but faster.
long_description    An attempt to make something better than ack, which \
                    itself is better than grep.

homepage            https://geoff.greer.fm/ag
master_sites        ${homepage}/releases

checksums           rmd160  a7826755e4cc6f6af2878cba08dd39010f40c471 \
                    sha256  d9621a878542f3733b5c6e71c849b9d1a830ed77cb1a1f6c2ea441d4b0643170 \
                    size    190585

depends_build       port:pkgconfig
depends_lib         port:pcre \
                    port:xz

build.args-append   V=1

compiler.thread_local_storage yes

post-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/share/bash-completion/completions
    move \
        ${destroot}${prefix}/share/${name}/completions/ag.bashcomp.sh \
        ${destroot}${prefix}/share/bash-completion/completions/ag
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
