Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ This is [libgit2](https://libgit2.org/) packaged using Zig's build system.
While libgit2 supports many different options for system dependencies, I've opted to use [MbedTLS](https://www.trustedfirmware.org/projects/mbed-tls/) by default on Linux for TLS, crypto, and certificate support. You can replace MbedTLS with OpenSSL if you prefer. SSH support is optional, and is provided by [libssh2](https://libssh2.org/).
All other dependencies are bundled in the source tree and compiled statically.

## Versioning
See `build.zig.zon` for the current Zig version, see releases for support for previous Zig/libgit2 versions.

The versions specified in `build.zig.zon` are split between the package version (before the plus)
and the libgit2 version (after the plus). For example, version `1.0.0+1.9.0` is package version 1.0.0
with support for libgit2 1.9.0.

## Usage
Update your `build.zig.zon`:
```sh
zig fetch --save git+https://github.com/allyourcodebase/libgit2
# or if you want a tagged release
zig fetch --save https://github.com/allyourcodebase/libgit2/archive/refs/tags/${tag}.tar.gz
zig fetch --save git+https://github.com/allyourcodebase/libgit2#${tag}
```

Then, in your `build.zig`, you can access the library as a dependency:
Expand Down
3 changes: 2 additions & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
.{
.name = .libgit2,
.version = "1.9.0",
.version = "1.0.0+1.9.0",
.minimum_zig_version = "0.16.0",
.fingerprint = 0x7f0051374dea2cba,
.dependencies = .{
.libgit2 = .{
.version = "1.9.0",
.url = "https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.0.tar.gz",
.hash = "N-V-__8AAJbmLwHHxHDWkz0i6WIR6FpNe6tXSLzaPuWtvBBg",
},
Expand Down
5 changes: 0 additions & 5 deletions build/include.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef INCLUDE_git_include_h__
#define INCLUDE_git_include_h__

#include "git2.h"
#include "git2/sys/alloc.h"
#include "git2/sys/commit_graph.h"
Expand All @@ -24,5 +21,3 @@
#include "git2/sys/refs.h"
#include "git2/sys/remote.h"
#include "git2/sys/repository.h"

#endif // INCLUDE_git_include_h__INCLUDED
Loading