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 sys
import shutil
try:
from setuptools import setup, Extension
from setuptools.command.install import install
@ -167,6 +168,7 @@ def prereqToPackages():
print packageName[package].get('description')
def compilerToPackages():
if not detectOS() in compiling:
return
@ -202,6 +204,14 @@ class InstallCmd(install):
except (EOFError, NameError):
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)
@ -253,9 +263,10 @@ if __name__ == "__main__":
#keywords='',
install_requires=installRequires,
extras_require={
'gir': ['pygobject'],
'qrcode': ['qrcode'],
'pyopencl': ['pyopencl'],
'notify2': ['pygobject', 'notify2'],
'notify2': ['notify2'],
'sound:platform_system=="Windows"': ['winsound']
},
classifiers=[
@ -273,6 +284,14 @@ if __name__ == "__main__":
'translations/*.ts', 'translations/*.qm',
'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={
@ -282,12 +301,16 @@ if __name__ == "__main__":
],
'bitmessage.notification.message': [
'notify2 = pybitmessage.plugins.notification_notify2'
'[notify2]'
'[gir, notify2]'
],
'bitmessage.notification.sound': [
'file.fallback = pybitmessage.plugins.sound_playfile'
'[sound]'
],
'bitmessage.indicator': [
'libmessaging ='
'pybitmessage.plugins.indicator_libmessaging [gir]'
],
# 'console_scripts': [
# 'pybitmessage = pybitmessage.bitmessagemain:main'
# ]