Build Peercoin Qt.app and DMG package on MacOS - nohea/peercoin GitHub Wiki

Building on MacOS (formerly OS X) requires Xcode and Homebrew. (Tested on Mac OS Sierra)

Xcode

  • Install Xcode via app store
  • Install Xcode command line tools

xcode-select --install

Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

dependencies

brew install automake berkeley-db4 libtool boost --c++11 miniupnpc openssl pkg-config protobuf qt libevent librsvg 

Note: berkeley-db4 installs the 4.8.x version, which is for the standard bitcoin wallet.dat format.

QR Code support

brew install qrencode

QT5

qt5 expects its bin tools in the PATH

echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
. ~/.bash_profile

get Peercoin source code from github

git clone https://github.com/peercoin/peercoin.git
cd peercoin

Build Peercoin-Qt using qmake / make

Note: the Homebrew-installed library version numbers will have to be altered to match what is installed on your system.

make clean
make distclean

qmake "BOOST_INCLUDE_PATH=/usr/local/Cellar/boost/1.64.0_1/include" "BOOST_LIB_PATH=/usr/local/Cellar/boost/1.64.0_1/lib" "OPENSSL_INCLUDE_PATH=/usr/local/Cellar/openssl/1.0.2l/include" "OPENSSL_LIB_PATH=/usr/local/Cellar/openssl/1.0.2l/lib" "BDB_INCLUDE_PATH=/usr/local/opt/berkeley-db@4/include" "BDB_LIB_PATH=/usr/local/opt/berkeley-db@4/lib" 	"MINIUPNPC_INCLUDE_PATH=/usr/local/Cellar/miniupnpc/2.0.20170509/include" "MINIUPNPC_LIB_PATH=/usr/local/Cellar/miniupnpc/2.0.20170509/lib" "QMAKE_CXXFLAGS=-std=c++11 -DBOOST_NO_CXX11_SCOPED_ENUMS" "QRENCODE_LIB_PATH=/usr/local/Cellar/qrencode/3.4.4/lib" "QRENCODE_INCLUDE_PATH=/usr/local/Cellar/qrencode/3.4.4/include" "USE_UPNP=0" "USE_QRCODE=1" bitcoin-qt.pro
make

Package into a DMG file

./contrib/macdeploy/macdeployqtplus Peercoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy ./contrib/macdeploy/fancy.plist -verbose 2

This creates Peercoin-Qt.dmg