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

perl5.branches      5.28 5.30 5.32 5.34
perl5.setup         Git-Raw 0.90
revision            0
license             {Artistic-1 GPL}
maintainers         {devans @dbevans} openmaintainer
description         Git::Raw - Perl bindings to the Git linkable library (libgit2)
long_description    {*}${description}

platforms           darwin

checksums           rmd160  5fb938b16bdbf73dc7e370d6c25e00626156c9df \
                    sha256  2d4e08b2912d5e497caf09e64d79123fedb13de63bb8de3800c0dc184b30424e \
                    size    1946442

if {${perl5.major} != ""} {
    depends_build-append \
                    port:p${perl5.major}-capture-tiny \
                    port:p${perl5.major}-devel-checklib \
                    port:p${perl5.major}-file-slurp-tiny \
                    port:p${perl5.major}-getopt-long \
                    port:p${perl5.major}-test-deep \
                    port:p${perl5.major}-test-pod \
                    port:p${perl5.major}-test-pod-coverage
 
# dependency on libgit2 not required
# uses embedded copy of libgit2 source (currently version 1.5.0 commit fbea439d4 20220713)

    depends_lib-append \
                    path:lib/libssl.dylib:openssl \
                    port:libssh2 \
                    port:p${perl5.major}-xsloader

    post-patch {
        # fixup install prefix if building in a non-standard location
        # does nothing in the case of the default (/opt/local)
        if {${prefix} ne "/opt/local"} {
            reinplace "s|/opt/local|${prefix}|" ${worksrcpath}/inc/MakeMaker.pm
        }
    }
}
