No description
Find a file
Ganesh Viswanathan f217acf5db Use actual lib path
2020-10-28 14:22:40 -05:00
tests Add Conan/JBB support 2020-06-18 11:46:32 -05:00
.gitignore Add CI 2019-10-06 22:41:36 -05:00
.travis.yml Use actual lib path 2020-10-28 14:22:40 -05:00
LICENSE Initial version 2019-10-05 12:33:12 -05:00
nimgit2.nim Use actual lib path 2020-10-28 14:22:40 -05:00
nimgit2.nimble Use actual lib path 2020-10-28 14:22:40 -05:00
README.md Add jbbFlags to download prebuilt JBB binaries 2020-07-11 17:31:40 -05:00

Nimgit2 is a Nim wrapper for the libgit2 library.

Nimgit2 is distributed as a Nimble package and depends on nimterop to generate the wrappers. The libgit2 source code is downloaded using Git so having git in the path is ironically required.

Installation

Nimgit2 can be installed via Nimble:

> nimble install nimgit2

This will download and install nimgit2 in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.

Usage

Module documentation can be found here

import nimgit2

doAssert git_libgit2_init() > 0, "Failed to init"

Compile with -d:git2Std if libgit2 is already installed by your package manager. Use -d:git2Git or -d:git2DL if building from source or -d:git2Conan or -d:git2JBB if a pre-compiled binary is preferred. Check Conan Center or Bintray for available pre-built versions. Note that Bintray only has shared builds of libgit2 and Conan's static builds on Windows do not work with gcc.

To link a static build of libgit2, set -d:git2Static. The -d:git2SetVer=xxx can be used to set a specific tag or version. These defines can also be set in code using setDefines(). See the nimterop docs for more details.

The libgit2 docs is a good reference guide on how to use the API.

Credits

Nimgit2 wraps the libgit2 source code and all licensing terms of libgit2 apply to the usage of this package.

Feedback

Nimgit2 is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated.