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.

97 lines
2.0 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
  1. #!/usr/bin/env python2
  2. import sys
  3. from os import name
  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', '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. else:
  46. # On windows you have to copy the icons manually if you dont use py2exe
  47. icons_path = '/usr/local/share/icons/hicolor/'
  48. # Set params
  49. if PY2EXE:
  50. data_files = [
  51. ('', py2exe_dependencies),
  52. (icons_path, ICONS_LIST)
  53. ]
  54. params = {
  55. 'data_files': data_files,
  56. 'windows': [py2exe_windows],
  57. 'options': {'py2exe': py2exe_options}
  58. }
  59. else:
  60. data_files = []
  61. if name != 'nt':
  62. for index, size in enumerate(ICONS_SIZE):
  63. data_file = (icons_path + size + '/apps', [ICONS_LIST[index]])
  64. data_files.append(data_file)
  65. params = {
  66. 'data_files': data_files
  67. }
  68. setup(
  69. name=__appname__,
  70. author=__author__,
  71. url=__projecturl__,
  72. version=__version__,
  73. license=__license__,
  74. author_email=__contact__,
  75. description=__description__,
  76. long_description=__descriptionfull__,
  77. packages=['youtube_dl_gui'],
  78. **params
  79. )