Compile latest GnuCash 3 source with latest AqBanking on CentOS 8 (PSD2 support)

Documentation date: 2019-09-26.

New to the collection: CentOS 8 documentation!

GnuCash is currently not available for CentOS 8. These instructions will guide you through the compilation from source. Unfortunately, some prerequisites have been decommissioned from Red Hat 8 or are otherwise not available. So you also have to build those first. This makes it a bit of a tedious job.

I am making an effort to keep changes to the core OS at a minimum so you can easily update or revert back to stock packages, should packages become available. Therefore, I am using the /tmp folder. Installations should be put to /usr/local as these are not distribution packages. Do feel free to deviate from the tmp folder to make your installation more permanent.

This setup will allow you to connect to your bank using the latest FinTS/HBCI protocol using PSD2 features.

Let me know, if this article has helped you and/or saved you tons of time. I am also happy to hear any improvement suggestions (ws1909@bluhm-de.com)

Features:

- GnuCash Maintenance branch (Version higher than 3.7) with MySQL support and Python Bindings.
- AqBanking Master branch (Version higher than 5.99) with PSD2 support.
- Tons of other packages like gmock, gtest, libunistring, guile, libofx, gwenhyfar, bdw-gc, opensp, texinfo, xmlsec1-gnutls

Assumption: "Workstation" module is installed

### Let's get going:

dnf -y update
CPU_CORES=$((`nproc` - 1 | bc)) # This will use all but 1 CPU core in conjunction with make -j
if [ "$CPU_CORES" -lt "1" ]; then CPU_CORES=1; fi

# Starting off with Aqbanking

## Gwenhyfer
dnf -y install gnutls-devel libgcrypt-devel libtool automake autoconf qt5-qtbase-devel  gcc-c++ gtk3-devel qt5-linguist openssl-devel

sudo ln -s /usr/bin/moc-qt5 /usr/bin/moc
sudo ln -s /usr/bin/lrelease-qt5 /usr/bin/lrelease
sudo ln -s /usr/bin/lupdate-qt5 /usr/bin/lupdate
sudo ln -s /usr/bin/uic-qt5 /usr/bin/uic
sudo ln -s /usr/bin/qmake-qt5 /usr/bin/qmake

GWEN_VERSION=master
cd /tmp
wget --content-disposition https://codeload.github.com/aqbanking/gwenhywfar/zip/${GWEN_VERSION}
unzip gwenhywfar-${GWEN_VERSION}
cd gwenhywfar-${GWEN_VERSION}
autoreconf -i
./configure --with-guis="gtk3 qt5"
make -j${CPU_CORES}
make install # installs gwenhywfar to /usr/lib/cmake/${GWEN_VERSION}

# Aqbanking

## Install xmlsec1-gnutls. At time of writing, this was only part of the Red Hat Code Builder repository so we have to build it ourselves.
XMLSEC_VERSION=1.2.28
dnf -y install libxml2-devel libtool-ltdl-devel
cd /tmp
wget http://www.aleksey.com/xmlsec/download/xmlsec1-${XMLSEC_VERSION}.tar.gz
tar xf xmlsec1-${XMLSEC_VERSION}.tar.gz
cd xmlsec1-${XMLSEC_VERSION}
./configure
make -j${CPU_CORES}
sudo make install
export XMLSEC_CFLAGS=-I/usr/local/include/xmlsec1
export XMLSEC_LIBS=-lxmlsec1

#Building AqBanking
AQ_VERSION=master
dnf -y install autoconf libtool automake gmp-devel gnutls-devel libgcrypt-devel gcc-c++ libtool-ltdl-devel libxslt-devel bzip2
cd /tmp
wget --content-disposition https://codeload.github.com/aqbanking/aqbanking/zip/${AQ_VERSION}
unzip aqbanking-${AQ_VERSION}.zip
cd aqbanking-${AQ_VERSION}
export LD_LIBRARY_PATH=/usr/lib
autoreconf -i
./configure  # we are intentionally leaving the aqebics backend out as compilation is buggy"
make
make install

 

# Google Mock
GMOCK_VERSION=master
cd /tmp
wget --content-disposition https://codeload.github.com/google/googletest/zip/${GMOCK_VERSION}
unzip googletest-${GMOCK_VERSION}
cd googletest-${GMOCK_VERSION}
export GTEST_ROOT=`pwd`/googletest
export GMOCK_ROOT=`pwd`/googlemock

 

