-
-
Save momirjalili/6262471 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this will install everything as root, so take that into account before you run it | |
# need cmake, python development headers, ZLib and OpenSSL | |
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev | |
mkdir libgit && cd libgit | |
git clone git://github.com/libgit2/libgit2.git | |
cd libgit2 | |
# instructions from http://libgit2.github.com/#install | |
mkdir build && cd build | |
cmake .. | |
cmake --build . | |
sudo cmake --build . --target install | |
cd ../../ | |
# instructions from https://github.com/libgit2/pygit2/blob/master/README.rst | |
git clone git://github.com/libgit2/pygit2.git | |
cd pygit2 | |
sudo python setup.py install | |
# avoid "cannot open shared object file" ImportErrors; make sure the libraries are accessible in LD_LIBRARY_PATH | |
# if you want a more permanent solution, try echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH` >> ~/.bashrc | |
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH | |
sudo ldconfig | |
ldconfig -p | grep libgit | |
# clean up after ourselves | |
cd ../../ | |
rm -rf libgit/ | |
# now, from the python interpreter: | |
# >>> from pygit2 import Repository | |
# if you don't get any errors, you're done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It'd be better to use
master
branch:git clone -b master --depth 1 git://github.com/libgit2/libgit2.git
By default it's
development
branch