You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.3 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. #!/usr/bin/env python2
  2. import os
  3. import sys
  4. PY2EXE = len(sys.argv) >= 2 and sys.argv[1] == 'py2exe'
  5. try:
  6. import py2exe
  7. except ImportError as e:
  8. if PY2EXE:
  9. print e
  10. sys.exit(1)
  11. from distutils.core import setup
  12. from youtube_dl_gui import (
  13. __author__,
  14. __appname__,
  15. __contact__,
  16. __version__,
  17. __license__,
  18. __projecturl__,
  19. __description__,
  20. __descriptionfull__
  21. )
  22. ICONS_SIZE = ('16x16', '32x32', '48x48', '64x64', '128x128', '256x256')
  23. ICONS_NAME = 'youtube_dl_gui/icons/youtube-dl-gui_%s.png'
  24. ICONS_LIST = [ICONS_NAME % size for size in ICONS_SIZE]
  25. py2exe_includes = [
  26. 'wx.lib.pubsub.*',
  27. 'wx.lib.pubsub.core.*',
  28. 'wx.lib.pubsub.core.arg1.*'
  29. ]
  30. py2exe_options = {
  31. 'includes': py2exe_includes
  32. }
  33. py2exe_windows = {
  34. 'script': 'youtube_dl_gui\\__main__.py',
  35. 'icon_resources': [(0, 'youtube_dl_gui\\icons\\youtube-dl-gui.ico')]
  36. }
  37. py2exe_dependencies = [
  38. 'C:\\Windows\\System32\\ffmpeg.exe',
  39. 'C:\\Windows\\System32\\ffprobe.exe',
  40. 'C:\\python27\\DLLs\MSVCP90.dll'
  41. ]
  42. # Set icons path
  43. if PY2EXE:
  44. icons_path = 'icons'
  45. fallback_icons_path = ''
  46. else:
  47. # On windows you have to copy the icons manually if you dont use py2exe
  48. icons_path = '/usr/share/icons/hicolor/'
  49. fallback_icons_path = '/usr/share/pixmaps/'
  50. # Set params
  51. if PY2EXE:
  52. data_files = [
  53. ('', py2exe_dependencies),
  54. (icons_path, ICONS_LIST)
  55. ]
  56. params = {
  57. 'data_files': data_files,
  58. 'windows': [py2exe_windows],
  59. 'options': {'py2exe': py2exe_options}
  60. }
  61. else:
  62. data_files = []
  63. if os.name != 'nt':
  64. # Create all the hicolor icons
  65. for index, size in enumerate(ICONS_SIZE):
  66. data_file = (icons_path + size + '/apps', [ICONS_LIST[index]])
  67. data_files.append(data_file)
  68. if fallback_icons_path != '':
  69. # Add the 48x48 icon as fallback in /usr/share/pixmaps
  70. data_file = (fallback_icons_path, [ICONS_LIST[2]])
  71. data_files.append(data_file)
  72. params = {
  73. 'data_files': data_files
  74. }
  75. setup(
  76. name=__appname__,
  77. author=__author__,
  78. url=__projecturl__,
  79. version=__version__,
  80. license=__license__,
  81. author_email=__contact__,
  82. description=__description__,
  83. long_description=__descriptionfull__,
  84. packages=['youtube_dl_gui'],
  85. **params
  86. )