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

name                rb-fsevent-legacy
ruby.branches       3.4 3.3 3.2 3.1 3.0 2.7
revision            0
ruby.setup          rb-fsevent-legacy 0.2.0 gem {} rubygems
categories-append   devel
license             MIT
maintainers         nomaintainer
description         Legacy version of an FSEvents API for Darwin
long_description    {*}${description} – it works on PowerPCs and 10.5.8.
homepage            https://rubygems.org/gems/rb-fsevent-legacy
checksums           rmd160  bf8a908eb97ef7ee7ceb2d83fce1f5ff741e9bda \
                    sha256  41c6c423124ee99886a6c6fc0564a4106e0f1da765eff754ddbfbd5569591c4a \
                    size    11776

# Clang gets unhappy: error: '__declspec' attributes are not enabled;
# use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
# We can use -fms-extensions unconditionally, it works with GCC too.
# gcc14 also adds this error:
# fs_native_stream.c:285:14: error: passing argument 1 of 'Check_Type' makes integer from pointer without a cast [-Wint-conversion]
if {${name} ne ${subport}} {
    platforms       {darwin < 11}

    depends_extract port:rb${ruby.suffix}-gem-patch

    post-patch {
        copy ${filespath}/patch-fix-flags.diff ${worksrcpath}
        system -W ${worksrcpath} "${ruby.gem} patch ${ruby.filename}.gem patch-fix-flags.diff -o ${ruby.filename}.gem -p0"
    }
}
