Commit Graph

33 Commits

Author SHA1 Message Date
lhchavez e434188460
Add support for managed SSH transport #minor (#814) (#817)
This change drops the (hard) dependency on libssh2 and instead uses Go's
implementation of SSH when libgit2 is not built with it.
2021-09-05 18:27:52 -07:00
lhchavez 29eaaff9fd
Add support for managed HTTP/S transports (#810) (#813)
This change uses the newly-exposed Transport interface to use Go's
implementation of http.Client instead of httpclient via libgit2.

(cherry picked from commit b983e1daeb)
2021-09-05 17:01:02 -07:00
lhchavez 5e09ac76e8 Add `NewCredentialSSHKeyFromSigner` (#706)
This change adds `NewCredentialSSHKeyFromSigner`, which allows idiomatic
use of SSH keys from Go. This also lets us spin off an SSH server in the
tests.

(cherry picked from commit abf02bc7d7)
2020-12-06 13:10:00 -08:00
lhchavez 57d9083efe Build improvements (#707)
This change makes the test be verbose and use parallelization if
possible (when using gmake to build).

(cherry picked from commit 54afccfa0f)
2020-12-06 13:10:00 -08:00
lhchavez 5f0640baed
Mark some symbols to be deprecated #minor (#698) (#702)
This change introduces the file deprecated.go, which contains any
constants, functions, and types that are slated to be deprecated in the
next major release.

These symbols are deprecated because they refer to old spellings in
pre-1.0 libgit2. This also makes the build be done with the
`-DDEPRECATE_HARD` flag to avoid regressions.

This, together with
[gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should
make releases safer going forward.

1: More information about how that works at
   https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
(cherry picked from commit 137c05e802)
2020-12-05 13:12:04 -08:00
github-actions[bot] 27f87bd821
feat: Enable change the system install path (#653) (#654)
#### Problem:
The current `CMAKE_INSTALL_PREFIX` value for the `system` build mode is `/usr`. However, in`macOS` as an example, you cannot write to `/usr` without `sudo` permission.

#### Proposed solution:
Enable changing the value to `/usr/local` (or any other path). This change makes the script use the value of the environment variable `SYSTEM_INSTALL_PREFIX` to select the installation path.  If the variable is not set, it fallback to the path `/usr`.

(cherry picked from commit 111185838c)

Co-authored-by: Suhaib Mujahid <suhaibmujahid@gmail.com>
2020-09-30 17:31:20 -07:00
github-actions[bot] 6cb9c7cf41
Enable set the VENDORED_PATH for libgit2 (#650) (#652)
### What this change is doing?
This change aims to enable us to set the `VENDORED_PATH` as an environment variable and failback to the default value if the environment variable is not set. Thus, this change should not break current behavior.

### Why we need this?
This will enable using the script to build libgit2 form source code downloaded manually.

Example:
```sh
LIBGIT2_VER="1.0.1"
DOWNLOAD_URL="https://codeload.github.com/libgit2/libgit2/tar.gz/v${LIBGIT2_VER}""
LIBGIT2_PATH="${HOME}/libgit2-${LIBGIT2_VER}"
wget -O "${LIBGIT2_PATH}.tar.gz" "$DOWNLOAD_URL"
tar -xzvf "${LIBGIT2_PATH}.tar.gz"

VENDORED_PATH=$LIBGIT2_PATH sh ./script/build-libgit2.sh --static
```

(cherry picked from commit f3a746d7b6)

Co-authored-by: Suhaib Mujahid <suhaibmujahid@gmail.com>
2020-09-30 17:16:28 -07:00
lhchavez 6453cf9f8a Refresh the GitHub Actions CI (#632)
This change:

* Builds the library with Go 1.14, too.
* Builds the non-legacy tests with Ubuntu Focal (20.04).
* Adds testing for system-wide libraries, both static and dynamic
  versions.
* Fixes a typo in the README.

(cherry picked from commit 5314951759)
2020-08-16 07:19:09 -07:00
lhchavez b6aa16143b Update CI configuration
This change:

* Updates the GitHub actions so that they run different commands for the
  dynamic and static flavors of libgit2.
* Updates the .travis.yml file so that it does roughly the same as the
  GitHub actions.
* Adds the release-* branches to the CI configurations.

(cherry picked from commit 26edffd5f5)
2020-08-16 07:19:09 -07:00
lhchavez 61fdd76c76 Merge pull request #503 from jonEbird/static-build-script-cleanup
script/build-libgit2-static.sh: correctly set ROOT

(cherry picked from commit aa802a90db)
2020-08-16 07:19:09 -07:00
Carlos Martín Nieto a13d27e9c0 Merge pull request #475 from lhchavez/self-contained-build
Improve the static build script

(cherry picked from commit b30b050c9c)
2020-08-16 07:19:09 -07:00
Carlos Martín Nieto a07879739f Merge pull request #445 from rmg/exclusive-pkg-config
static: use pkg-config exclusively when using it
(cherry picked from commit bcf325244c)
2020-08-16 07:19:09 -07:00
Carlos Martín Nieto 9c5fb973fc Get rid of the with-static.sh script
CGO can perform variable substitution in the directives, so we don't
need to use a script to set up the variables; we can let the go tool do
it for us.
2016-11-01 00:17:51 +01:00
Carlos Martín Nieto d3bd8903f8 Update libgit2 version to install on Travis to 24 2016-03-07 11:33:44 +01:00
Carlos Martín Nieto 1ea9965824 Install v23 on Travis 2015-08-31 16:07:37 +02:00
Carlos Martín Nieto 2d6b1ebd4c travis: make the script executable 2015-06-28 13:19:03 +02:00
Carlos Martín Nieto 5f3a9d76b8 travis: don't install libgit2 for 'next' branch
We have our own libgit2 in a submodule, so this is unnecessary. While in
the area, update which version of libgit2 would be downloaded and remove
unnecessary CMake flags.
2015-06-28 13:17:14 +02:00
Dmitri Shuralyov acc05926f7 Avoid installing script binary to user's $GOPATH/bin. 2015-04-16 18:45:53 -07:00
Carlos Martín Nieto ef83908059 Revert "Make the cgo tool do more linking work" 2014-12-31 19:43:20 +00:00
Carlos Martín Nieto 8f6e13bd08 Make the cgo tool do more linking work
The cgo directives let us do a lot more than I previously thought, so we
can use this to make the building process of git2go go through the go
tool directly rather than via the script.

libgit2 still needs to be built manually, so we do still require make,
but only for building libgit2. Once that's built, any modifications to
git2go's own code can be built with

    go build
2014-12-27 10:59:19 +00:00
Quinn Slack 57095bafe7 only check Go source files for non-thread-locked MakeGitError calls 2014-12-08 11:54:04 -08:00
Quinn Slack 3087e610fb add script for checking thread locks in funcs that call MakeGitError 2014-12-08 11:52:35 -08:00
Carlos Martín Nieto 84597241e0 Exit when pkg-config isn't found
We run pkg-config in a subshell, so our 'set -e' does not take effect
there. Explicitly error out if there was an error running pkg-config.
2014-08-26 23:32:27 +02:00
Matthias Kadenbach c1ed1bc545 Make sure install/lib dir exists. Fixes #104 2014-08-06 04:07:15 +02:00
Carlos Martín Nieto a2b14b5be4 Tighten up the build
Build as release, and there is no need to install the library, we know
where the files are.
2014-06-07 19:12:33 +02:00
Carlos Martín Nieto 12a3a1e05c Move the settings into the main git2go 2014-06-07 18:57:46 +02:00
Carlos Martín Nieto aabeb7f585 Really build statically 2014-06-07 15:43:05 +02:00
Carlos Martín Nieto 6862c2c82d hack for travis 2014-06-07 14:07:15 +02:00
Carlos Martín Nieto c734fc2a6b Use a submodule for libgit2
This makes building the static version easier as we know where the repo
is and that it's has a known-good version.
2014-06-07 03:03:04 +02:00
Carlos Martín Nieto 0646294282 Move some logic into the Makefile
This should provide a nice compromise between the scripts and comon
commands.
2014-06-03 18:35:09 +02:00
Carlos Martín Nieto de4f42f476 Add scripts to build and use a static libgit2 2014-06-03 12:03:00 +02:00
Carlos Martín Nieto b2a2a279d9 Add a settings package
This lets us modify the libgit2-wide options/settings.
2014-03-25 09:27:05 +01:00
Carlos Martín Nieto f5f8e13744 Add a travis script
Add a build script and ask Travis to run it. It downloads the tip of
libgit2's dev branch and tests against that.
2014-02-28 15:15:32 +01:00