diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 58 |
1 files changed, 54 insertions, 4 deletions
@@ -1,9 +1,57 @@ -# coding: utf-8 +""" Setup """ +import os +import sys -from distutils.core import setup +try: + from setuptools import setup, Command + setuptools_available = True +except ImportError: + from distutils.core import setup, Command + setuptools_available = False -from hypervideo_gui import __version__, __license__ +from hypervideo_gui.main_ui import ( + __version__, + __license__, +) + +script_exec = os.path.join('bin', 'hypervideo-gui') + + +# Begin - Desktop file and Icon +if sys.platform.startswith("linux"): + platform = 'gnu' +else: + sys.stderr.write("Unknown platform: %s" % sys.platform) + +ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) +SETUP_DIR = os.path.join(ROOT_DIR, 'setup-files', platform) + + +def icon_data_files(): + ''' Loop icon files ''' + sizes = [16, 22, 32, 48, 64, 96, 128, 192, 384] + data_icons_files = [] + for size in sizes: + icon_dir = os.path.join("icons", "hicolor", "%sx%s" % (size, size), "apps") + source = os.path.join(SETUP_DIR, icon_dir, "hypervideo-gui.png") + dest = os.path.join("/usr/share/", icon_dir) + data_icons_files.append((dest, [source])) + return data_icons_files + + +def application_data_files(): + ''' Desktop file ''' + return [ + ('/usr/share/applications', + [os.path.join(SETUP_DIR, 'hypervideo-gui.desktop')]), + ] + + +def data_files(): + ''' Return desktop file and icons ''' + return application_data_files() + icon_data_files() +# setup( author="Jesús E.", @@ -15,5 +63,7 @@ setup( url="https://libregit.org/heckyel/hypervideo-gui", packages=[ 'hypervideo_gui', - ] + ], + scripts=[script_exec], + data_files=data_files(), ) |