Set up pygit2 with static link

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 libgit2

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

Install pygit2

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

Set up pygit2 with static link
Set up social login with Django
Set up a Samba server with Docker
Commit with pygit2
Set up a simple HTTPS server with asyncio
Set up a local server with Go-File upload-
Set up golang with goenv on GNU / Linux
Set up a local server with Go-File download-
Set up Docker on Oracle Linux (7.x) with Vagrant
Set up Jetson nano
Set up a Python development environment with Sublime Text 2
[Vagrant] Set up a simple API server with python
Set up a Python development environment with Visual Studio Code
Set up a web server with CentOS7 + Anaconda + Django + Apache
Reload the server set up with gunicorn when changing the code
Set connection timeout with boto3
Set Up for Mac (Python)
Set up Polyglot on Windows
Set up Nunjucks in Node.js
Set environment variables with lambda-uploader