setup.py changes needed for indicator_libmessaging:

- entry point 'indicator' and new extra 'gir' which requires
   only pygobject
 - desktop entry
 - icons are renamed and placed into separate dirs for standard sizes,
   because data_files keyword not supports file renaming
This commit is contained in:
Dmitri Bogomolov 2017-03-24 13:51:46 +02:00
parent b77eb0c7e5
commit de531949e0
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -2,6 +2,7 @@
import os import os
import sys import sys
import shutil
try: try:
from setuptools import setup, Extension from setuptools import setup, Extension
from setuptools.command.install import install from setuptools.command.install import install
@ -167,6 +168,7 @@ def prereqToPackages():
print packageName[package].get('description') print packageName[package].get('description')
def compilerToPackages(): def compilerToPackages():
if not detectOS() in compiling: if not detectOS() in compiling:
return return
@ -202,6 +204,14 @@ class InstallCmd(install):
except (EOFError, NameError): except (EOFError, NameError):
pass pass
# prepare icons directories
os.makedirs('desktop/icons/scalable')
shutil.copyfile(
'desktop/can-icon.svg', 'desktop/icons/scalable/pybitmessage.svg')
os.makedirs('desktop/icons/24x24')
shutil.copyfile(
'desktop/icon24.png', 'desktop/icons/24x24/pybitmessage.png')
return install.run(self) return install.run(self)
@ -253,9 +263,10 @@ if __name__ == "__main__":
#keywords='', #keywords='',
install_requires=installRequires, install_requires=installRequires,
extras_require={ extras_require={
'gir': ['pygobject'],
'qrcode': ['qrcode'], 'qrcode': ['qrcode'],
'pyopencl': ['pyopencl'], 'pyopencl': ['pyopencl'],
'notify2': ['pygobject', 'notify2'], 'notify2': ['notify2'],
'sound:platform_system=="Windows"': ['winsound'] 'sound:platform_system=="Windows"': ['winsound']
}, },
classifiers=[ classifiers=[
@ -273,6 +284,14 @@ if __name__ == "__main__":
'translations/*.ts', 'translations/*.qm', 'translations/*.ts', 'translations/*.qm',
'images/*.png', 'images/*.ico', 'images/*.icns' '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], ext_modules=[bitmsghash],
zip_safe=False, zip_safe=False,
entry_points={ entry_points={
@ -282,12 +301,16 @@ if __name__ == "__main__":
], ],
'bitmessage.notification.message': [ 'bitmessage.notification.message': [
'notify2 = pybitmessage.plugins.notification_notify2' 'notify2 = pybitmessage.plugins.notification_notify2'
'[notify2]' '[gir, notify2]'
], ],
'bitmessage.notification.sound': [ 'bitmessage.notification.sound': [
'file.fallback = pybitmessage.plugins.sound_playfile' 'file.fallback = pybitmessage.plugins.sound_playfile'
'[sound]' '[sound]'
], ],
'bitmessage.indicator': [
'libmessaging ='
'pybitmessage.plugins.indicator_libmessaging [gir]'
],
# 'console_scripts': [ # 'console_scripts': [
# 'pybitmessage = pybitmessage.bitmessagemain:main' # 'pybitmessage = pybitmessage.bitmessagemain:main'
# ] # ]