Browse Source

Update Windows build to Python 3.5 and PyQt5

seed_v14
Johann Bauer 7 years ago
parent
commit
bf790e9e85
  1. 9
      contrib/build-wine/build-electrum-git.sh
  2. 37
      contrib/build-wine/prepare-wine.sh

9
contrib/build-wine/build-electrum-git.sh

@ -4,6 +4,7 @@
ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git
BRANCH=master BRANCH=master
NAME_ROOT=electrum NAME_ROOT=electrum
PYTHON_VERSION=3.5.4
if [ "$#" -gt 0 ]; then if [ "$#" -gt 0 ]; then
BRANCH="$1" BRANCH="$1"
@ -14,7 +15,7 @@ export WINEPREFIX=/opt/wine64
export PYTHONHASHSEED=22 export PYTHONHASHSEED=22
PYHOME=c:/python34 PYHOME=c:/python$PYTHON_VERSION
PYTHON="wine $PYHOME/python.exe -OO -B" PYTHON="wine $PYHOME/python.exe -OO -B"
@ -51,7 +52,7 @@ cp electrum-git/LICENCE .
cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/ cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/
# Build Qt resources # Build Qt resources
wine $WINEPREFIX/drive_c/Python34/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/gui/qt/icons_rc.py -py3 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 pushd $WINEPREFIX/drive_c/electrum
@ -63,7 +64,7 @@ cd ..
rm -rf dist/ rm -rf dist/
# build standalone version # build standalone version
wine "C:/python34/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
# build NSIS installer # build NSIS installer
# $VERSION could be passed to the electrum.nsi script, but this would require some rewriting in the script iself. # $VERSION could be passed to the electrum.nsi script, but this would require some rewriting in the script iself.
@ -78,6 +79,6 @@ cp portable.patch $WINEPREFIX/drive_c/electrum
pushd $WINEPREFIX/drive_c/electrum pushd $WINEPREFIX/drive_c/electrum
patch < portable.patch patch < portable.patch
popd popd
wine "C:/python34/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec wine "C:/python$PYTHON_VERSION/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
echo "Done." echo "Done."

37
contrib/build-wine/prepare-wine.sh

@ -1,17 +1,14 @@
#!/bin/bash #!/bin/bash
# Please update these links carefully, some versions won't work under Wine # Please update these carefully, some versions won't work under Wine
PYTHON_URL=https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-3.02.1-setup.exe?download
PYWIN32_URL=https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/pywin32-221.win-amd64-py3.4.exe PYTHON_VERSION=3.5.4
PYQT4_URL=https://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py3.4-Qt4.8.7-x64.exe
NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
## These settings probably don't need change ## These settings probably don't need change
export WINEPREFIX=/opt/wine64 export WINEPREFIX=/opt/wine64
#export WINEARCH='win32' #export WINEARCH='win32'
PYHOME=c:/python34 PYHOME=c:/python$PYTHON_VERSION
PYTHON="wine $PYHOME/python.exe -OO -B" PYTHON="wine $PYHOME/python.exe -OO -B"
# Let's begin! # Let's begin!
@ -33,20 +30,21 @@ echo "done"
cd tmp cd tmp
# Install Python # Install Python
wget -O python.msi "$PYTHON_URL" for msifile in core dev exe lib pip tools; do
wine msiexec /q /i python.msi echo "Installing $msifile..."
wget "https://www.python.org/ftp/python/$PYTHON_VERSION/win32/${msifile}.msi"
# Install PyWin32 wine msiexec /i "${msifile}.msi" /qb TARGETDIR=C:/python$PYTHON_VERSION
wget -O pywin32.exe "$PYWIN32_URL" done
wine pywin32.exe
# Install PyQt4
wget -O PyQt.exe "$PYQT4_URL"
wine PyQt.exe
# upgrade pip # upgrade pip
$PYTHON -m pip install pip --upgrade $PYTHON -m pip install pip --upgrade
# Install PyWin32
$PYTHON -m pip install pypiwin32
# Install PyQt
$PYTHON -m pip install PyQt5
# Install pyinstaller # Install pyinstaller
$PYTHON -m pip install pyinstaller==3.2.1 $PYTHON -m pip install pyinstaller==3.2.1
@ -82,5 +80,6 @@ wine nsis.exe
#cp upx*/upx.exe . #cp upx*/upx.exe .
# add dlls needed for pyinstaller: # add dlls needed for pyinstaller:
cp $WINEPREFIX/drive_c/windows/system32/msvcp90.dll $WINEPREFIX/drive_c/Python34/ 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/Python34/ 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/

Loading…
Cancel
Save