Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: unify_build_sy…
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (45 sloc) 2.41 kB

Parrot Virtual Machine bindings to libgit2

This is library for Parrot Virtual Machine to provide libgit2 bindings to all languages running on Parrot Virtual Machine.

Build Status


You need Parrot VM 3.5.0 or higher configured with libffi to compile parrot-libgit2 . 4.6.0 or higher is recommended.

To see if your Parrot has libffi

parrot_config HAS_LIBFFI

You should see a true value. If you see a 0 or empty string, your Parrot is not configured with libffi.

The language Winxed is included in Parrot >= 3.5.0, and the build system of parrot-libgit2 uses it. To build parrot-libgit2:

winxed setup.winxed build

Running Tests

parrot-libgit2 uses Rosella to run and implement a test suite.

To run the parrot-libgit2 test suite:

winxed setup.winxed test


winxed setup.winxed install

If you installed Parrot into a system-wide directory that only root can write to, you will need sudo:

sudo winxed setup.winxed install

Cleaning up

winxed setup.winxed clean


We read in libgit2 header files and generate an NCI binding file. This file is read in by $PARROT/tools/dev/ and a PIR file is generated which allows Parrot to call libgit2 C functions from PIR.

This only understands function signature API changes, not datastructure API changes. Those are still manually decribed to the StructView PMC in src/Git2/Common.winxed .

This makes it trivial to release a new version of parrot-libgit2 when the libgit2 API changes, which it will for the forseable future. Currently, the 0.15.0 release of libgit2 is supported.

Generating NCI definitions

There is a script called in bin/ that generates the NCI definition file from a libgit2 header file. Example:

perl ./bin/ /usr/local/include/git2/repository.h

This script has some bugs and does not parse all of libgit2 correctly yet. TODO: Make able to parse all libgit2 headers.

There is a Makefile target to generate our NCI definitions from libgit2

make nci

TODO: add this as a custom step to setup.winxed


Beer, pull requests and patches welcome! Fork and be merry.

Jump to Line
Something went wrong with that request. Please try again.