Skip to content

Instantly share code, notes, and snippets.

@gourytch
Created September 3, 2019 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gourytch/ac0275a44651bede80880558d75b0f56 to your computer and use it in GitHub Desktop.
Save gourytch/ac0275a44651bede80880558d75b0f56 to your computer and use it in GitHub Desktop.
#! /bin/sh
set -e
set -x
name='Bitradio'
branch='master'
with_incompatible_bdb=0
patch_atomic_pointer=0 #1
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git wget \
build-essential libtool automake autotools-dev autoconf pkg-config bsdmainutils \
libgmp3-dev libevent-dev zlib1g-dev \
libboost-system-dev libboost-filesystem-dev libboost-chrono-dev \
libboost-program-options-dev libboost-test-dev libboost-thread-dev \
libssl1.0-dev libminiupnpc-dev
url="https://github.com/thebitradio/Bitradio.git"
this=$(dirname $(readlink -f $0))
base=$this/workdir
prefix=$base/$name
srcdir=$prefix-src
mkdir -p $base
cd $base
if [ ! "x$with_incompatibe_bdb" = "x1" ]; then
bdb_prefix=$base/bdb48
if [ ! -e $bdb_prefix/lib/libdb_cxx.a ]; then
if [ ! -e db-4.8.30.NC.tar.gz ]; then
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c
fi
[ -d db-4.8.30.NC ] || tar xzpf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix/
../dist/configure --build=arm-linux --enable-cxx --enable-static --disable-shared --with-pic --prefix=$bdb_prefix
make all install
fi
export BDB_INCLUDE_PATH="$bdb_prefix/include"
export BDB_LIB_PATH="$bdb_prefix/lib"
fi
cd $base
if [ ! -d $srcdir ]; then
if [ -n "$branch" ]; then
git clone --branch $branch $url $srcdir
else
git clone $url $srcdir
fi
else
cd $srcdir
git fetch --all
git pull
cd $base
fi
if [ "x$patch_atomic_pointer" = "x1" ]; then
cp -f $this/atomic_pointer.h $srcdir/src/leveldb/port/
fi
cd $srcdir/src
chmod 755 leveldb/build_detect_platform secp256k1/autogen.sh
if [ ! -e leveldb/libleveldb.a ]; then
cd leveldb && \
make libleveldb.a libmemenv.a && \
cd ..
fi
cd $srcdir
test -e ./configure || ./autogen.sh
./configure --enable-cxx \
--enable-static --disable-shared --with-pic \
--enable-hardening --with-gui=no \
LDFLAGS="-L${BDB_LIB_PATH}" CPPFLAGS="-I${BDB_INCLUDE_PATH}"
make
for name in bitradio-cli bitradio-tx bitradiod ; do
strip src/$name && \
cp src/$name $base/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment