bitcoin: build and link with libdb v4.8.x

This commit is contained in:
Leonid Pliushch 2019-09-16 14:59:45 +03:00
parent f7195017cc
commit b19bd8a041

View File

@ -5,7 +5,7 @@ TERMUX_PKG_VERSION=0.18.1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/bitcoin/bitcoin/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SRCURL=https://github.com/bitcoin/bitcoin/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=db3c76ac913adfd67e3c7ff243b443c9706f81dd382d1212875fefc2de1ea5ff TERMUX_PKG_SHA256=db3c76ac913adfd67e3c7ff243b443c9706f81dd382d1212875fefc2de1ea5ff
TERMUX_PKG_DEPENDS="boost, libdb, libevent, libzmq, openssl" TERMUX_PKG_DEPENDS="boost, libevent, libzmq, openssl"
TERMUX_PKG_CONFFILES="var/service/bitcoind/run var/service/bitcoind/log/run" TERMUX_PKG_CONFFILES="var/service/bitcoind/run var/service/bitcoind/log/run"
TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_BUILD_IN_SRC=true
@ -17,11 +17,40 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-boost-system=boost_system --with-boost-system=boost_system
--with-boost-thread=boost_thread --with-boost-thread=boost_thread
--with-gui=no --with-gui=no
--with-incompatible-bdb
--without-libs --without-libs
" "
termux_step_pre_configure() { termux_step_pre_configure() {
local db_version=4.8.30
local db_install_dir=$TERMUX_PKG_BUILDDIR/db-install
local db_build_dir=$TERMUX_PKG_BUILDDIR/db-build
termux_download https://download.oracle.com/berkeley-db/db-${db_version}.tar.gz \
$TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz \
e0491a07cdb21fb9aa82773bbbedaeb7639cbd0e7f96147ab46141e0045db72a
tar xf $TERMUX_PKG_CACHEDIR/db-${db_version}.tar.gz
cd $TERMUX_PKG_BUILDDIR/db-${db_version}
sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' \
dbinc/atomic.h
sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c \
mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c
termux_step_replace_guess_scripts
mkdir -p ${db_build_dir}
cd ${db_build_dir}
../db-${db_version}/dist/configure \
--host=$TERMUX_HOST_PLATFORM --prefix=${db_install_dir} \
--disable-shared --enable-static --enable-hash --enable-smallbuild \
--enable-compat185 --enable-cxx db_cv_atomic=gcc-builtin
make -j $TERMUX_MAKE_PROCESSES
make install_lib install_include
cd $TERMUX_PKG_BUILDDIR
export BDB_CFLAGS="-I${db_install_dir}/include -DHAVE_CXX_STDHEADERS=1"
export BDB_LIBS="-L${db_install_dir}/lib -ldb_cxx"
./autogen.sh ./autogen.sh
} }