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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           cmake 1.0

cmake.out_of_source yes

# don't forget to update libgit2-glib as well
github.setup        libgit2 libgit2 0.24.2 v
epoch               1
categories          devel
platforms           darwin
maintainers         juanrgar devans
license             GPL-2

description         A portable, pure C implementation of the Git core methods

long_description    libgit2 is a portable, pure C implementation of the \
                    Git core methods provided as a re-entrant linkable \
                    library with a solid API, allowing you to write native \
                    speed custom Git applications in any language which \
                    supports C bindings.

homepage            http://libgit2.github.com/

checksums           rmd160  8cf4b8c4ee25a891267317138ffcb5a0f03eec9a \
                    sha256  41c371a01e5f702cb0c1563e1a35eab37e126090a2ef212c23a6bb3d1097712b

depends_build-append \
                    port:pkgconfig

depends_lib         port:curl \
                    port:libiconv \
                    port:libssh2 \
                    path:lib/libssl.dylib:openssl \
                    port:zlib

patchfiles          patch-strnlen-posix.h.diff

configure.args-append \
                    -DTHREADSAFE:BOOL=OFF \
                    -DUSE_ICONV:BOOL=ON

variant threadsafe description {Build with threadsafe option} {
    configure.args-replace \
                    -DTHREADSAFE:BOOL=OFF -DTHREADSAFE:BOOL=ON
}

default_variants    +threadsafe

livecheck.regex     "archive/v(\\d+(?:\\.\\d+)*)${extract.suffix}"