2017-02-28 14:51:49 +01:00
|
|
|
#!/usr/bin/env python2.7
|
|
|
|
|
2017-02-24 16:49:53 +01:00
|
|
|
import os
|
2017-03-24 12:51:46 +01:00
|
|
|
import shutil
|
2018-05-18 16:56:47 +02:00
|
|
|
|
2017-09-21 13:43:01 +02:00
|
|
|
from setuptools import setup, Extension
|
|
|
|
from setuptools.command.install import install
|
2017-02-24 16:49:53 +01:00
|
|
|
|
|
|
|
from src.version import softwareVersion
|
|
|
|
|
2018-05-18 16:56:47 +02:00
|
|
|
|
|
|
|
EXTRAS_REQUIRE = {
|
|
|
|
'gir': ['pygobject'],
|
|
|
|
'notify2': ['notify2'],
|
2018-06-25 09:50:32 +02:00
|
|
|
'pyopencl': ['numpy', 'pyopencl'],
|
2018-05-18 16:56:47 +02:00
|
|
|
'prctl': ['python_prctl'], # Named threads
|
|
|
|
'qrcode': ['qrcode'],
|
|
|
|
'sound;platform_system=="Windows"': ['winsound']
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-25 10:48:45 +01:00
|
|
|
class InstallCmd(install):
|
|
|
|
def run(self):
|
2017-03-24 12:51:46 +01:00
|
|
|
# prepare icons directories
|
2017-09-21 19:57:34 +02:00
|
|
|
try:
|
|
|
|
os.makedirs('desktop/icons/scalable')
|
|
|
|
except os.error:
|
|
|
|
pass
|
2017-03-24 12:51:46 +01:00
|
|
|
shutil.copyfile(
|
|
|
|
'desktop/can-icon.svg', 'desktop/icons/scalable/pybitmessage.svg')
|
2017-09-21 19:57:34 +02:00
|
|
|
try:
|
|
|
|
os.makedirs('desktop/icons/24x24')
|
|
|
|
except os.error:
|
|
|
|
pass
|
2017-03-24 12:51:46 +01:00
|
|
|
shutil.copyfile(
|
|
|
|
'desktop/icon24.png', 'desktop/icons/24x24/pybitmessage.png')
|
|
|
|
|
2017-03-25 10:48:45 +01:00
|
|
|
return install.run(self)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2017-02-24 16:49:53 +01:00
|
|
|
here = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
with open(os.path.join(here, 'README.md')) as f:
|
|
|
|
README = f.read()
|
|
|
|
|
2017-02-28 14:51:49 +01:00
|
|
|
bitmsghash = Extension(
|
|
|
|
'pybitmessage.bitmsghash.bitmsghash',
|
|
|
|
sources=['src/bitmsghash/bitmsghash.cpp'],
|
|
|
|
libraries=['pthread', 'crypto'],
|
2017-02-24 16:49:53 +01:00
|
|
|
)
|
|
|
|
|
2017-03-17 19:25:19 +01:00
|
|
|
installRequires = []
|
2017-06-12 12:54:44 +02:00
|
|
|
packages = [
|
|
|
|
'pybitmessage',
|
|
|
|
'pybitmessage.bitmessageqt',
|
|
|
|
'pybitmessage.bitmessagecurses',
|
|
|
|
'pybitmessage.messagetypes',
|
|
|
|
'pybitmessage.network',
|
|
|
|
'pybitmessage.pyelliptic',
|
|
|
|
'pybitmessage.socks',
|
|
|
|
'pybitmessage.storage',
|
2018-06-23 17:54:32 +02:00
|
|
|
'pybitmessage.plugins',
|
|
|
|
'pybitmessage.workprover'
|
2017-06-12 12:54:44 +02:00
|
|
|
]
|
2017-09-21 13:43:01 +02:00
|
|
|
|
2017-06-12 12:54:44 +02:00
|
|
|
# this will silently accept alternative providers of msgpack
|
|
|
|
# if they are already installed
|
2017-03-17 19:25:19 +01:00
|
|
|
|
2017-03-01 11:29:38 +01:00
|
|
|
try:
|
2017-09-21 13:43:01 +02:00
|
|
|
import msgpack
|
|
|
|
installRequires.append("msgpack-python")
|
|
|
|
except ImportError:
|
|
|
|
try:
|
|
|
|
import umsgpack
|
|
|
|
installRequires.append("umsgpack")
|
|
|
|
except ImportError:
|
|
|
|
packages += ['pybitmessage.fallback', 'pybitmessage.fallback.umsgpack']
|
|
|
|
|
|
|
|
dist = setup(
|
|
|
|
name='pybitmessage',
|
|
|
|
version=softwareVersion,
|
|
|
|
description="Reference client for Bitmessage: "
|
|
|
|
"a P2P communications protocol",
|
|
|
|
long_description=README,
|
|
|
|
license='MIT',
|
|
|
|
# TODO: add author info
|
|
|
|
#author='',
|
|
|
|
#author_email='',
|
|
|
|
url='https://bitmessage.org',
|
|
|
|
# TODO: add keywords
|
|
|
|
#keywords='',
|
|
|
|
install_requires=installRequires,
|
2018-05-18 16:56:47 +02:00
|
|
|
extras_require=EXTRAS_REQUIRE,
|
2017-09-21 13:43:01 +02:00
|
|
|
classifiers=[
|
|
|
|
"License :: OSI Approved :: MIT License"
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
"Programming Language :: Python :: 2.7 :: Only",
|
|
|
|
"Topic :: Internet",
|
|
|
|
"Topic :: Security :: Cryptography",
|
|
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
|
|
],
|
|
|
|
package_dir={'pybitmessage': 'src'},
|
|
|
|
packages=packages,
|
|
|
|
package_data={'': [
|
2018-06-25 09:50:32 +02:00
|
|
|
'bitmessageqt/*.ui', 'translations/*.ts', 'translations/*.qm',
|
|
|
|
'bitmsghash/*.cl', 'workprover/*.cl', 'workprover/fastsolver/*',
|
|
|
|
'sslkeys/*.pem',
|
2017-09-21 13:43:01 +02:00
|
|
|
'images/*.png', 'images/*.ico', 'images/*.icns'
|
|
|
|
]},
|
|
|
|
data_files=[
|
|
|
|
('share/applications/',
|
|
|
|
['desktop/pybitmessage.desktop']),
|
|
|
|
('share/icons/hicolor/scalable/apps/',
|
|
|
|
['desktop/icons/scalable/pybitmessage.svg']),
|
|
|
|
('share/icons/hicolor/24x24/apps/',
|
|
|
|
['desktop/icons/24x24/pybitmessage.png'])
|
|
|
|
],
|
|
|
|
ext_modules=[bitmsghash],
|
|
|
|
zip_safe=False,
|
|
|
|
entry_points={
|
|
|
|
'bitmessage.gui.menu': [
|
2017-03-07 14:44:48 +01:00
|
|
|
'address.qrcode = pybitmessage.plugins.menu_qrcode [qrcode]'
|
2017-03-01 11:29:38 +01:00
|
|
|
],
|
2017-09-21 13:43:01 +02:00
|
|
|
'bitmessage.notification.message': [
|
|
|
|
'notify2 = pybitmessage.plugins.notification_notify2'
|
|
|
|
'[gir, notify2]'
|
2017-03-24 12:51:46 +01:00
|
|
|
],
|
2017-09-21 13:43:01 +02:00
|
|
|
'bitmessage.notification.sound': [
|
|
|
|
'theme.canberra = pybitmessage.plugins.sound_canberra',
|
|
|
|
'file.gstreamer = pybitmessage.plugins.sound_gstreamer'
|
|
|
|
'[gir]',
|
|
|
|
'file.fallback = pybitmessage.plugins.sound_playfile'
|
|
|
|
'[sound]'
|
|
|
|
],
|
|
|
|
'bitmessage.indicator': [
|
|
|
|
'libmessaging ='
|
|
|
|
'pybitmessage.plugins.indicator_libmessaging [gir]'
|
|
|
|
],
|
|
|
|
# 'console_scripts': [
|
|
|
|
# 'pybitmessage = pybitmessage.bitmessagemain:main'
|
|
|
|
# ]
|
|
|
|
},
|
|
|
|
scripts=['src/pybitmessage'],
|
|
|
|
cmdclass={'install': InstallCmd}
|
|
|
|
)
|