Git receives a lot of flack for having a poorly created UI on top of a technological monster. Underneath the hood, it may be a best of an engine, but the user gets to use a 5-in-1 for its keys. Gitless is a convenient hood, but there’s only one catch: all the binaries you can download are 64-bit which means… compiling from source for those of us running 32-bit Linux operating systems.
Turns out, compiling from source is really easy, but there are couple of things that aren’t in the instructions. For this, you are going to need a few things:
- Gitless sourcecode, which you can get from the main site.
… All in the reverse order. They don’t need to go in each others folders, thankfully. The instructions for PyGit are on the docs website… but they aren’t complete, so here’s everything:
Install libgit2 to /usr/local/lib
$ wget https://github.com/libgit2/libgit2/archive/v0.25.0.tar.gz
$ tar xzf v0.25.0.tar.gz
$ cd libgit2-0.25.0/
$ cmake .
$ sudo make install
For ubuntu, you need to install Pip, Python-dev, and Python CFFI:
$ sudo apt-get install pip
$ sudo apt-get install python-dev
$ sudo apt-get install python-cffi
python-dev is for Python 2.7. For Python 3 dev, you need:
$ sudo apt-get install python3-dev
Pick one. It shouldn’t matter… I hope. I chose 2.7 and it worked for me.
Get the system to recognize the changes:
$ sudo ldconfig
$ sudo pip install pygit2
Link to Python
$ python -c ‘import pygit2’
Python-CFFI is needed, otherwise you end up with an error something like: cffi.ffiplatform.VerificationError: importing ‘/tmp/pip_build_name/pygit2/__pycache__/_cffi__xba35826bxd5434877.i386-linux-gnu.so’: libgit2.so.25: cannot open shared object file: No such file or directory
The Python dev package is needed otherwise you get the warning: “fatal error: Python.h: No such file or directory”.
The ldconfig call is required so that the system recognizes the changes and you don’t get something like “libgit2.so.22: cannot open shared object file: No such file or directory“.
Some of the instructions I read didn’t use “sudo” or indicate that they were root. Using “sudo” or working via root is required, however, otherwise you get an error that the installation process can’t access or write to the system directory.