diff --git a/build/build.ps1 b/build/build.ps1 deleted file mode 100644 index 9785bcbf7..000000000 --- a/build/build.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -$env:Path += ";C:\MinGW\bin\" - -$env:Path += ";C:\Program Files (x86)\Windows Kits\10\bin\x86\" -gcc --version -mingw32-make --version - -# build/install miniupnpc manually -tar zxf miniupnpc-1.9.tar.gz -cd miniupnpc-1.9 -mingw32-make -f Makefile.mingw -python setupmingw32.py build --compiler=mingw32 -python setupmingw32.py install -cd ..\ -Remove-Item -Recurse -Force miniupnpc-1.9 - -# copy requirements from lbry, but remove miniupnpc (installed manually) -Get-Content ..\requirements.txt | Select-String -Pattern 'miniupnpc' -NotMatch | Out-File requirements_base.txt - -python set_build.py - -pip install -r requirements.txt -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" -signtool.exe sign /f .\lbry2.pfx /p "$env:key_pass" /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 dist\*.exe - -python zip_daemon.py -python upload_assets.py diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index f23c098f7..000000000 --- a/build/build.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -set -euo pipefail -set -x - -ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" -cd "$ROOT" -BUILD_DIR="$ROOT/build" - -FULL_BUILD="${FULL_BUILD:-false}" -if [ -n "${TEAMCITY_VERSION:-}" -o -n "${APPVEYOR:-}" ]; then - FULL_BUILD="true" -fi - -[ -d "$BUILD_DIR/bulid" ] && rm -rf "$BUILD_DIR/build" -[ -d "$BUILD_DIR/dist" ] && rm -rf "$BUILD_DIR/dist" - -if [ "$FULL_BUILD" == "true" ]; then - # install dependencies - $BUILD_DIR/prebuild.sh - - VENV="$BUILD_DIR/venv" - if [ -d "$VENV" ]; then - rm -rf "$VENV" - fi - virtualenv "$VENV" - set +u - source "$VENV/bin/activate" - set -u - - # must set build before installing lbrynet. otherwise it has no effect - python "$BUILD_DIR/set_build.py" -fi - -cp "$ROOT/requirements.txt" "$BUILD_DIR/requirements_base.txt" -( - cd "$BUILD_DIR" - pip install -r requirements.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" - -if [ "$FULL_BUILD" == "true" ]; then - # electron-build has a publish feature, but I had a hard time getting - # it to reliably work and it also seemed difficult to configure. Not proud of - # this, but it seemed better to write my own. - python "$BUILD_DIR/upload_assets.py" - - deactivate -fi - -echo 'Build complete.' diff --git a/build/cli.onefile.spec b/build/cli.onefile.spec deleted file mode 100644 index 58ed11b60..000000000 --- a/build/cli.onefile.spec +++ /dev/null @@ -1,42 +0,0 @@ -# -*- mode: python -*- -import platform -import os - -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 - - -a = Entrypoint('lbrynet', 'console_scripts', 'lbrynet-cli', pathex=[cwd]) - -pyz = PYZ(a.pure, a.zipped_data) - -exe = EXE( - pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - name='lbrynet-cli', - debug=False, - strip=False, - upx=True, - console=True, - icon=icns -) diff --git a/build/console.onefile.spec b/build/console.onefile.spec deleted file mode 100644 index 420bf5043..000000000 --- a/build/console.onefile.spec +++ /dev/null @@ -1,50 +0,0 @@ -# -*- 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/daemon.onefile.spec b/build/daemon.onefile.spec deleted file mode 100644 index fa35021b7..000000000 --- a/build/daemon.onefile.spec +++ /dev/null @@ -1,50 +0,0 @@ -# -*- 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-daemon', pathex=[cwd], datas=datas) - -pyz = PYZ(a.pure, a.zipped_data) - -exe = EXE( - pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - name='lbrynet-daemon', - debug=False, - strip=False, - upx=True, - console=True, - icon=icns -) diff --git a/build/entrypoint.py b/build/entrypoint.py deleted file mode 100644 index 229005010..000000000 --- a/build/entrypoint.py +++ /dev/null @@ -1,47 +0,0 @@ -# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Setuptools-Entry-Point -def Entrypoint(dist, group, name, - scripts=None, pathex=None, binaries=None, datas=None, - hiddenimports=None, hookspath=None, excludes=None, runtime_hooks=None, - cipher=None, win_no_prefer_redirects=False, win_private_assemblies=False): - import pkg_resources - - # get toplevel packages of distribution from metadata - def get_toplevel(dist): - distribution = pkg_resources.get_distribution(dist) - if distribution.has_metadata('top_level.txt'): - return list(distribution.get_metadata('top_level.txt').split()) - else: - return [] - - hiddenimports = hiddenimports or [] - packages = [] - for distribution in hiddenimports: - packages += get_toplevel(distribution) - - scripts = scripts or [] - pathex = pathex or [] - # get the entry point - ep = pkg_resources.get_entry_info(dist, group, name) - # insert path of the egg at the verify front of the search path - pathex = [ep.dist.location] + pathex - # script name must not be a valid module name to avoid name clashes on import - script_path = os.path.join(workpath, name + '-script.py') - print "creating script for entry point", dist, group, name - with open(script_path, 'w') as fh: - fh.write("import {0}\n".format(ep.module_name)) - fh.write("{0}.{1}()\n".format(ep.module_name, '.'.join(ep.attrs))) - for package in packages: - fh.write("import {0}\n".format(package)) - - return Analysis([script_path] + scripts, - pathex=pathex, - binaries=binaries, - datas=datas, - hiddenimports=hiddenimports, - hookspath=hookspath, - excludes=excludes, - runtime_hooks=runtime_hooks, - cipher=cipher, - win_no_prefer_redirects=win_no_prefer_redirects, - win_private_assemblies=win_private_assemblies - ) diff --git a/build/lbry2.pfx.enc b/build/lbry2.pfx.enc deleted file mode 100644 index 46e52260a..000000000 Binary files a/build/lbry2.pfx.enc and /dev/null differ diff --git a/build/miniupnpc-1.9.tar.gz b/build/miniupnpc-1.9.tar.gz deleted file mode 100644 index 85deda499..000000000 Binary files a/build/miniupnpc-1.9.tar.gz and /dev/null differ diff --git a/build/prebuild.sh b/build/prebuild.sh deleted file mode 100755 index 17bc41374..000000000 --- a/build/prebuild.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -set -euo pipefail -set -x - - -LINUX=false -OSX=false - -if [ "$(uname)" == "Darwin" ]; then - OSX=true -elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - LINUX=true -else - echo "Platform detection failed" - exit 1 -fi - - -SUDO='' -if $LINUX && (( $EUID != 0 )); then - SUDO='sudo' -fi - -cmd_exists() { - command -v "$1" >/dev/null 2>&1 - return $? -} - -set +eu -GITUSERNAME=$(git config --global --get user.name) -if [ -z "$GITUSERNAME" ]; then - git config --global user.name "$(whoami)" -fi -GITEMAIL=$(git config --global --get user.email) -if [ -z "$GITEMAIL" ]; then - git config --global user.email "$(whoami)@lbry.io" -fi -set -eu - - -if $LINUX; then - INSTALL="$SUDO apt-get install --no-install-recommends -y" - $INSTALL build-essential libssl-dev libffi-dev python2.7-dev wget -elif $OSX && ! cmd_exists brew ; then - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -fi - - -if ! cmd_exists python; then - if $LINUX; then - $INSTALL python2.7 - elif $OSX; then - brew install python - curl https://bootstrap.pypa.io/get-pip.py | python - fi -fi - -PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') -if [ "$PYTHON_VERSION" != "2.7" ]; then - echo "Python 2.7 required" - exit 1 -fi - -if ! cmd_exists pip; then - if $LINUX; then - $INSTALL python-pip - $SUDO pip install --upgrade pip - else - echo "Pip required" - exit 1 - fi -fi - -if $LINUX && [ "$(pip list --format=columns | grep setuptools | wc -l)" -ge 1 ]; then - #$INSTALL python-setuptools - $SUDO pip install setuptools -fi - -if ! cmd_exists virtualenv; then - $SUDO pip install virtualenv -fi diff --git a/build/requirements.txt b/build/requirements.txt deleted file mode 100644 index 917509772..000000000 --- a/build/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -# install daemon requirements (created by build script. see build.sh, build.ps1) --r requirements_base.txt - -# install daemon itself. make sure you run `pip install` from this dir. this is how you do relative file paths with pip -file:../. - -# install other build requirements -PyInstaller==3.2.1 -requests[security]==2.13.0 -uritemplate==3.0.0 -boto3==1.4.4 diff --git a/build/set_build.py b/build/set_build.py deleted file mode 100644 index 39fe12d09..000000000 --- a/build/set_build.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Set the build version to be 'dev', 'qa', 'rc', 'release'""" - -import os.path -import re -import subprocess -import sys - - -def main(): - build = get_build() - root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - with open(os.path.join(root_dir, 'lbrynet', 'build_type.py'), 'w') as f: - f.write("BUILD = '{}'\n".format(build)) - - -def get_build(): - try: - tag = subprocess.check_output(['git', 'describe', '--exact-match']).strip() - if re.match('v\d+\.\d+\.\d+rc\d+', tag): - return 'rc' - else: - return 'release' - except subprocess.CalledProcessError: - # if the build doesn't have a tag - return 'qa' - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/zip_daemon.py b/build/zip_daemon.py deleted file mode 100644 index 53c60085b..000000000 --- a/build/zip_daemon.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import platform -import subprocess -import sys -import zipfile - - -def main(): - this_dir = os.path.dirname(os.path.realpath(__file__)) - 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', 'lbrynet-console'] - ext = '.exe' if platform.system() == 'Windows' else '' - with zipfile.ZipFile(full_filename, 'w') as myzip: - for executable in executables: - myzip.write(os.path.join(this_dir, 'dist', executable + ext), executable + ext) - - -def get_system_label(): - system = platform.system() - if system == 'Darwin': - return 'macos' - else: - return system.lower() - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/build/icons/128x128.png b/icons/128x128.png similarity index 100% rename from build/icons/128x128.png rename to icons/128x128.png diff --git a/build/icons/256x256.png b/icons/256x256.png similarity index 100% rename from build/icons/256x256.png rename to icons/256x256.png diff --git a/build/icons/32x32.png b/icons/32x32.png similarity index 100% rename from build/icons/32x32.png rename to icons/32x32.png diff --git a/build/icons/48x48.png b/icons/48x48.png similarity index 100% rename from build/icons/48x48.png rename to icons/48x48.png diff --git a/build/icons/96x96.png b/icons/96x96.png similarity index 100% rename from build/icons/96x96.png rename to icons/96x96.png diff --git a/build/icons/lbry128.ico b/icons/lbry128.ico similarity index 100% rename from build/icons/lbry128.ico rename to icons/lbry128.ico diff --git a/build/icons/lbry16.ico b/icons/lbry16.ico similarity index 100% rename from build/icons/lbry16.ico rename to icons/lbry16.ico diff --git a/build/icons/lbry256.ico b/icons/lbry256.ico similarity index 100% rename from build/icons/lbry256.ico rename to icons/lbry256.ico diff --git a/build/icons/lbry32.ico b/icons/lbry32.ico similarity index 100% rename from build/icons/lbry32.ico rename to icons/lbry32.ico diff --git a/build/icons/lbry48.ico b/icons/lbry48.ico similarity index 100% rename from build/icons/lbry48.ico rename to icons/lbry48.ico diff --git a/build/icons/lbry96.ico b/icons/lbry96.ico similarity index 100% rename from build/icons/lbry96.ico rename to icons/lbry96.ico