Build on Appveyor #1

Merged
jobevers merged 3 commits from appveyor into master 2017-02-15 20:11:49 +01:00
21 changed files with 171 additions and 93 deletions

4
.gitignore vendored
View file

@ -3,3 +3,7 @@ app/node_modules
node_modules node_modules
LBRY-darwin-x64 LBRY-darwin-x64
dist dist
lbrynet/build
lbrynet/venv
.#*
build_venv

View file

@ -1,6 +1,12 @@
const {app, BrowserWindow} = require('electron') const {app, BrowserWindow} = require('electron');
var path = require('path');
var jayson = require('jayson'); var jayson = require('jayson');
var client = jayson.client.http('http://localhost:5279/lbryapi'); // tree-kill has better cross-platform handling of
// killing a process. child-process.kill was unreliable
var kill = require('tree-kill');
let client = jayson.client.http('http://localhost:5279/lbryapi');
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
@ -35,8 +41,14 @@ function lauchDaemon() {
if (subpy) { if (subpy) {
return; return;
} }
console.log(`${__dirname}/dist/lbry`); console.log(`${__dirname}`);
subpy = require('child_process').spawn(`${__dirname}/dist/lbry`, ['--verbose'], {stdio: ['ignore', process.stdout, process.stderr]}) executable = path.join(__dirname, 'dist', 'lbrynet-daemon');
subpy = require('child_process').spawn(executable, ['--verbose'])//, {stdio: ['ignore', process.stdout, process.stderr]});
// Need to handle the data event instead of attaching to
// process.stdout because the latter doesn't work. I believe on
// windows it buffers stdout and we don't get any meaningful output
subpy.stdout.on('data', (buf) => {console.log(String(buf).trim());});
subpy.stderr.on('data', (buf) => {console.log(String(buf).trim());});
subpy.on('exit', () => { subpy.on('exit', () => {
console.log('The daemon has exited. Quitting the app'); console.log('The daemon has exited. Quitting the app');
subpy = null; subpy = null;
@ -89,7 +101,10 @@ app.on('before-quit', (event) => {
win.loadURL(`file://${__dirname}/dist/quit.html`); win.loadURL(`file://${__dirname}/dist/quit.html`);
} }
quitting = true; quitting = true;
subpy.kill('SIGINT'); console.log('Killing lbrynet-daemon process');
kill(subpy.pid, undefined, (err) => {
console.log('Killed lbrynet-daemon process');
});
} }
}) })

View file

@ -8,6 +8,9 @@
"name": "Job Evers-Meltzer" "name": "Job Evers-Meltzer"
}, },
"dependencies": { "dependencies": {
"jayson": "^2.0.2" "install": "^0.8.7",
"jayson": "^2.0.2",
"npm": "^4.2.0",
"tree-kill": "^1.1.0"
} }
} }

44
appveyor.yml Normal file
View file

@ -0,0 +1,44 @@
# Test against the latest version of this Node.js version
environment:
nodejs_version: "6"
skip_branch_with_pr: true
clone_folder: C:\projects\lbry-electron
# Install scripts. (runs after repo cloning)
install:
# needed to deal with submodules
- git submodule update --init --recursive
- python set-version.py
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
# install modules
- npm install
- cd app
- npm install
- cd ..
# create lbrynet-daemon executable
- cd lbrynet
- ps: .\build.ps1
- cd ..
# build ui
- cd lbry-web-ui
- npm install
- node_modules\.bin\node-sass --output dist\css --sourcemap=none scss\
- node_modules\.bin\webpack
- ps: Copy-Item dist ..\app\ -recurse
- cd ..
- ps: Copy-Item lbrynet\dist\lbrynet-daemon.exe app\dist
build_script:
# build electron app
- node_modules\.bin\build -p never
# for debugging, see what was built
- dir dist
test: off
artifacts:
- path: dist\*.zip
name: LBRY

View file

