-WIP-electrum-btcp/contrib/build-wine/build-electrum-git.sh

85 lines
1.9 KiB
Bash
Raw Normal View History

2012-12-09 15:50:07 -08:00
#!/bin/bash
# You probably need to update only this link
2017-10-20 06:49:01 -07:00
ELECTRUM_GIT_URL=https://github.com/spesmilo/electrum.git
2012-12-09 15:50:07 -08:00
BRANCH=master
NAME_ROOT=electrum
PYTHON_VERSION=3.5.4
2012-12-09 15:50:07 -08:00
if [ "$#" -gt 0 ]; then
BRANCH="$1"
fi
2015-10-23 03:51:54 -07:00
2012-12-09 15:50:07 -08:00
# These settings probably don't need any change
2016-02-24 10:06:13 -08:00
export WINEPREFIX=/opt/wine64
export PYTHONHASHSEED=22
2015-10-23 03:51:54 -07:00
PYHOME=c:/python$PYTHON_VERSION
2012-12-09 15:50:07 -08:00
PYTHON="wine $PYHOME/python.exe -OO -B"
2015-10-23 03:51:54 -07:00
2012-12-09 15:50:07 -08:00
# Let's begin!
cd `dirname $0`
set -e
cd tmp
if [ -d "electrum-git" ]; then
# GIT repository found, update it
echo "Pull"
cd electrum-git
git pull
2017-05-29 00:46:31 -07:00
git checkout $BRANCH
2012-12-09 15:50:07 -08:00
cd ..
else
# GIT repository not found, clone it
echo "Clone"
git clone -b $BRANCH $ELECTRUM_GIT_URL electrum-git
fi
cd electrum-git
2015-10-23 03:51:54 -07:00
VERSION=`git describe --tags`
echo "Last commit: $VERSION"
2015-10-23 03:51:54 -07:00
cd ..
2012-12-09 15:50:07 -08:00
rm -rf $WINEPREFIX/drive_c/electrum
cp -r electrum-git $WINEPREFIX/drive_c/electrum
2012-12-09 22:11:55 -08:00
cp electrum-git/LICENCE .
2012-12-09 15:50:07 -08:00
# add locale dir
cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/
2012-12-09 15:50:07 -08:00
# Build Qt resources
wine $WINEPREFIX/drive_c/python$PYTHON_VERSION/Scripts/pyrcc5.exe C:/electrum/icons.qrc -o C:/electrum/gui/qt/icons_rc.py
pushd $WINEPREFIX/drive_c/electrum
$PYTHON setup.py install
popd
2012-12-09 15:50:07 -08:00
cd ..
rm -rf dist/
2012-12-09 15:50:07 -08:00
2015-10-23 03:51:54 -07:00
# build standalone version
wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
2012-12-09 15:50:07 -08:00
2015-10-23 03:51:54 -07:00
# build NSIS installer
# $VERSION could be passed to the electrum.nsi script, but this would require some rewriting in the script iself.
wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" /DPRODUCT_VERSION=$VERSION electrum.nsi
2012-12-09 15:50:07 -08:00
cd dist
2015-10-23 03:51:54 -07:00
mv electrum-setup.exe $NAME_ROOT-$VERSION-setup.exe
cd ..
# build portable version
cp portable.patch $WINEPREFIX/drive_c/electrum
pushd $WINEPREFIX/drive_c/electrum
patch < portable.patch
popd
wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
2015-10-23 03:51:54 -07:00
echo "Done."