Skip to content

Commit 88c76c5

Browse files
committed
Document how to build libgit2 from source
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 2dd7772 commit 88c76c5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,25 @@ brew install libgit2
4343
pacman -S libgit2
4444
```
4545

46+
**Building from source**
47+
48+
1. Ensure [`cmake`](https://cmake.org) is available on your system.
49+
1. Download and unarchive [the right `libgit2` version](https://github.com/libgit2/git2go#which-go-version-to-use)
50+
for our current `git2go` dependency:
51+
52+
```console
53+
$ LIBGIT2_VER=1.1.0
54+
$ curl -L https://github.com/libgit2/libgit2/releases/download/v$LIBGIT2_VER/libgit2-$LIBGIT2_VER.tar.gz -o /tmp/libgit2.tar.gz
55+
$ tar -xvf /tmp/libgit2.tar.gz -C /tmp/libgit2-$LIBGIT2_VER
56+
```
57+
1. Build and install the library on your system:
58+
59+
```console
60+
$ mkdir /tmp/libgit2-$LIBGIT2_VER/build && cd /tmp/libgit2-$LIBGIT2_VER/build
61+
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
62+
$ sudo cmake --build . --target install
63+
```
64+
4665
### How to run the test suite
4766

4867
You can run the unit tests by simply doing

0 commit comments

Comments
 (0)