Skip to content

Commit b3bb41e

Browse files
committed
Document libgit2 build behavior in CONTRIBUTING.md
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 7651690 commit b3bb41e

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,37 @@ meeting](https://docs.google.com/document/d/1l_M0om0qUEN_NNiGgpqJ2tvsF2iioHkaARD
3030

3131
### Installing required dependencies
3232

33-
The dependency [libgit2](https://libgit2.org/) needs to be installed to be able to run
34-
Source Controller or its test-suite locally (not in a container).
33+
The dependency [libgit2](https://libgit2.org/) needs to be installed to be able
34+
to run source-controller or its test-suite locally (not in a container).
3535

36-
**macOS**
37-
```
38-
brew install libgit2
39-
```
36+
In case this dependency is not present on your system (at the expected
37+
version), the first invocation of a `make` target that requires the
38+
dependency will attempt to compile it locally to `hack/libgit2`. For this build
39+
to succeed; CMake, Docker, OpenSSL 1.1 and LibSSH2 must be present on the system.
4040

41-
**Arch Linux**
42-
```
43-
pacman -S libgit2
44-
```
41+
Triggering a manual build of the dependency is possible as well by running
42+
`make libgit2`. To enforce the build, for example if your system dependencies
43+
match but are not linked in a compatible way, append `LIBGIT2_FORCE=1` to the
44+
`make` command.
4545

46-
**Building from source**
46+
#### macOS
4747

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:
48+
```console
49+
$ # Ensure libgit2 dependencies are available
50+
$ brew install cmake [email protected] libssh2
51+
$ LIBGIT2_FORCE=1 make libgit2
52+
```
53+
54+
#### Linux
5155

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:
56+
```console
57+
$ # Ensure libgit2 dependencies are available
58+
$ pacman -S cmake openssl libssh2
59+
$ LIBGIT2_FORCE=1 make libgit2
60+
```
5861

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-
```
62+
**Note:** Example shown is for Arch Linux, but likewise procedure can be
63+
followed using any other package manager, e.g. `apt`.
6464

6565
### How to run the test suite
6666

0 commit comments

Comments
 (0)