# Guile
## Starting off with libunistring
LIBUNISTRING_VERSION=0.9.10
dnf -y install gcc-c++
cd /tmp
wget http://ftp.gnu.org/gnu/libunistring/libunistring-${LIBUNISTRING_VERSION}.tar.gz
tar -xf libunistring-${LIBUNISTRING_VERSION}.tar.gz
cd libunistring-${LIBUNISTRING_VERSION}
./configure
make -j${CPU_CORES}
make install

## bdw-gc
GC_VER=8.0.4
dnf -y install gcc-c++
cd /tmp
wget https://www.hboehm.info/gc/gc_source/gc-${GC_VER}.tar.gz
tar -xf gc-${GC_VER}.tar.gz
cd gc-${GC_VER}
./configure
make -j${CPU_CORES}
make install

# Building Guile
GUILE_VERSION=2.2.6
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig # to find bdw-gc
dnf -y install libffi-devel libtool-ltdl-devel gcc-c++ gmp-devel
cd /tmp
wget https://ftp.gnu.org/gnu/guile/guile-${GUILE_VERSION}.tar.gz
tar -xf guile-${GUILE_VERSION}.tar.gz
cd guile-${GUILE_VERSION}
./configure
make -j${CPU_CORES} # Takes a long time
make install

 

# Libofx
## Starting with OpenSP
OPENSP_VER=1.5.2
dnf -y install xmlto gcc-c++
cd /tmp
wget https://sourceforge.net/projects/openjade/files/opensp/${OPENSP_VER}/OpenSP-${OPENSP_VER}.tar.gz
tar xf  OpenSP-${OPENSP_VER}.tar.gz
cd OpenSP-${OPENSP_VER}
./configure
make #does not compile multicore
make install

## Gengetopt
### Texinfo
TEXINFO_VER=6.7
dnf -y install gcc-c++ ncurses-devel
cd /tmp
wget http://ftp.gnu.org/gnu/texinfo/texinfo-${TEXINFO_VER}.tar.xz
tar xf texinfo-${TEXINFO_VER}.tar.xz
cd texinfo-${TEXINFO_VER}
./configure
make -j${CPU_CORES}
make install

## Building Gengetopt
GENGETOPT_VER=2.23
dnf -y install gcc-c++
cd /tmp
wget ftp://ftp.gnu.org/gnu/gengetopt/gengetopt-${GENGETOPT_VER}.tar.xz
tar xf gengetopt-${GENGETOPT_VER}.tar.xz
cd gengetopt-${GENGETOPT_VER}
./configure
make -j${CPU_CORES}
make install

# Building Libofx
LIBOFX_VERSION=0.9.14
dnf -y install autoconf libtool automake
cd /tmp
wget https://github.com/libofx/libofx/archive/${LIBOFX_VERSION}.tar.gz
tar xf ${LIBOFX_VERSION}.tar.gz
cd libofx-${LIBOFX_VERSION}
autoreconf -i
export LD_LIBRARY_PATH=/usr/local/lib
./configure
make -j${CPU_CORES}
make install

 

# now off to compile gnucash (yeah, finally)


export GTEST_ROOT=/tmp/googletest-${GMOCK_VERSION}/googletest
export GMOCK_ROOT=/tmp/googletest-${GMOCK_VERSION}/googlemock
export LD_LIBRARY_PATH=/usr/local/lib
#export PKG_CONFIG_PATH=/tmp/gwenhywfar-${GWEN_VERSION}:/tmp/aqbanking-${AQ_VERSION}:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

cd /tmp
export GNUCASH_VERSION=maint
#sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # install EPEL
dnf -y install webkit2gtk3-devel swig  libdbi-devel libdbi-dbd-mysql python3-devel libsecret-devel libxslt-devel boost-devel

git clone https://github.com/Gnucash/gnucash.git # You have to use the git repo or CMake will fail. The repository information is required to add version information.
cd gnucash
git checkout ${GNUCASH_VERSION}
cd ..
mkdir build-gnucash-${GNUCASH_VERSION}
cd build-gnucash-${GNUCASH_VERSION}
cmake -DWITH_PYTHON=ON ../gnucash
make -j${CPU_CORES}
sudo make install/strip # strip removes all debug info on installing
sed -i "s#Exec=#Exec=env LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib#" /usr/local/share/applications/gnucash.desktop # This adds LD_LIBRARY_PATH to the GnuCash application icon. This command line has not been tested yet

 

# To start gnucash (or just open the application icon)
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
gnucash