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

# O_CLOEXEC, clock_gettime
legacysupport.newest_darwin_requires_legacy 15

# Forked from https://github.com/jiixyj/epoll-shim
github.setup        barracuda156 epoll-shim 15e052ef18f220831f8c294efa981d2c5a5116d9
version             0.0.20261019
revision            0
categories          devel wayland
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Small epoll implementation using kqueue
long_description    ${description}. Includes all features \
                    needed for libinput/libevdev.

checksums           rmd160  ffd0a9e91ec5f679d8346f3c25284687dd034692 \
                    sha256  07d1905507014e1f6a4e4cf770da7f4dafa136f42c00df63d77ce866ae9a6402 \
                    size    107709
github.tarball_from archive

compiler.c_standard 2011

# error: use of unknown builtin '__builtin_mul_overflow' on macOS < 10.11
# this feature was implemented after the release of LLVM 3.8
compiler.blacklist-append \
                    {clang < 800} {macports-clang-[3-9].[0-9]} {macports-clang-1[0-2]}

# Build tries to run test binaries during the build, which fails otherwise.
configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

configure.args-append \
                    -DCMAKE_INSTALL_PKGCONFIGDIR="${prefix}/lib/pkgconfig" \
                    -DCMAKE_CTEST_ARGUMENTS="--output-on-failure"

test.run            yes

github.livecheck.branch darwin
