12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- """ Setup """
- import os
- import sys
- try:
- from setuptools import setup, Command
- setuptools_available = True
- except ImportError:
- from distutils.core import setup, Command
- setuptools_available = False
- 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.",
- author_email="heckyel@hyperbola.info",
- name="hypervideo_gui",
- description="Simple Hypervideo Downloader GUI",
- version=__version__,
- license=__license__,
- url="https://notabug.org/heckyel/hypervideo-gui",
- packages=[
- 'hypervideo_gui',
- ],
- scripts=[script_exec],
- data_files=data_files(),
- )
|