added missing files
[swftools.git] / wx / setup.py
1
2 # ======================================================#
3 # File automagically generated by GUI2Exe version 0.3
4 # Andrea Gavana, 01 April 2007
5 # ======================================================#
6
7 # Let's start with some default (for me) imports...
8
9 from distutils.core import setup
10 import py2exe
11 import glob
12 import os
13 import zlib
14 import shutil
15
16 from distutils.core import setup
17 import py2exe,sys,os
18
19 # Overriding Criteria for Including DLLs, see:
20 # http://www.py2exe.org/index.cgi/OverridingCriteraForIncludingDlls
21 # XXX: Check the permission to redistribute msvcp71.dll
22 origIsSystemDLL = py2exe.build_exe.isSystemDLL
23 def isSystemDLL(pathname):
24         if os.path.basename(pathname).lower() in ("msvcp71.dll",):
25                 return 0
26         return origIsSystemDLL(pathname)
27 py2exe.build_exe.isSystemDLL = isSystemDLL
28
29
30 # Remove the build folder
31 shutil.rmtree("build", ignore_errors=True)
32
33
34 manifest_template = """
35 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
36 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
37 <assemblyIdentity
38     version="5.0.0.0"
39     processorArchitecture="x86"
40     name="gpdf2swf"
41     type="win32"
42 />
43 <description>gpdf2swf Program</description>
44 <dependency>
45     <dependentAssembly>
46         <assemblyIdentity
47             type="win32"
48             name="Microsoft.Windows.Common-Controls"
49             version="6.0.0.0"
50             processorArchitecture="X86"
51             publicKeyToken="6595b64144ccf1df"
52             language="*"
53         />
54     </dependentAssembly>
55 </dependency>
56 </assembly>
57 """
58
59 class Target(object):
60     """ A simple class that holds information on our executable file. """
61     def __init__(self, **kw):
62         """ Default class constructor. Update as you need. """
63         self.__dict__.update(kw)
64         
65
66 # Ok, let's explain why I am doing that.
67 # Often, data_files, excludes and dll_excludes (but also resources)
68 # can be very long list of things, and this will clutter too much
69 # the setup call at the end of this file. So, I put all the big lists
70 # here and I wrap them using the textwrap module.
71
72 data_files = [('viewers', ['viewers/__init__.py',
73                            'viewers/raw.py',
74                            'viewers/rfx.py',
75                            'viewers/rfx7.swf',
76                            'viewers/rfx8.swf',
77                            'viewers/simple.py']),
78               #('.', ['dll/msvcp71.dll',
79               #      ]),
80               #('images', ['images/stop.png',
81               #            'images/pdf2swf_gui.ico'])
82              ]
83
84 includes = []
85 excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
86             'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
87             'Tkconstants', 'Tkinter']
88 packages = ['viewers']
89 dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
90                 'tk84.dll']
91 icon_resources = [(1, 'gpdf2swf.ico')]
92 bitmap_resources = []
93 other_resources = [(24, 1, manifest_template)]
94
95
96 # This is a place where the user custom code may go. You can do almost
97 # whatever you want, even modify the data_files, includes and friends
98 # here as long as they have the same variable name that the setup call
99 # below is expecting.
100
101 # No custom code added
102
103
104 # Ok, now we are going to build our target class.
105 # I chose this building strategy as it works perfectly for me :-D
106
107
108 GUI2Exe_Target_1 = Target(
109     # what to build
110     script = "gpdf2swf.py",
111     icon_resources = icon_resources,
112     bitmap_resources = bitmap_resources,
113     other_resources = other_resources,
114     dest_base = "gpdf2swf",    
115     version = "0.9.0",
116     company_name = "swftools",
117     copyright = "swftools",
118     name = "gpdf2exe"
119     )
120
121
122
123 # That's serious now: we have all (or almost all) the options py2exe
124 # supports. I put them all even if some of them are usually defaulted
125 # and not used. Some of them I didn't even know about.
126
127 setup(
128
129     data_files = data_files,
130
131     options = {"py2exe": {"compressed": 0, 
132                           "optimize": 2,
133                           "includes": includes,
134                           "excludes": excludes,
135                           "packages": packages,
136                           "dll_excludes": dll_excludes,
137                           "bundle_files": 3,
138                           "dist_dir": "dist",
139                           "xref": False,
140                           "skip_archive": False,
141                           "ascii": False,
142                           "custom_boot_script": '',
143                          }
144               },
145
146     zipfile = None,
147     console = [],
148     windows = [GUI2Exe_Target_1]
149     )
150
151 # This is a place where any post-compile code may go.
152 # You can add as much code as you want, which can be used, for example,
153 # to clean up your folders or to do some particular post-compilation
154 # actions.
155
156 # No post-compilation code added
157
158
159 # And we are done. That's a setup script :-D
160
161 # Run setup standalone...
162 if __name__ == "__main__":
163     setup()