-
-
Save ifduyue/9fe14736d6d2f944692a 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
#!/bin/bash | |
# this will install everything as root, so take that into account before you run it | |
set -eu | |
# need cmake, python development headers, ZLib and OpenSSL | |
sudo apt-get install -y cmake python2.7-dev zlib1g-dev libssl-dev | |
root=`pwd` | |
git clone -b master --depth 1 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 | |
# avoid "cannot open shared object file" ImportErrors | |
sudo ldconfig | |
ldconfig -p | grep libgit | |
sudo pip install pygit2 -U | |
# clean up after ourselves | |
cd $root | |
rm -rf libgit2 | |
# now, from the python interpreter: | |
# >>> from pygit2 import Repository | |
# if you don't get any errors, you're done! | |
python -c 'from pygit2 import Repository' && echo 'pygit2 installed.' || echo 'failed to install pytgit2' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment