# -*- 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           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

# getline
legacysupport.newest_darwin_requires_legacy 10
legacysupport.redirect_bins fzf

github.setup        barracuda156 fzfpp 9073f6a4b96a678388da813c6202744942eb28c7
version             0.4.0
revision            0
categories          sysutils
license             BSD
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Command-line fuzzy finder (C++ implementation)
long_description    fzf++ is a high-performance, API-compatible implementation \
                    of the popular fzf fuzzy finder, written in modern C++20. \
                    It provides fuzzy matching with Smith-Waterman algorithm, \
                    interactive TUI with real-time filtering, multi-select mode, \
                    preview window with command execution and support for UTF-8.
checksums           rmd160  1e008a01c3ba4942bc5a10ef887c6373f945a1b7 \
                    sha256  1437fe3e25f11b3e45824476cef8737a07475fd672fc4148b2caab19757f60d2 \
                    size    223510
github.tarball_from archive

installs_libs       no
conflicts           fzf

cmake.build_type    Release

depends_lib-append  port:utfcpp

configure.args-append \
                    -DUSE_SYSTEM_UTFCPP=ON

compiler.cxx_standard   2020

if {[string match *gcc* ${configure.compiler}] && ${configure.build_arch} in [list arm i386 ppc]} {
    configure.ldflags-append \
                    -latomic
}

if {${os.platform} eq "darwin" && ${os.major} > 16} {
    pre-fetch {
        ui_warn "${name} is a fallback for golang-based fzf. Original fzf is available for your system."
        ui_warn "Please consider installing fzf port instead."
    }
}
