-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildFrogger.py
More file actions
110 lines (96 loc) · 2.82 KB
/
buildFrogger.py
File metadata and controls
110 lines (96 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# py2exe setup program
from distutils.core import setup
import py2exe
import sys
import os
import pygame
import glob, shutil
sys.argv.append("py2exe")
VERSION = '1.0'
AUTHOR_NAME = 'Your Name'
AUTHOR_EMAIL = 'your_email@somewhere.com'
AUTHOR_URL = "http://www.urlofyourgamesite.com/"
PRODUCT_NAME = "Pyfrogger's Game"
SCRIPT_MAIN = 'Frogger.py'
VERSIONSTRING = PRODUCT_NAME + " ALPHA " + VERSION
ICONFILE = 'frogger.ico'
# Remove the build tree on exit automatically
REMOVE_BUILD_ON_EXIT = True
PYGAMEDIR = os.path.split(pygame.base.__file__)[0]
SDL_DLLS = glob.glob(os.path.join(PYGAMEDIR,'*.dll'))
if os.path.exists('build/'): shutil.rmtree('build/')
extra_files = [
("config",glob.glob(os.path.join('config','*.ini'))),
("fonts",glob.glob(os.path.join('src','core','fonts','*.ttf')))
]
# List of all modules to automatically exclude from distribution build
# This gets rid of extra modules that aren't necessary for proper functioning of app
# You should only put things in this list if you know exactly what you DON'T need
# This has the benefit of drastically reducing the size of your dist
MODULE_EXCLUDES =[
'email',
'AppKit',
'Foundation',
'bdb',
'difflib',
'tcl',
'Tkinter',
'Tkconstants',
'curses',
'distutils',
'setuptools',
'urllib',
'urllib2',
'urlparse',
'BaseHTTPServer',
'_LWPCookieJar',
'_MozillaCookieJar',
'ftplib',
'gopherlib',
'_ssl',
'htmllib',
'httplib',
'mimetools',
'mimetypes',
'rfc822',
'tty',
'webbrowser',
'socket',
'hashlib',
'base64',
'compiler',
'pydoc']
INCLUDE_STUFF = ['encodings',"encodings.latin_1",]
setup(windows=[
{'script': SCRIPT_MAIN,
'other_resources': [(u"VERSIONTAG",1,VERSIONSTRING)],
'icon_resources': [(1, ICONFILE)]
}],
options = {"py2exe": {
"optimize": 2,
"includes": INCLUDE_STUFF,
"compressed": 1,
"ascii": 1,
"bundle_files": 2,
"ignores": ['tcl','AppKit','Numeric','Foundation'],
"excludes": MODULE_EXCLUDES} },
name = PRODUCT_NAME,
version = VERSION,
data_files = extra_files,
zipfile = None,
author = AUTHOR_NAME,
author_email = AUTHOR_EMAIL,
url = AUTHOR_URL)
# Create the /save folder for inclusion with the installer
#shutil.copytree('save','dist/save')
if os.path.exists('dist/tcl'): shutil.rmtree('dist/tcl')
# Remove the build tree
if REMOVE_BUILD_ON_EXIT:
shutil.rmtree('build/')
if os.path.exists('dist/tcl84.dll'): os.unlink('dist/tcl84.dll')
if os.path.exists('dist/tk84.dll'): os.unlink('dist/tk84.dll')
for f in SDL_DLLS:
fname = os.path.basename(f)
try:
shutil.copyfile(f,os.path.join('dist',fname))
except: pass