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

ruby.branches       3.3 3.2 3.1
ruby.setup          rb_sdl2 0.2.0 gem {} rubygems
categories-append   devel
license             zlib
maintainers         nomaintainer
platforms           any
description         Extension library to use SDL (Simple DirectMedia Layer)
long_description    RbSDL2 treats the functions and pointers \
                    provided by SDL2 as Ruby objects.
homepage            https://github.com/shinokaro/rb_sdl2/blob/main/README.md
checksums           rmd160  ba5198aeafdf6e8cef2ef04c89e2b789a1dfa7b5 \
                    sha256  9604b04e38494d8bd5977f6221c66680b048e9acccf7ef89efdeb53e2acdb3e9 \
                    size    44544
supported_archs     noarch

if {${name} ne ${subport}} {
    depends_run-append \
                    port:rb${ruby.suffix}-ffi \
                    port:rb${ruby.suffix}-sdl2-bindings

    post-destroot {
        system -W ${destroot}${ruby.gemdir}/specifications \
            "/usr/bin/patch -p0 < ${filespath}/patch-gemspec-${ruby.branch}.diff"
    }
}
