setup.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from distutils.core import setup
  2. import glob
  3. import os
  4. import os.path
  5. import sys
  6. import py2exe
  7. PYGAME_DIR = os.path.join(os.path.split(sys.executable)[0],
  8. "Lib\site-packages\pygame")
  9. def data_files_from_tree(source_dir): # the installation directory must have the same name
  10. data_files = []
  11. for root, dirs, files in os.walk(source_dir):
  12. if ".svn" not in root:
  13. source_list = []
  14. for filename in files:
  15. source_list.append(os.path.join(root, filename))
  16. data_files.append((root, source_list))
  17. return data_files
  18. setup(windows=["soundrts.py"],
  19. console=["server.py"],
  20. data_files=[("", [r"%s/freesansbold.ttf" % PYGAME_DIR,
  21. r"%s/SDL.dll" % PYGAME_DIR,
  22. r"%s/SDL_ttf.dll" % PYGAME_DIR,
  23. r"%s/libfreetype-6.dll" % PYGAME_DIR,
  24. r"%s/libogg-0.dll" % PYGAME_DIR,
  25. r"%s/zlib1.dll" % PYGAME_DIR,
  26. ]
  27. ## + glob.glob(r"%s/*.dll" % PYGAME_DIR)
  28. ),
  29. ],
  30. options = {
  31. 'py2exe': {
  32. 'bundle_files': 1,
  33. 'excludes': ['tkinter', '_tkinter', 'Tkinter', 'numpy', ],
  34. 'dll_excludes': ['libiomp5md.dll',],
  35. 'optimize': 1,
  36. }
  37. },
  38. ## zipfile = None,
  39. )