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

# _SC_PHYS_PAGES, scandir
legacysupport.newest_darwin_requires_legacy 13

github.setup            ofiwg libfabric 2.6.0 v
revision                0

categories              devel parallel science
license                 BSD GPL-2
maintainers             {@barracuda156 macos-powerpc.org:barracuda} openmaintainer

description             Open Fabrics Interfaces (OFI)
long_description        ${name}, or {*}${description}, is a framework focused on exporting \
                        high-performance networking services to applications.

checksums               rmd160  ffc6fca2a78c21e1abd597c87a266e6193e54aae \
                        sha256  16b3652f5f3ac59264443c768e79be5170efed82579d59db31be9a30649a0e5a \
                        size    5167412
github.tarball_from     archive

# https://github.com/ofiwg/libfabric/pull/11541
patchfiles              patch-macos.diff

compiler.c_standard     2011

use_autoreconf          yes
autoreconf.cmd          ./autogen.sh
autoreconf.args

depends_build-append    port:autoconf \
                        port:automake \
                        port:libtool

platform darwin {
    # macOS does not have epoll, but there are ports installing it.
    configure.args-append \
                        --disable-epoll

    if {${os.major} < 13} {
        configure.cflags-append \
                        -D_MACPORTS_LEGACY_COMPATIBLE_SCANDIR=1
    }
}
