Commit Graph

5 Commits

Author SHA1 Message Date
lhchavez f3c487966d Improve the static build script
This change:

* Uses the installed version of both the library and the pkgconfig file,
  which fixes path resolution on Ubuntu Xenial.
* Uses quoting liberally so that paths with spaces in them are correctly
  handled.
* Moves the build+install directories to static-build/ in the git2go
  repository to avoid having a dirty vendor/libgit2 checkout.
2019-01-05 20:28:35 +00:00
Ryan Graham b3256d9058
static: use pkg-config exclusively when using it
When using the static linking option on platforms that use pkg-config,
use ONLY pkg-config to get the CFLAGS and LDFLAGS. This prevents pulling
in dependencies and flags for any non-vendored version that may be
present on the host.

The main practical effect of this is that if someone doesn't need/want
any sort of remote access support at all they can completely disable
libcurl, libssh2, libssl, etc and produce a smaller/simpler binary and
greatly simplify their build-time dependencies. When done properly, the
generated pkg-config file will tell cgo everything it needs to know.

This also prevents confusion if there is a system copy of libgit2 that
is being given priority over the vendored build.

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
2018-08-23 10:45:27 -07:00
Carlos Martín Nieto b52e13f37d Switch over the version contraints to v0.27 2018-02-22 09:28:49 +01:00
Carlos Martín Nieto 1c1346d364 Update vendored libgit2 to latest 2017-09-03 16:50:12 +02:00
Carlos Martín Nieto 5001942b59 Allow building statically via the "static" build tag 2017-04-14 12:36:42 +02:00