Alien-Libgit2
view release on metacpan or search on metacpan
1. First checks if a system libgit2 (>= 1.5) is available via `pkg-config libgit2`
2. If not, builds libgit2 from source (bundled tarball â no network required)
## Used By
- `Git::Libgit2` â low-level FFI::Platypus bindings against libgit2
- `Git::Native` â high-level Moo wrapper on top of `Git::Libgit2`
Other consumers should call `Alien::Libgit2->dynamic_libs` (for FFI) or
`->cflags`/`->libs` (for XS).
## Bundled Source
Ships `libgit2-1.9.3.tar.gz` in `share/`. No network access required
during `cpanm` install â suitable for air-gapped environments.
## Build Config
Uses `[@Author::GETTY]` Dist::Zilla bundle with `alien_build = 1`.
Build requirements (for the share-install path only):
- `cmake` (libgit2 uses CMake)
- C compiler
- `pkg-config` (for system lib detection)
- OpenSSL headers (HTTPS backend)
- libssh2 headers (SSH transport)
## alienfile
The `alienfile` at the root defines the probe/build/install steps. Uses
`Alien::Build::Plugin::Build::CMake`. Build flags pin REGEX_BACKEND=builtin
so we don't pick up an inconsistent regex lib at runtime.
## Key Details
- System install preferred â faster, picks up distro security patches
- Share install builds libgit2 in the local Alien dir, no system pollution
- Pinned to a single bundled libgit2 version per Alien::Libgit2 release
(ABI bumps between minor versions of libgit2)
lib/Alien/Libgit2.pm view on Meta::CPAN
=head1 VERSION
version 0.001
=head1 SYNOPSIS
use Alien::Libgit2;
# For XS consumers
my $cflags = Alien::Libgit2->cflags;
my $libs = Alien::Libgit2->libs;
# For FFI consumers (FFI::Platypus, Git::Libgit2)
my @libs = Alien::Libgit2->dynamic_libs;
=head1 DESCRIPTION
L<Alien::Libgit2> provides the C library L<libgit2|https://libgit2.org/>
for use by other CPAN modules that need to link against it.
( run in 1.056 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )