Build cryptocoin wallet/client on Linux

The following script can be used to automatically build most cryptocoin wallets/clients on Linux. You may also want to check out my post on compiling the memecoin client.
Git repositories should be defined in a file named ‘gits’ and it should be placed in the same folder as the script. Each line can contain only 1 repository and commented out repositories have their source folder deleted (so be aware of this !).

Sources are checked out in a subfolder ‘autobuild’ and all executables are compiled in the source folder:


Clients will be build without UPNP, IPv6 or QR-Code support. If you plan on moving your wallets between different devices than it is strongly encourage to verify that the installed Berkley DB (libdb) has version 4.8 . If you run a recent version of Ubuntu then you certainly won’t have version 4.8 in your repositories.

You need at least 786MB of RAM; insufficient resources will result in gcc being killed.

The script:

# P_W999 - 2013 - This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
# This script comes as-is, with no guarantees or waranties and it is used at own risk.
# v0.1 - 2013-10-05
# * Initial release
# v0.2 - 2013-11-02
# * Removed auto-installation of dependencies because they usually have different names on different distributions
# * Added warning about Berkley 4.8 <-> 5.x
# v0.3 - 2013-11-02
# * Fix for AnonCoin client (i2psam dependency)
# v0.4 - 2013-11-02
# * Added dependencies for openSuse
DEPENDENCIES=(build-essential libssl-dev libdb-dev libdb++-dev libboost-all-dev libqrencode-dev qt4-qmake libqtgui4 libqt4-dev libprotobuf-dev libprotoc-dev protobuf-compiler git autoconf automake)
DEPENDENCIES_OPENSUSE=(gcc-c++ make glibc-devel libopenssl-devel libdb-4_8-devel boost-devel qrencode-devel devel_qt4 libqt4-x11 libqt4-devel protobuf-devel protobuf-c libprotoc7 git autoconf automake)
echo "You need the following dependencies to compile the cryptocoin clients: "
echo "(X/K)Ubuntu/Devian: ${DEPENDENCIES[*]}"
echo "openSuse: ${DEPENDENCIES_OPENSUSE[*]}"
echo "WARNING: Please add following PPA to ensure you have libdb-4.8:"
echo "         Using newer versions of libdb can break binary compatibility"
#Set default line separator
#Create directory where source code will be checked out and executable will be compiled
if [ ! -d "autobuild" ]
    mkdir autobuild
cd autobuild
#Read every line in the input file
for line in `cat ../gits` ; do
    #Get the /xxx.git part of the URL
    gitAdres=`expr "$line" : '.*\(/[a-zA-Z0-9]*\.git\)'`
        #Drop the '/' and the '.git' part
        #If line commented out, delete the source folder (TODO: make this an option ? )
    if [[ $line =~ ^#.* ]]
                echo Checkout: skipping and deleting $gitPath
        if [ -d "$gitPath" ]
            rm $gitPath --recursive -f
        #Output folder already exists: make a pull request to update source code
        if [ -d "$gitPath" ]
            echo Checkout: pulling $gitPath
            cd "$gitPath"
            git pull &>>pull.out
            cd ..
        #Output folder does not exist: make a clone request to get source code
            echo Checkout: cloning $gitPath
            git clone $line &>>clone.out
#All source code is checked out in different folder
#Go into each folder and build the source code
for dir in `find . -maxdepth 1 -type d | grep [^\.]` ; do
    cd $dir
    echo Pre-build: in `pwd`
    #Some clients come with a build_detect_platform script. After check out, this file is not executable.
    if [ -f src/leveldb/build_detect_platform ]
        echo Pre-build: chmod +x on build_detect_platform
        chmod +x src/leveldb/build_detect_platform
    if [ -f i2psam/makefile.unix ]
        echo First making i2psam
        cd i2psam
        make -f makefile.unix &>> i2psam.out
        cd ..
    #Delete old build log (XXX: not realy needed)
    if [ -f "build.out" ]
        rm build.out
    #Some libraries have hardcoded lib-boost suffixes. Remove these from the file since not needed on (X)Ubuntu (TODO: not sure about others)
    echo Pre-build: Ensuring no lib-boost version is hardcoded
    for pro in `find -maxdepth 1 -iname *.pro` ; do
        sed -i 's/-mgw46-mt-sd-1_53//g' $pro
    #Bitcoin client uses autoconf instead of qmake
    if [ -f "" ]
        echo Building with autoconf
        ./ &>>build.out
        ./configure USE_UPNP=- USE_QRCODE=0 USE_IPV6=0 --with-incompatible-bdb &>>build.out
        make &>>build.out
    #Most clients use qmake + make
        echo Building with qmake
        qmake USE_UPNP=- USE_QRCODE=0 USE_IPV6=0 &>>build.out
        make &>>build.out
    if test $status -eq 0
        echo Exit code was normal
    cd ..

This script was tested on Xubuntu 13.04, openSuse 12.3, Linux Mint 16 with the following repositories:

The following clients currently don’t build correctly

Depending on the cryptocoin-client, the compilation may take a while and it might look like nothing happens. The compilation output is redirected to ./autobuild//build.out .

//Update 2013-11-02: tested with more clients, added some more info, changed script to v0.4
//Update 2013-12-20: added DogeCoin to the list after testing it
//Update 2014-01-05: tested on Linux Mint 16 (Petra) XFCE edition + fix WordPress messing up the script


One thought on “Build cryptocoin wallet/client on Linux

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s