2016-01-26 17:56:28 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
To create local builds and distributable .msi, run the following command:
|
|
|
|
python setup_win32.py build bdist_msi
|
|
|
|
"""
|
2016-08-16 01:19:26 +02:00
|
|
|
import opcode
|
2016-01-26 17:56:28 +01:00
|
|
|
import os
|
2016-08-16 01:19:26 +02:00
|
|
|
import pkg_resources
|
2016-01-26 17:56:28 +01:00
|
|
|
import sys
|
|
|
|
|
|
|
|
from cx_Freeze import setup, Executable
|
2016-02-28 18:45:21 +01:00
|
|
|
import requests.certs
|
2016-01-26 17:56:28 +01:00
|
|
|
|
2016-07-31 04:54:51 +02:00
|
|
|
from lbrynet import __version__
|
|
|
|
|
2016-08-16 01:19:26 +02:00
|
|
|
wordlist_path = pkg_resources.resource_filename('lbryum', 'wordlist')
|
2016-08-16 01:40:32 +02:00
|
|
|
|
2016-07-31 04:54:51 +02:00
|
|
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
2016-08-16 01:19:26 +02:00
|
|
|
# Allow virtualenv to find distutils of base python installation
|
|
|
|
distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils')
|
|
|
|
|
|
|
|
|
2016-01-26 17:56:28 +01:00
|
|
|
def find_data_file(filename):
|
|
|
|
if getattr(sys, 'frozen', False):
|
|
|
|
# The application is frozen
|
|
|
|
data_dir = os.path.dirname(sys.executable)
|
|
|
|
else:
|
|
|
|
# The application is not frozen
|
|
|
|
# Change this bit to match where you store your data files:
|
|
|
|
data_dir = os.path.dirname(__file__)
|
|
|
|
return os.path.join(data_dir, filename)
|
|
|
|
|
2016-07-31 04:54:51 +02:00
|
|
|
console_scripts = ['lbrynet-stdin-uploader = lbrynet.lbrynet_console.LBRYStdinUploader:launch_stdin_uploader',
|
|
|
|
'lbrynet-stdout-downloader = lbrynet.lbrynet_console.LBRYStdoutDownloader:launch_stdout_downloader',
|
|
|
|
'lbrynet-create-network = lbrynet.create_network:main',
|
|
|
|
'lbrynet-launch-node = lbrynet.dht.node:main',
|
|
|
|
'lbrynet-launch-rpc-node = lbrynet.rpc_node:main',
|
|
|
|
'lbrynet-rpc-node-cli = lbrynet.node_rpc_cli:main',
|
|
|
|
'lbrynet-lookup-hosts-for-hash = lbrynet.dht_scripts:get_hosts_for_hash_in_dht',
|
|
|
|
'lbrynet-announce_hash_to_dht = lbrynet.dht_scripts:announce_hash_to_dht',
|
|
|
|
'lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:start',
|
|
|
|
'stop-lbrynet-daemon = lbrynet.lbrynet_daemon.LBRYDaemonControl:stop',
|
|
|
|
'lbrynet-cli = lbrynet.lbrynet_daemon.LBRYDaemonCLI:main']
|
|
|
|
|
2016-01-26 17:56:28 +01:00
|
|
|
shortcut_table = [
|
|
|
|
('DesktopShortcut', # Shortcut
|
|
|
|
'DesktopFolder', # Directory
|
2016-07-31 04:54:51 +02:00
|
|
|
'lbrynet', # Name
|
2016-01-26 17:56:28 +01:00
|
|
|
'TARGETDIR', # Component
|
2016-07-31 04:54:51 +02:00
|
|
|
'[TARGETDIR]\lbrynet.exe', # Target
|
2016-01-26 17:56:28 +01:00
|
|
|
None, # Arguments
|
|
|
|
None, # Description
|
|
|
|
None, # Hotkey
|
2016-07-31 04:54:51 +02:00
|
|
|
os.path.join('lbry-dark-icon.ico'), # Icon
|
2016-01-26 17:56:28 +01:00
|
|
|
None, # IconIndex
|
|
|
|
None, # ShowCmd
|
|
|
|
'TARGETDIR', # WkDir
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
# Now create the table dictionary
|
|
|
|
msi_data = {'Shortcut': shortcut_table}
|
|
|
|
|
|
|
|
bdist_msi_options = {
|
2016-07-31 04:54:51 +02:00
|
|
|
# 'upgrade_code': '{66620F3A-DC3A-11E2-B341-002219E9B01F}',
|
2016-01-26 17:56:28 +01:00
|
|
|
'add_to_path': False,
|
2016-07-31 04:54:51 +02:00
|
|
|
'initial_target_dir': r'[LocalAppDataFolder]\lbrynet',
|
2016-01-26 17:56:28 +01:00
|
|
|
'data': msi_data,
|
|
|
|
}
|
|
|
|
|
|
|
|
build_exe_options = {
|
|
|
|
'include_msvcr': True,
|
|
|
|
'includes': [],
|
2016-08-16 01:19:26 +02:00
|
|
|
'packages': ['cython',
|
|
|
|
'twisted',
|
|
|
|
'yapsy',
|
|
|
|
'appdirs',
|
|
|
|
'argparse',
|
|
|
|
'base58',
|
|
|
|
'colorama',
|
|
|
|
'cx_Freeze',
|
|
|
|
'dns',
|
|
|
|
'ecdsa',
|
|
|
|
'gmpy',
|
|
|
|
'googlefinance',
|
|
|
|
'jsonrpc',
|
|
|
|
'jsonrpclib',
|
|
|
|
'lbryum',
|
2016-08-16 02:48:27 +02:00
|
|
|
'loggly',
|
2016-08-16 01:19:26 +02:00
|
|
|
'miniupnpc',
|
|
|
|
'pbkdf2',
|
|
|
|
'google.protobuf',
|
|
|
|
'Crypto',
|
|
|
|
'bitcoinrpc',
|
|
|
|
'win32api',
|
|
|
|
'qrcode',
|
|
|
|
'requests',
|
2016-08-16 02:48:27 +02:00
|
|
|
'requests_futures',
|
2016-08-16 01:19:26 +02:00
|
|
|
'seccure',
|
|
|
|
'simplejson',
|
|
|
|
'six',
|
|
|
|
'aes',
|
|
|
|
'txjsonrpc',
|
|
|
|
'unqlite',
|
|
|
|
'wsgiref',
|
|
|
|
'zope.interface',
|
|
|
|
'os',
|
|
|
|
'pkg_resources'
|
2016-07-31 04:54:51 +02:00
|
|
|
],
|
2016-08-16 01:19:26 +02:00
|
|
|
'excludes': ['distutils', 'collections.sys', 'collections._weakref', 'collections.abc',
|
2016-08-16 05:09:46 +02:00
|
|
|
'Tkinter', 'tk', 'tcl', 'PyQt4', 'nose', 'mock'
|
2016-08-16 01:19:26 +02:00
|
|
|
'zope.interface._zope_interface_coptimizations'],
|
|
|
|
'include_files': [(distutils_path, 'distutils'), (requests.certs.where(), 'cacert.pem'),
|
|
|
|
(os.path.join(wordlist_path, 'chinese_simplified.txt'), os.path.join('wordlist', 'chinese_simplified.txt')),
|
|
|
|
(os.path.join(wordlist_path, 'english.txt'), os.path.join('wordlist', 'english.txt')),
|
|
|
|
(os.path.join(wordlist_path, 'japanese.txt'), os.path.join('wordlist', 'japanese.txt')),
|
|
|
|
(os.path.join(wordlist_path, 'portuguese.txt'), os.path.join('wordlist', 'portuguese.txt')),
|
|
|
|
(os.path.join(wordlist_path, 'spanish.txt'), os.path.join('wordlist', 'spanish.txt'))
|
|
|
|
],
|
2016-08-16 05:09:46 +02:00
|
|
|
'namespace_packages': ['zope', 'google']}
|
2016-01-26 17:56:28 +01:00
|
|
|
|
|
|
|
exe = Executable(
|
2016-07-31 04:54:51 +02:00
|
|
|
script=os.path.join('lbrynet', 'lbrynet_daemon', 'LBRYDaemonControl.py'),
|
|
|
|
# base='Win32GUI',
|
|
|
|
icon=os.path.join('packaging', 'windows', 'icons', 'lbry256.ico'),
|
2016-01-26 17:56:28 +01:00
|
|
|
compress=True,
|
2016-07-31 04:54:51 +02:00
|
|
|
shortcutName='lbrynet',
|
2016-01-26 17:56:28 +01:00
|
|
|
shortcutDir='DesktopFolder',
|
2016-07-31 04:54:51 +02:00
|
|
|
targetName='lbrynet.exe'
|
2016-01-26 17:56:28 +01:00
|
|
|
# targetDir="LocalAppDataFolder"
|
|
|
|
)
|
|
|
|
|
|
|
|
setup(
|
2016-07-31 04:54:51 +02:00
|
|
|
name='lbrynet',
|
|
|
|
version=__version__,
|
|
|
|
description='A decentralized media library and marketplace',
|
2016-01-26 17:56:28 +01:00
|
|
|
url='lbry.io',
|
|
|
|
author='',
|
|
|
|
keywords='LBRY',
|
2016-07-31 04:54:51 +02:00
|
|
|
data_files=[
|
|
|
|
('lbrynet/lbrynet_console/plugins',
|
|
|
|
[
|
|
|
|
os.path.join(base_dir, 'lbrynet', 'lbrynet_console', 'plugins',
|
|
|
|
'blindrepeater.yapsy-plugin')
|
|
|
|
]
|
|
|
|
),
|
|
|
|
],
|
2016-01-26 17:56:28 +01:00
|
|
|
options={'build_exe': build_exe_options,
|
|
|
|
'bdist_msi': bdist_msi_options},
|
|
|
|
executables=[exe],
|
|
|
|
)
|