diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh index bafa2277f..2abb575fe 100755 --- a/contrib/build-wine/build-electrum-git.sh +++ b/contrib/build-wine/build-electrum-git.sh @@ -58,7 +58,7 @@ $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w --onefile "C:/ele $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w deterministic.spec # For building NSIS installer, run: -wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsis +wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsi #wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/NSIS/makensis.exe electrum.nsis DATE=`date +"%Y%m%d"` diff --git a/contrib/build-wine/build-electrum.sh b/contrib/build-wine/build-electrum.sh index a54e29a50..f4d91d73a 100755 --- a/contrib/build-wine/build-electrum.sh +++ b/contrib/build-wine/build-electrum.sh @@ -40,7 +40,7 @@ $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w --onefile "C:/ele $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w deterministic.spec # For building NSIS installer, run: -wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsis +wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsi #wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/NSIS/makensis.exe electrum.nsis cd dist diff --git a/contrib/build-wine/deterministic.spec b/contrib/build-wine/deterministic.spec index 5293cbfe0..db3eca3d9 100644 --- a/contrib/build-wine/deterministic.spec +++ b/contrib/build-wine/deterministic.spec @@ -1,24 +1,64 @@ # -*- mode: python -*- -a = Analysis(['C:/electrum/electrum'], - pathex=['Z:\\electrum-wine'], - hiddenimports=[], - excludes=['Tkinter'], + +# 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(['electrum', 'gui/gui_classic.py', 'gui/gui_lite.py', 'gui/gui_text.py', + 'lib/util.py', 'lib/wallet.py', 'lib/simple_config.py', + 'lib/bitcoin.py', 'lib/deserialize.py' + ], + hiddenimports=["lib","gui"], + pathex=['lib:gui:plugins'], hookspath=None) -pyz = PYZ(a.pure, level=0) + +##### include mydir in distribution ####### +def extra_datas(mydir): + def rec_glob(p, files): + import os + import glob + for d in glob.glob(p): + if os.path.isfile(d): + files.append(d) + rec_glob("%s/*" % d, files) + files = [] + rec_glob("%s/*" % mydir, files) + extra_datas = [] + for f in files: + extra_datas.append((f, f, 'DATA')) + + return extra_datas +########################################### + +# append dirs + +# Theme data +a.datas += extra_datas('data') + +# Localization +a.datas += extra_datas('locale') + +# Py folders that are needed because of the magic import finding +a.datas += extra_datas('gui') +a.datas += extra_datas('lib') +a.datas += extra_datas('plugins') + +pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, exclude_binaries=1, name=os.path.join('build\\pyi.win32\\electrum', 'electrum.exe'), - debug=False, + debug=True, strip=None, - upx=True, - console=False ) + upx=False, + icon='icons/electrum.ico', + console=True) + # The console True makes an annoying black box pop up, but it does make Electrum accept command line options. + coll = COLLECT(exe, a.binaries, a.zipfiles, a.datas, strip=None, upx=True, + debug=False, + icon='icons/electrum.ico', + console=True, name=os.path.join('dist', 'electrum')) -app = BUNDLE(coll, - name=os.path.join('dist', 'electrum.app')) diff --git a/contrib/build-wine/electrum.nsis b/contrib/build-wine/electrum.nsis deleted file mode 100644 index 469455576..000000000 --- a/contrib/build-wine/electrum.nsis +++ /dev/null @@ -1,104 +0,0 @@ -;-------------------------------- -;Include Modern UI - - !include "MUI2.nsh" - -;-------------------------------- -;General - - ;Name and file - Name "Electrum" - OutFile "dist/electrum-setup.exe" - - ;Default installation folder - InstallDir "$PROGRAMFILES\Electrum" - - ;Get installation folder from registry if available - InstallDirRegKey HKCU "Software\Electrum" "" - - ;Request application privileges for Windows Vista - RequestExecutionLevel admin - -;-------------------------------- -;Variables - -;-------------------------------- -;Interface Settings - - !define MUI_ABORTWARNING - -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_LICENSE "tmp/LICENCE" - ;!insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - - ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Electrum" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - ;!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder - - !insertmacro MUI_PAGE_INSTFILES - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Installer Sections - -Section - - SetOutPath "$INSTDIR" - - ;ADD YOUR OWN FILES HERE... - file /r dist\electrum\*.* - - ;Store installation folder - WriteRegStr HKCU "Software\Electrum" "" $INSTDIR - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - - CreateShortCut "$DESKTOP\Electrum.lnk" "$INSTDIR\electrum.exe" "" - - ;create start-menu items - CreateDirectory "$SMPROGRAMS\Electrum" - CreateShortCut "$SMPROGRAMS\Electrum\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 - CreateShortCut "$SMPROGRAMS\Electrum\Electrum.lnk" "$INSTDIR\electrum.exe" "" "$INSTDIR\electrum.exe" 0 - -SectionEnd - -;-------------------------------- -;Descriptions - - ;Assign language strings to sections - ;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - ; !insertmacro MUI_DESCRIPTION_TEXT ${SecDummy} $(DESC_SecDummy) - ;!insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - ;ADD YOUR OWN FILES HERE... - RMDir /r "$INSTDIR\*.*" - - RMDir "$INSTDIR" - - Delete "$DESKTOP\Electrum.lnk" - Delete "$SMPROGRAMS\Electrum\*.*" - RmDir "$SMPROGRAMS\Electrum" - - DeleteRegKey /ifempty HKCU "Software\Electrum" - -SectionEnd