# -*- 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          bzip2-ffi 1.1.1 gem {} rubygems
categories-append   archivers
license             MIT
maintainers         nomaintainer
platforms           any
description         Ruby bindings for libbz2
long_description    Ruby library that reads and writes bzip2-compressed data \
                    as a stream using FFI bindings for libbz2.
homepage            https://github.com/philr/bzip2-ffi
checksums           rmd160  15dbc847d46e57371c3068896f533153c0f933b8 \
                    sha256  ebffb57a74756aeeb16f957166108a6fd90df8cbcd70efcea85bb6c828ea4acb \
                    size    218112
supported_archs     noarch

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

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