diff --git a/build/build.ps1 b/build/build.ps1 index 86b034a02..1baa55a51 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -25,6 +25,7 @@ pip install ..\. pyinstaller -y daemon.onefile.spec pyinstaller -y cli.onefile.spec +pyinstaller -y console.onefile.spec nuget install secure-file -ExcludeVersion secure-file\tools\secure-file -decrypt .\lbry2.pfx.enc -secret "$env:pfx_key" diff --git a/build/build.sh b/build/build.sh index d9094edb6..f23c098f7 100755 --- a/build/build.sh +++ b/build/build.sh @@ -42,6 +42,7 @@ cp "$ROOT/requirements.txt" "$BUILD_DIR/requirements_base.txt" cd "$BUILD_DIR" pyinstaller -y daemon.onefile.spec pyinstaller -y cli.onefile.spec + pyinstaller -y console.onefile.spec ) python "$BUILD_DIR/zip_daemon.py" diff --git a/build/console.onefile.spec b/build/console.onefile.spec new file mode 100644 index 000000000..420bf5043 --- /dev/null +++ b/build/console.onefile.spec @@ -0,0 +1,50 @@ +# -*- mode: python -*- +import platform +import os + +import lbryum + +dir = 'build'; +cwd = os.getcwd() +if os.path.basename(cwd) != dir: + raise Exception('pyinstaller build needs to be run from the ' + dir + ' directory') +repo_base = os.path.abspath(os.path.join(cwd, '..')) + +execfile(os.path.join(cwd, "entrypoint.py")) # ghetto import + + +system = platform.system() +if system == 'Darwin': + icns = os.path.join(repo_base, 'build', 'icon.icns') +elif system == 'Linux': + icns = os.path.join(repo_base, 'build', 'icons', '256x256.png') +elif system == 'Windows': + icns = os.path.join(repo_base, 'build', 'icons', 'lbry256.ico') +else: + print 'Warning: System {} has no icons'.format(system) + icns = None + + +datas = [ + (os.path.join(os.path.dirname(lbryum.__file__), 'wordlist', language + '.txt'), 'lbryum/wordlist') + for language in ('chinese_simplified', 'japanese', 'spanish','english', 'portuguese') +] + + +a = Entrypoint('lbrynet', 'console_scripts', 'lbrynet-console', pathex=[cwd], datas=datas) + +pyz = PYZ(a.pure, a.zipped_data) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + name='lbrynet-console', + debug=False, + strip=False, + upx=True, + console=True, + icon=icns +) diff --git a/build/zip_daemon.py b/build/zip_daemon.py index ef3f5e222..53c60085b 100644 --- a/build/zip_daemon.py +++ b/build/zip_daemon.py @@ -10,7 +10,7 @@ def main(): tag = subprocess.check_output(['git', 'describe']).strip() zipfilename = 'lbrynet-daemon-{}-{}.zip'.format(tag, get_system_label()) full_filename = os.path.join(this_dir, 'dist', zipfilename) - executables = ['lbrynet-daemon', 'lbrynet-cli'] + executables = ['lbrynet-daemon', 'lbrynet-cli', 'lbrynet-console'] ext = '.exe' if platform.system() == 'Windows' else '' with zipfile.ZipFile(full_filename, 'w') as myzip: for executable in executables: