Skip to content

Instantly share code, notes, and snippets.

@bellflower2015
Created July 14, 2019 09:26
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 bellflower2015/ab4973e55bd65a47c101e2f70588ab28 to your computer and use it in GitHub Desktop.
Save bellflower2015/ab4973e55bd65a47c101e2f70588ab28 to your computer and use it in GitHub Desktop.
sandego-qt-win.bash
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -y update
sudo apt-get -y install build-essential libtool automake pkg-config mingw-w64
sudo update-alternatives --set i686-w64-mingw32-gcc \
$(update-alternatives --list i686-w64-mingw32-gcc | grep -- -posix)
sudo update-alternatives --set i686-w64-mingw32-g++ \
$(update-alternatives --list i686-w64-mingw32-g++ | grep -- -posix)
sudo update-alternatives --set x86_64-w64-mingw32-gcc \
$(update-alternatives --list x86_64-w64-mingw32-gcc | grep -- -posix)
sudo update-alternatives --set x86_64-w64-mingw32-g++ \
$(update-alternatives --list x86_64-w64-mingw32-g++ | grep -- -posix)
TMP_DIRNAME=$(mktemp -d sdgo.XXXXXX)
BUILD_DIR=$PWD/$TMP_DIRNAME
mkdir -p $BUILD_DIR
curl -fsSL https://gist.githubusercontent.com/bellflower2015/3291d1a7ac04b53931593021a8b103cb/raw/SanDeGo-depends.patch > $BUILD_DIR/SanDeGo-depends.patch
curl -fsSL https://gist.githubusercontent.com/bellflower2015/bbda88d38b10025b24e22e251b5691c5/raw/SanDeGo-qt.pro.patch > $BUILD_DIR/SanDeGo-qt.pro.patch
cd $BUILD_DIR
git clone -b v0.17.1 --depth 1 https://github.com/bitcoin/bitcoin.git
cd bitcoin
patch -p1 < $BUILD_DIR/SanDeGo-depends.patch
cd depends
make HOST=x86_64-w64-mingw32 -j$(nproc)
cd $BUILD_DIR
git clone https://github.com/SanDeGoProject/SanDeGo.git
cd SanDeGo
patch -p1 < $BUILD_DIR/SanDeGo-qt.pro.patch
DEPENDS=$BUILD_DIR/bitcoin/depends/x86_64-w64-mingw32
$DEPENDS/native/bin/qmake \
BOOST_LIB_SUFFIX=-mt-s \
BOOST_THREAD_LIB_SUFFIX=-mt-s \
BOOST_INCLUDE_PATH=$DEPENDS/include/boost \
BOOST_LIB_PATH=$DEPENDS/lib \
OPENSSL_INCLUDE_PATH=$DEPENDS/include/openssl \
OPENSSL_LIB_PATH=$DEPENDS/lib \
BDB_INCLUDE_PATH=$DEPENDS/include \
BDB_LIB_PATH=$DEPENDS/lib \
MINIUPNPC_INCLUDE_PATH=$DEPENDS/include \
MINIUPNPC_LIB_PATH=$DEPENDS/lib \
QMAKE_LRELEASE=$DEPENDS/native/bin/lrelease
make -j$(nproc) -f Makefile.Release
if [ -d /vagrant ]; then
cp release/sandego-qt.exe /vagrant/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment