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

86 lines
2.1 KiB
Bash
Raw Normal View History

2012-12-09 15:50:07 -08:00
#!/bin/bash
# Please update these carefully, some versions won't work under Wine
2017-10-20 06:49:01 -07:00
NSIS_URL=https://prdownloads.sourceforge.net/nsis/nsis-3.02.1-setup.exe?download
PYTHON_VERSION=3.5.4
2015-10-23 03:51:54 -07:00
## These settings probably don't need change
2016-02-24 10:06:13 -08:00
export WINEPREFIX=/opt/wine64
2015-10-23 03:51:54 -07:00
#export WINEARCH='win32'
PYHOME=c:/python$PYTHON_VERSION
2012-12-09 15:50:07 -08:00
PYTHON="wine $PYHOME/python.exe -OO -B"
# Let's begin!
cd `dirname $0`
set -e
# Clean up Wine environment
echo "Cleaning $WINEPREFIX"
2015-10-23 03:51:54 -07:00
rm -rf $WINEPREFIX
2012-12-09 15:50:07 -08:00
echo "done"
2015-10-23 03:51:54 -07:00
wine 'wineboot'
2012-12-09 15:50:07 -08:00
echo "Cleaning tmp"
rm -rf tmp
mkdir -p tmp
echo "done"
cd tmp
# Install Python
for msifile in core dev exe lib pip tools; do
echo "Installing $msifile..."
wget "https://www.python.org/ftp/python/$PYTHON_VERSION/win32/${msifile}.msi"
wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/python$PYTHON_VERSION
done
2012-12-09 15:50:07 -08:00
# upgrade pip
$PYTHON -m pip install pip --upgrade
# Install PyWin32
$PYTHON -m pip install pypiwin32
# Install PyQt
$PYTHON -m pip install PyQt5
2012-12-09 15:50:07 -08:00
# Install pyinstaller
2017-10-16 19:04:15 -07:00
$PYTHON -m pip install pyinstaller==3.3
2012-12-09 15:50:07 -08:00
# Install ZBar
2017-10-20 06:49:01 -07:00
#wget -q -O zbar.exe "https://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
2012-12-09 15:50:07 -08:00
#wine zbar.exe
# install Cryptodome
$PYTHON -m pip install pycryptodomex
2017-07-27 00:30:22 -07:00
# install PySocks
$PYTHON -m pip install win_inet_pton
2017-08-03 06:05:05 -07:00
# install websocket (python2)
$PYTHON -m pip install websocket-client
2017-07-27 00:30:22 -07:00
2015-10-05 09:43:10 -07:00
# Install setuptools
#wget -O setuptools.exe "$SETUPTOOLS_URL"
#wine setuptools.exe
# Upgrade setuptools (so Electrum can be installed later)
$PYTHON -m pip install setuptools --upgrade
2015-10-05 09:43:10 -07:00
2012-12-09 15:50:07 -08:00
# Install NSIS installer
echo "Make sure to untick 'Start NSIS' and 'Show release notes'"
2015-10-05 09:43:10 -07:00
wget -q -O nsis.exe "$NSIS_URL"
2012-12-09 15:50:07 -08:00
wine nsis.exe
# Install UPX
2017-10-20 06:49:01 -07:00
#wget -O upx.zip "https://downloads.sourceforge.net/project/upx/upx/3.08/upx308w.zip"
2012-12-09 15:50:07 -08:00
#unzip -o upx.zip
#cp upx*/upx.exe .
2015-10-05 09:43:10 -07:00
# add dlls needed for pyinstaller:
cp $WINEPREFIX/drive_c/windows/system32/msvcp90.dll $WINEPREFIX/drive_c/python$PYTHON_VERSION/
cp $WINEPREFIX/drive_c/windows/system32/msvcm90.dll $WINEPREFIX/drive_c/python$PYTHON_VERSION/
cp $WINEPREFIX/drive_c/python$PYTHON_VERSION/Lib/site-packages/PyQt5/Qt/bin/* $WINEPREFIX/drive_c/python$PYTHON_VERSION/