# -*- 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 github 1.0 PortGroup cmake 1.1 PortGroup legacysupport 1.0 PortGroup muniversal 1.0 name libgit2-devel conflicts libgit2 set my_name libgit2 # don't forget to update py-pygit2 and libgit2-glib as well github.setup libgit2 libgit2 1.8.0 v github.tarball_from archive revision 0 epoch 0 categories devel maintainers {mascguy @mascguy} openmaintainer license {GPL-2 Permissive} 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 https://libgit2.org/ dist_subdir ${my_name} checksums rmd160 872cd96e8d0ffa730a8016a2a0ea4c71595da39b \ sha256 9e1d6a880d59026b675456fbb1593c724c68d73c34c0d214d6eb848e9bbd8ae4 \ size 7590126 depends_build-append \ port:pkgconfig depends_lib-append \ port:curl \ port:libiconv \ port:libssh2 \ path:lib/libssl.dylib:openssl \ port:pcre2 \ port:zlib # Fix for error: parameter '...' not found in the function declaration # See: https://trac.macports.org/ticket/65585 patchfiles-append patch-tests-no-error.diff # https://github.com/libgit2/libgit2/pull/6792 patchfiles-append 0001-process.c-fix-environ-for-macOS.patch post-patch { # Upstream compiles with C standard set to 90, which isn't sufficient for # legacy-support. So patch all CMake files, and raise that to C 99. # See: https://trac.macports.org/ticket/68148 fs-traverse f ${worksrcpath} { set fname [file tail ${f}] if {[string match CMakeLists.txt ${fname}]} { ui_info "Patching c_standard for cmake file: ${f}" reinplace -q "s|PROPERTIES C_STANDARD 90|PROPERTIES C_STANDARD 99|g" ${f} } } } compiler.c_standard 1999 # Clear optflags; controlled by project, via cmake build type configure.optflags if {[variant_isset debug]} { cmake.build_type Debug } else { cmake.build_type RelWithDebInfo } configure.args-append \ -DREGEX_BACKEND:STRING=pcre2 \ -DUSE_ICONV:BOOL=ON \ -DUSE_SSH:BOOL=ON \ -DUSE_THREADS:BOOL=OFF variant threadsafe description {Build with threadsafe option} { configure.args-replace \ -DUSE_THREADS:BOOL=OFF \ -DUSE_THREADS:BOOL=ON } default_variants +threadsafe platform darwin 8 { # Fix unsetenv return value configure.cflags-append \ -D__DARWIN_UNIX03 # Copy Apple's copyfile.h for use on Mac OS X 10.4 and higher. # See APPLE_LICENSE.txt for license and copying information. post-patch { file copy ${filespath}/copyfile.h ${worksrcpath} } configure.cflags-append \ "-I${worksrcpath}" } # customize regex to avoid release candidates, alpha, beta, etc github.livecheck.regex (\\d+(?:\\.\\d+)*)