Skip to content

Instantly share code, notes, and snippets.

@eSlider
Created July 16, 2018 12:48
Show Gist options
  • Save eSlider/25437dc7107554a943daf90df7b1d280 to your computer and use it in GitHub Desktop.
Save eSlider/25437dc7107554a943daf90df7b1d280 to your computer and use it in GitHub Desktop.
Build cPay for linux
#!/bin/sh
# Requires:
# PPA="ppa:bitcoin/bitcoin"
# PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev"
unset CC
unset CXX
unset DISPLAY
HOST="i686-pc-linux-gnu"
#HOST="x86_64-unknown-linux-gnu"
CCACHE_SIZE="2G"
#sudo dpkg --add-architecture i386
#PACKAGES="g++-multilib bc python3-zmq"
#sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES
# Create release directory
mkdir -p release
# Build depends
# Compile with all CPU's the power!
make -j`nproc` -C "depends" HOST=${HOST}
# \
#LDFLAGS="-static-libstdc++ -static-libgcc -static" \
#CXXFLAGS="-static-libstdc++ -static-libgcc -static"
# Set CCACHE SIZE
#depends/${HOST}/native/bin/ccache --max-size=$CCACHE_SIZE
# Kill and remove binaries
killall -s SIGKILL "cpayd"
killall -s SIGKILL "cpay-qt"
rm src/cpayd
rm src/qt/cpay-qt
# Gen
./autogen.sh
# Configure without test, bench, etc.
# We need it fast!
# --enable-zmq \
# --enable-cxx \
# --enable-gui \
# --with-miniupnpc \
# --with-incompatible-bdb \
# --disable-dependency-tracking \
#--with-libs
#--with-utils
./configure \
--enable-cxx \
--disable-shared \
--with-pic \
--enable-reduce-exports \
--with-miniupnpc \
--enable-upnp-default \
--disable-dependency-tracking \
--disable-tests \
--disable-gui-tests \
--disable-bench \
--prefix=`pwd`/depends/${HOST}
# Remove anything from before
make -j`nproc` -C src clean
make -j`nproc` clean
# Compile with all CPU's the power!make -j`nproc`
make -j`nproc`
# Copy executables
cp src/qt/cpay-qt src/cpayd src/cpay-cli release/
# Strip executables
#strip src/qt/cpay-qt
#strip src/cpayd
#strip src/cpay-cli
# Show results
du -h release/*
# Get files info (shared?)
file release/*
ldd src/cpayd
file src/cpayd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment