The basic setup procedure for pygit2 is http://www.pygit2.org/install.html#building-on-nix-including-os-x Please see.
I want to build with a static link, not LD_LIBRARY_PATH or RPATH, so make a note of the steps.
If you don't have the same versions of libgit2 and pygit2, you won't be able to build, so please choose either the latest version of git or the latest release version. The following steps use git.
Build with BUILD_SHARED_LIBS turned off. Also turn on thread safety (default OFF).
Change $ HOME / local
to any place you like.
$ git clone --depth 1 git://github.com/libgit2/libgit2.git
$ mkdir libgit2/build
$ cd libgit2/build
$ cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local -DTHREADSAFE=1 -DBUILD_SHARED_LIBS=0
$ cmake --build . --target install
Use LIBGIT2
to specify the location where you installed libgit2.
If you do not do LDFLAGS = -lcurl
, you will get an error that the symbol cannot be found when you do ʻimport pygit2`.
LIBGIT2=$HOME/local LDFLAGS="-lcurl" pip install -U -e git+https://github.com/libgit2/pygit2.git#egg=pygit2
Recommended Posts