@ -10,8 +10,14 @@ else
ICON="$ROOT/build/icons/lbry48.png" ICON="$ROOT/build/icons/lbry48.png"
fi fi
FULL_BUILD="${FULL_BUILD:-false}"
if [ -n "${TEAMCITY_VERSION:-}" ]; then if [ -n "${TEAMCITY_VERSION:-}" ]; then
FULL_BUILD="true"
elif [ -n "${APPVEYOR:-}" ]; then
FULL_BUILD="true"
fi
if [ "$FULL_BUILD" == "true" ]; then
# install dependencies # install dependencies
$ROOT/prebuild.sh $ROOT/prebuild.sh
@ -56,10 +62,10 @@ popd
cp -r dist "$ROOT/app/dist" cp -r dist "$ROOT/app/dist"
) )
mv "$ROOT/lbrynet/dist/lbry" "$ROOT/app/dist" mv "$ROOT/lbrynet/dist/lbrynet-daemon" "$ROOT/app/dist"
if [ -n "${TEAMCITY_VERSION:-}" ]; then if [ "$FULL_BUILD" == "true" ]; then
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" == "Darwin" ]; then
security unlock-keychain -p ${KEYCHAIN_PASSWORD} osx-build.keychain security unlock-keychain -p ${KEYCHAIN_PASSWORD} osx-build.keychain
fi fi
@ -71,7 +77,7 @@ else
echo 'Build complete. Run `./node_modules/.bin/electron app` to launch the app' echo 'Build complete. Run `./node_modules/.bin/electron app` to launch the app'
fi fi
if [ -n "${TEAMCITY_VERSION:-}" ]; then if [ "$FULL_BUILD" == "true" ]; then
# electron-build has a publish feature, but I had a hard time getting # 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 # it to reliably work and it also seemed difficult to configure. Not proud of
# this, but it seemed better to write my own. # this, but it seemed better to write my own.

BIN
build/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
build/icons/lbry128.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

BIN
build/icons/lbry16.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
build/icons/lbry256.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
build/icons/lbry32.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
build/icons/lbry48.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
build/icons/lbry96.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

2
lbry

@ -1 +1 @@
Subproject commit 07233a885225c76f826f2b6f44e852fc3cbfa9db Subproject commit bd2520ad6c1c4288a0977646a9a995ac6322a900

@ -1 +1 @@
Subproject commit 06f226d57b839c2cbca8dacac4a418dd7bcfe192 Subproject commit 4068fb5fd8bfec035daff83b518e3a5d99344dda

24
lbrynet/build.ps1 Normal file
View file

@ -0,0 +1,24 @@
$env:Path += ";C:\MinGW\bin\"
$env:Path += ";C:\Program Files (x86)\Windows Kits\10\bin\x86\"
gcc --version
mingw32-make --version
mkdir temp
Invoke-WebRequest "https://pypi.python.org/packages/55/90/e987e28ed29b571f315afea7d317b6bf4a551e37386b344190cffec60e72/miniupnpc-1.9.tar.gz" -OutFile "temp\miniupnpc-1.9.tar.gz"
cd temp
tar zxf miniupnpc-1.9.tar.gz
cd miniupnpc-1.9
mingw32-make.exe -f Makefile.mingw
python.exe setupmingw32.py build --compiler=mingw32
python.exe setupmingw32.py install
cd ..\..\
Remove-Item -Recurse -Force temp
pip.exe install -r windows-requirements.txt
pip.exe install ..\lbryum
pip.exe install ..\lbry
pip.exe install pyinstaller
pyinstaller -y lbry.onefile.spec

View file

@ -4,34 +4,48 @@ import os
import lbryum import lbryum
cwd = os.getcwd() cwd = os.getcwd()
if os.path.basename(cwd) != 'lbrynet': if os.path.basename(cwd) != 'lbrynet':
raise Exception('The build needs to be run from the same directory as the spec file') raise Exception('The build needs to be run from the same directory as the spec file')
repo_base = os.path.abspath(os.path.join(cwd, '..')) repo_base = os.path.abspath(os.path.join(cwd, '..'))
jobevers commented 2017-02-14 23:54:26 +01:00 (Migrated from github.com)
Review

can remote this too

