Compile and install git-crypt on OS X
Read time: 1 min
Git-crypt is a nice piece of software, it’s great to keep sensible data secure in a repository.
Unfortunately the official installation guide only supports Linux and Homebrew users. So what if you’re a happy Macports user like me?
Install the requirements
First step, you need to have Xcode and macports installed. Run
gcc --version and
g++ version to be sure you can compile the software.
git (it is very likely you have them already installed). Actually
git is not needed at compile time but at runtime.
$ sudo port install openssl git
Let’s get the source
$ git clone firstname.lastname@example.org:AGWA/git-crypt.git $ cd git-crypt
If we compiled it now,
make would fail and you would get
fatal error: 'openssl/aes.h' file not found.
What’s up? It turns macports libs are not seen by GCC and G++ by default.
To fix it, we have to edit
$ nano ~/.bash_profile
and add the lines below:
export C_INCLUDE_PATH=/opt/local/include/ export CPLUS_INCLUDE_PATH=/opt/local/include/
What have we done? We’ve just told GCC and G++ to look for headers also in Macports path.
.bash_profile to apply the edits…
$ source ~/.bash_profile
…and check the variables to be set.
$ env | grep C_INCLUDE_PATH $ env | grep CPLUS_INCLUDE_PATH
Now let’s try again to compile
It should be run smoothly.
So it’s time to install git-crypt. For best practice, it’s better to install it in
/usr/local. To do so run:
$ sudo make install PREFIX=/usr/local
Thanks for reading.
Got some words you want to share? Tell me!