fixed scripts for wine build
This commit is contained in:
parent
d68042e76e
commit
7361687210
|
@ -1,12 +0,0 @@
|
||||||
252a253,255
|
|
||||||
> class NoZlib:
|
|
||||||
> def decompress(self, data):
|
|
||||||
> return data
|
|
||||||
253a257,259
|
|
||||||
> def compress(self, data, lvl):
|
|
||||||
> return data
|
|
||||||
>
|
|
||||||
316c322
|
|
||||||
< zlib = DummyZlib()
|
|
||||||
---
|
|
||||||
> zlib = NoZlib()
|
|
|
@ -7,7 +7,7 @@ NAME_ROOT=electrum
|
||||||
|
|
||||||
# These settings probably don't need any change
|
# These settings probably don't need any change
|
||||||
export WINEPREFIX=/opt/wine-electrum
|
export WINEPREFIX=/opt/wine-electrum
|
||||||
PYHOME=c:/python26
|
PYHOME=c:/python27
|
||||||
PYTHON="wine $PYHOME/python.exe -OO -B"
|
PYTHON="wine $PYHOME/python.exe -OO -B"
|
||||||
|
|
||||||
# Let's begin!
|
# Let's begin!
|
||||||
|
@ -42,24 +42,17 @@ cp -r electrum-git $WINEPREFIX/drive_c/electrum
|
||||||
cp electrum-git/LICENCE .
|
cp electrum-git/LICENCE .
|
||||||
|
|
||||||
# Build Qt resources
|
# Build Qt resources
|
||||||
wine $WINEPREFIX/drive_c/Python26/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/lib/icons_rc.py
|
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/lib/icons_rc.py
|
||||||
|
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/gui/qt/icons_rc.py
|
||||||
# Copy ZBar libraries to electrum
|
|
||||||
#cp "$WINEPREFIX/drive_c/Program Files (x86)/ZBar/bin/"*.dll "$WINEPREFIX/drive_c/electrum/"
|
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
|
|
||||||
# For building standalone compressed EXE, run:
|
|
||||||
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w --onefile "C:/electrum/electrum"
|
|
||||||
|
|
||||||
# For building uncompressed directory of dependencies, run:
|
|
||||||
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w deterministic.spec
|
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w deterministic.spec
|
||||||
|
|
||||||
# For building NSIS installer, run:
|
# For building NSIS installer, run:
|
||||||
wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsi
|
wine "$WINEPREFIX/drive_c/Program Files/NSIS/makensis.exe" electrum.nsi
|
||||||
#wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/NSIS/makensis.exe electrum.nsis
|
|
||||||
|
|
||||||
DATE=`date +"%Y%m%d"`
|
DATE=`date +"%Y%m%d"`
|
||||||
cd dist
|
cd dist
|
||||||
|
|
|
@ -1,15 +1,25 @@
|
||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
|
|
||||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
home = 'C:\\electrum\\'
|
||||||
a = Analysis(['electrum', 'gui/qt/main_window.py', 'gui/qt/lite_window.py', 'gui/text.py',
|
|
||||||
'lib/util.py', 'lib/wallet.py', 'lib/simple_config.py',
|
|
||||||
'lib/bitcoin.py'
|
|
||||||
],
|
|
||||||
hiddenimports=["lib","gui"],
|
|
||||||
pathex=['lib','gui','plugins','packages'],
|
|
||||||
hookspath=None)
|
|
||||||
|
|
||||||
##### include mydir in distribution #######
|
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||||
|
a = Analysis([home+'electrum',
|
||||||
|
home+'gui/qt/main_window.py',
|
||||||
|
home+'gui/qt/lite_window.py',
|
||||||
|
home+'gui/text.py',
|
||||||
|
home+'lib/util.py',
|
||||||
|
home+'lib/wallet.py',
|
||||||
|
home+'lib/simple_config.py',
|
||||||
|
home+'lib/bitcoin.py',
|
||||||
|
home+'lib/dnssec.py',
|
||||||
|
home+'lib/commands.py',
|
||||||
|
home+'packages/requests/utils.py'
|
||||||
|
],
|
||||||
|
pathex=['lib','gui','plugins','packages'],
|
||||||
|
hiddenimports=['lib','gui'],
|
||||||
|
hookspath=[])
|
||||||
|
|
||||||
|
##### include folder in distribution #######
|
||||||
def extra_datas(mydir):
|
def extra_datas(mydir):
|
||||||
def rec_glob(p, files):
|
def rec_glob(p, files):
|
||||||
import os
|
import os
|
||||||
|
@ -22,7 +32,14 @@ def extra_datas(mydir):
|
||||||
rec_glob("%s/*" % mydir, files)
|
rec_glob("%s/*" % mydir, files)
|
||||||
extra_datas = []
|
extra_datas = []
|
||||||
for f in files:
|
for f in files:
|
||||||
extra_datas.append((f, f, 'DATA'))
|
d = f.split('\\')
|
||||||
|
t = ''
|
||||||
|
for a in d[2:]:
|
||||||
|
if len(t)==0:
|
||||||
|
t = a
|
||||||
|
else:
|
||||||
|
t = t+'\\'+a
|
||||||
|
extra_datas.append((t, f, 'DATA'))
|
||||||
|
|
||||||
return extra_datas
|
return extra_datas
|
||||||
###########################################
|
###########################################
|
||||||
|
@ -30,12 +47,13 @@ def extra_datas(mydir):
|
||||||
# append dirs
|
# append dirs
|
||||||
|
|
||||||
# cacert.pem
|
# cacert.pem
|
||||||
a.datas += [ ('requests/cacert.pem', 'packages/requests/cacert.pem', 'DATA') ]
|
a.datas += [ ('requests/cacert.pem', home+'packages/requests/cacert.pem', 'DATA') ]
|
||||||
|
|
||||||
# Py folders that are needed because of the magic import finding
|
# Py folders that are needed because of the magic import finding
|
||||||
a.datas += extra_datas('gui')
|
a.datas += extra_datas(home+'gui')
|
||||||
a.datas += extra_datas('lib')
|
a.datas += extra_datas(home+'lib')
|
||||||
a.datas += extra_datas('plugins')
|
a.datas += extra_datas(home+'plugins')
|
||||||
|
a.datas += extra_datas(home+'packages')
|
||||||
|
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
exe = EXE(pyz,
|
exe = EXE(pyz,
|
||||||
|
@ -46,7 +64,7 @@ exe = EXE(pyz,
|
||||||
debug=False,
|
debug=False,
|
||||||
strip=None,
|
strip=None,
|
||||||
upx=False,
|
upx=False,
|
||||||
icon='icons/electrum.ico',
|
icon=home+'icons/electrum.ico',
|
||||||
console=False)
|
console=False)
|
||||||
# The console True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used
|
# The console True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used
|
||||||
|
|
||||||
|
@ -57,6 +75,6 @@ coll = COLLECT(exe,
|
||||||
strip=None,
|
strip=None,
|
||||||
upx=True,
|
upx=True,
|
||||||
debug=False,
|
debug=False,
|
||||||
icon='icons/electrum.ico',
|
icon=home+'icons/electrum.ico',
|
||||||
console=False,
|
console=False,
|
||||||
name=os.path.join('dist', 'electrum'))
|
name=os.path.join('dist', 'electrum'))
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Please update these links carefully, some versions won't work under Wine
|
# Please update these links carefully, some versions won't work under Wine
|
||||||
PYTHON_URL=http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
|
PYTHON_URL=http://www.python.org/ftp/python/2.7.8/python-2.7.8.msi
|
||||||
PYQT4_URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.9.5/PyQt-Py2.6-x86-gpl-4.9.5-1.exe
|
PYQT4_URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.1/PyQt4-4.11.1-gpl-Py2.7-Qt4.8.6-x32.exe
|
||||||
PYWIN32_URL=http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.6.exe/download
|
PYWIN32_URL=http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
|
||||||
PYINSTALLER_URL=http://downloads.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2.0.zip
|
PYINSTALLER_URL=https://pypi.python.org/packages/source/P/PyInstaller/PyInstaller-2.1.zip
|
||||||
NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
|
NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
|
||||||
#ZBAR_URL=http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download
|
SETUPTOOLS_URL=https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
|
||||||
|
|
||||||
# These settings probably don't need change
|
# These settings probably don't need change
|
||||||
export WINEPREFIX=/opt/wine-electrum
|
export WINEPREFIX=/opt/wine-electrum
|
||||||
PYHOME=c:/python26
|
PYHOME=c:/python27
|
||||||
PYTHON="wine $PYHOME/python.exe -OO -B"
|
PYTHON="wine $PYHOME/python.exe -OO -B"
|
||||||
|
|
||||||
# Let's begin!
|
# Let's begin!
|
||||||
|
@ -31,7 +31,7 @@ cd tmp
|
||||||
|
|
||||||
# Install Python
|
# Install Python
|
||||||
wget -O python.msi "$PYTHON_URL"
|
wget -O python.msi "$PYTHON_URL"
|
||||||
msiexec /q /i python.msi
|
wine msiexec /q /i python.msi
|
||||||
|
|
||||||
# Install PyWin32
|
# Install PyWin32
|
||||||
wget -O pywin32.exe "$PYWIN32_URL"
|
wget -O pywin32.exe "$PYWIN32_URL"
|
||||||
|
@ -41,28 +41,31 @@ wine pywin32.exe
|
||||||
wget -O PyQt.exe "$PYQT4_URL"
|
wget -O PyQt.exe "$PYQT4_URL"
|
||||||
wine PyQt.exe
|
wine PyQt.exe
|
||||||
|
|
||||||
#cp -r /electrum-wine/pyinstaller $WINEPREFIX/drive_c/
|
|
||||||
# Install pyinstaller
|
# Install pyinstaller
|
||||||
wget -O pyinstaller.zip "$PYINSTALLER_URL"
|
wget -O pyinstaller.zip "$PYINSTALLER_URL"
|
||||||
unzip pyinstaller.zip
|
unzip pyinstaller.zip
|
||||||
mv pyinstaller-2.0 $WINEPREFIX/drive_c/pyinstaller
|
mv PyInstaller-2.1 $WINEPREFIX/drive_c/pyinstaller
|
||||||
|
|
||||||
# Patch pyinstaller's DummyZlib
|
|
||||||
patch $WINEPREFIX/drive_c/pyinstaller/PyInstaller/loader/archive.py < ../archive.patch
|
|
||||||
|
|
||||||
# Install ZBar
|
# Install ZBar
|
||||||
#wget -q -O zbar.exe "http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
|
#wget -q -O zbar.exe "http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
|
||||||
#wine zbar.exe
|
#wine zbar.exe
|
||||||
|
|
||||||
|
# Install setuptools
|
||||||
|
wget -O setuptools.exe "$SETUPTOOLS_URL"
|
||||||
|
wine setuptools.exe
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
wget -q -O - "http://python-distribute.org/distribute_setup.py" | $PYTHON
|
wine "$PYHOME\\Scripts\\easy_install.exe" ecdsa #zbar
|
||||||
wine "$PYHOME\\Scripts\\easy_install.exe" ecdsa slowaes #zbar
|
|
||||||
|
|
||||||
# Install NSIS installer
|
# Install NSIS installer
|
||||||
wget -q -O nsis.exe "http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download"
|
wget -q -O nsis.exe "$NSIS_URL"
|
||||||
wine nsis.exe
|
wine nsis.exe
|
||||||
|
|
||||||
# Install UPX
|
# Install UPX
|
||||||
#wget -O upx.zip "http://upx.sourceforge.net/download/upx308w.zip"
|
#wget -O upx.zip "http://upx.sourceforge.net/download/upx308w.zip"
|
||||||
#unzip -o upx.zip
|
#unzip -o upx.zip
|
||||||
#cp upx*/upx.exe .
|
#cp upx*/upx.exe .
|
||||||
|
|
||||||
|
# add dlls needed for pyinstaller:
|
||||||
|
cp $WINEPREFIX/drive_c/windows/system32/msvcp90.dll $WINEPREFIX/drive_c/Python27/
|
||||||
|
cp $WINEPREFIX/drive_c/windows/system32/msvcm90.dll $WINEPREFIX/drive_c/Python27/
|
||||||
|
|
Loading…
Reference in New Issue