can remote this too
system = platform.system() system = platform.system()
if system == 'Darwin': if system == 'Darwin':
icns = os.path.join(repo_base, 'build', 'icon.icns') 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: else:
icns = os.path.join(repo_base, 'package', 'icons', '256x256.png') print 'Warning: System {} has no icons'.format(system)
icns = None
block_cipher = None block_cipher = None
languages = ( languages = (
'chinese_simplified.txt', 'japanese.txt', 'spanish.txt', 'chinese_simplified.txt', 'japanese.txt', 'spanish.txt',
'english.txt', 'portuguese.txt' 'english.txt', 'portuguese.txt'
) )
a = Analysis(
['lbry.py'], datas = [
pathex=[cwd],
binaries=None,
datas=[
( (
os.path.join(os.path.dirname(lbryum.__file__), 'wordlist', language), os.path.join(os.path.dirname(lbryum.__file__), 'wordlist', language),
'lbryum/wordlist' 'lbryum/wordlist'
) )
for language in languages for language in languages
], ]
a = Analysis(
['lbry.py'],
pathex=[cwd],
binaries=None,
datas=datas,
hiddenimports=[], hiddenimports=[],
hookspath=[], hookspath=[],
runtime_hooks=[], runtime_hooks=[],
@ -41,28 +55,23 @@ a = Analysis(
cipher=block_cipher cipher=block_cipher
) )
pyz = PYZ( pyz = PYZ(
a.pure, a.zipped_data, a.pure, a.zipped_data,
cipher=block_cipher cipher=block_cipher
) )
exe = EXE( exe = EXE(
pyz, pyz,
a.scripts, a.scripts,
a.binaries, a.binaries,
a.zipfiles, a.zipfiles,
a.datas, a.datas,
name='lbry', name='lbrynet-daemon',
debug=False, debug=False,
strip=False, strip=False,
upx=True, upx=True,
console=False, console=True,
icon=icns icon=icns
) )
app = BUNDLE(
exe,
name='lbry.app',
icon=icns,
bundle_identifier=None
)

View file

@ -1,4 +1,5 @@
jobevers commented 2017-02-14 23:54:41 +01:00 (Migrated from github.com)
Review

these lines should go

these lines should go
jobevers commented 2017-02-14 23:54:41 +01:00 (Migrated from github.com)
Review

these lines should go

these lines should go
from lbrynet.lbrynet_daemon import DaemonControl from lbrynet.lbrynet_daemon import DaemonControl
jobevers commented 2017-02-14 23:54:41 +01:00 (Migrated from github.com)
Review

these lines should go

these lines should go
if __name__ == '__main__': if __name__ == '__main__':
DaemonControl.start() DaemonControl.start()

jobevers commented 2017-02-14 23:54:41 +01:00 (Migrated from github.com)
Review

these lines should go

these lines should go
jobevers commented 2017-02-14 23:54:41 +01:00 (Migrated from github.com)
Review

these lines should go

these lines should go

View file

@ -1,61 +0,0 @@
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
# -*- mode: python -*-
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
import lbryum
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
block_cipher = None
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
languages = (
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
'chinese_simplified.txt', 'japanese.txt', 'spanish.txt',
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
'english.txt', 'portuguese.txt'
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a = Analysis(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
['lbry.py'],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
pathex=['/Users/jobevers/projects/lbryio/lbry-electron/lbrynet'],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
binaries=None,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
# Not sure why these files are not already include as they are
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
# listed in package_data and the MANIFEST.in, but they don't seem
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
# to make it in unless we explicitly add them here
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
datas=[
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
os.path.join(os.path.dirname(lbryum.__file__), 'wordlist', language),
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
'lbryum/wordlist'
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
for language in languages
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
hiddenimports=[],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
hookspath=[],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
runtime_hooks=[],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
excludes=['win32com'],
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
win_no_prefer_redirects=False,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
win_private_assemblies=False,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
cipher=block_cipher
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
pyz = PYZ(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a.pure, a.zipped_data,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
cipher=block_cipher
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
exe = EXE(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
pyz,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a.scripts,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
exclude_binaries=True,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
name='lbry',
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
debug=False,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
strip=False,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
upx=True,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
console=True,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
coll = COLLECT(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
exe,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a.binaries,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a.zipfiles,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
a.datas,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
strip=False,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
upx=True,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
name='lbry'
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
app = BUNDLE(
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
coll,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
name='lbry.app',
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
icon=None,
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
bundle_identifier=None
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go
)
jobevers commented 2017-02-14 23:55:06 +01:00 (Migrated from github.com)
Review

this whole file can go

this whole file can go

View file

@ -0,0 +1,30 @@
pypiwin32==219
six==1.10.0
requests[security]==2.13.0
zope.interface==4.3.3
Twisted==16.6.0
appdirs==1.4.0
argparse==1.2.1
colorama==0.3.7
dnspython==1.12.0
ecdsa==0.13
envparse==0.2.0
jsonrpc==1.2
jsonrpclib==0.1.7
loggly-python-handler==1.0.0
pbkdf2==1.3
protobuf==3.0.0
pycrypto==2.6.1
python-bitcoinrpc==0.1
pyyaml==3.12
qrcode==5.2.2
requests_futures==0.9.7
seccure==0.3.1.3
simplejson==3.8.2
slowaes==0.1a1
txJSON-RPC==0.5
wsgiref==0.1.2
base58==0.2.2
googlefinance==0.7
jsonschema==2.5.1
https://github.com/lbryio/lbry/raw/master/packaging/windows/libs/gmpy-1.17-cp27-none-win32.whl

2
lbryum

@ -1 +1 @@
Subproject commit bd370d353069ef02566c9082fe876e4924861e68 Subproject commit 49253b6614a9186b4f2ee53bddd60db7d3ab5f9b

View file

@ -34,6 +34,9 @@
}, },
"linux": { "linux": {
"target": "deb" "target": "deb"
},
"win": {
"target": "zip"
jobevers commented 2017-02-14 23:55:54 +01:00 (Migrated from github.com)
Review

nsis was giving an error for me, unfortunately - should dig into that soonish, but zip works so lets get it out.

nsis was giving an error for me, unfortunately - should dig into that soonish, but zip works so lets get it out.
} }
}, },
"devDependencies": { "devDependencies": {