]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/setup.py
Committing in .
[wxWidgets.git] / wxPython / setup.py
index dfef8c1d50ab3a4aa3ca81cde522fdb91a8e99ee..aa2c33fd9f373cdae0ae78db447f3024f8e26b03 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #----------------------------------------------------------------------
 
-import sys, os, string
+import sys, os, string, glob
 from distutils.core      import setup, Extension
 from distutils.file_util import copy_file
 from distutils.dir_util  import mkpath
@@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
 # flags and values that affect this script
 #----------------------------------------------------------------------
 
-VERSION          = "2.3.2b7"
+VERSION          = "2.3.3"
 DESCRIPTION      = "Cross platform GUI toolkit for Python"
 AUTHOR           = "Robin Dunn"
 AUTHOR_EMAIL     = "Robin Dunn <robin@alldunn.com>"
@@ -28,14 +28,18 @@ on.
 """
 
 
-BUILD_GLCANVAS = 0 # If true, build the contrib/glcanvas extension module
+BUILD_GLCANVAS = 1 # If true, build the contrib/glcanvas extension module
 BUILD_OGL = 1      # If true, build the contrib/ogl extension module
 BUILD_STC = 1      # If true, build the contrib/stc extension module
-BUILD_IEWIN = 0    # Internet Explorer wrapper (experimental)
 BUILD_XRC = 1      # XML based resource system
+BUILD_GIZMOS = 1   # Build a module for the gizmos contrib library
+BUILD_DLLWIDGET = 1# Build a module for the gizmos contrib library
 
+BUILD_IEWIN = 0    # Internet Explorer wrapper (experimental)
 
 CORE_ONLY = 0      # if true, don't build any of the above
+
+
 GL_ONLY = 0        # Only used when making the -gl RPM.  See the "b" script
                    # for the ugly details
 
@@ -64,7 +68,7 @@ HYBRID = 0         # If set and not debug or FINAL, then build a
                    # wxWindows must have been built with /MD, not /MDd
                    # (using FINAL=hybrid will do it.)
 
-WXDLLVER = '232'  # Version part of DLL name
+WXDLLVER = '233'   # Version part of DLL name
 
 
 #----------------------------------------------------------------------
@@ -111,6 +115,7 @@ if bcpp_compiling:
 #----------------------------------------------------------------------
 
 for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC',
+             'BUILD_GIZMOS', 'BUILD_DLLWIDGET',
              'CORE_ONLY', 'USE_SWIG', 'IN_CVS_TREE',
              'FINAL', 'HYBRID', ]:
     for x in range(len(sys.argv)):
@@ -136,6 +141,9 @@ if CORE_ONLY:
     BUILD_OGL = 0
     BUILD_STC = 0
     BUILD_XRC = 0
+    BUILD_GIZMOS = 0
+    BUILD_DLLWIDGET = 0
+
 
 #----------------------------------------------------------------------
 # Setup some platform specific stuff
@@ -215,7 +223,7 @@ if os.name == 'nt':
 
 
     if bcpp_compiling:  # overwrite it
-        cflags = ['-5', '-VF',  ### To supplort MSVC spurious semicolons in the class scope
+        cflags = ['-5', '-VF',  ### To support MSVC spurious semicolons in the class scope
                   ### else, all semicolons at the end of all DECLARE_...CALLBACK... macros must be eliminated
                   '-Hc', '-H=' + opj(WXDIR, '\src\msw\wx32.csm'),
                   '@' + opj(WXDIR, '\src\msw\wxwin32.cfg')
@@ -232,7 +240,7 @@ if os.name == 'nt':
 
 
 
-elif os.name == 'posix' and sys.platform == "darwin1":
+elif os.name == 'posix' and sys.platform[:6] == "darwin":
     # Flags and such for a Darwin (Max OS X) build of Python
 
     WXDIR = '..'              # assumes IN_CVS_TREE
@@ -547,12 +555,12 @@ if not GL_ONLY and BUILD_STC:
 
 
     swig_files = ['stc_.i']
-    swig_sources = run_swig(swig_files, location, '', PKGDIR,
+    swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
                             USE_SWIG, swig_force,
                             swig_args + ['-I'+STC_H, '-I'+location],
                             [opj(STC_H, 'stc.h')])
 
-    # copy a project specific py module to the main package dir
+    # copy a contrib project specific py module to the main package dir
     copy_file(opj(location, 'stc.py'), PKGDIR, update=1, verbose=0)
 
     # add some include dirs to the standard set
@@ -746,6 +754,98 @@ if not GL_ONLY and BUILD_XRC:
 
 
 
+#----------------------------------------------------------------------
+# Define the GIZMOS  extension module
+#----------------------------------------------------------------------
+
+if not GL_ONLY and BUILD_GIZMOS:
+    msg('Preparing GIZMOS...')
+    location = 'contrib/gizmos'
+    GIZMOLOC = opj(location, 'contrib/src/gizmos')
+    GIZMOINC = opj(location, 'contrib/include')
+
+    swig_files = ['gizmos.i']
+
+    swig_sources = run_swig(swig_files, location, '', PKGDIR,
+                            USE_SWIG, swig_force, swig_args)
+
+    gizmos_includes = includes[:]
+    gizmos_includes.append(GIZMOINC)
+
+
+    # make sure local copy of contrib files are up to date
+    if IN_CVS_TREE:
+        contrib_copy_tree(opj(CTRB_INC, 'gizmos'), opj(GIZMOINC, 'wx/gizmos'))
+        contrib_copy_tree(opj(CTRB_SRC, 'gizmos'), GIZMOLOC)
+
+    ext = Extension('gizmosc', [
+                                '%s/dynamicsash.cpp' % GIZMOLOC,
+                                '%s/editlbox.cpp' % GIZMOLOC,
+                                #'%s/multicell.cpp' % GIZMOLOC,
+                                '%s/splittree.cpp' % GIZMOLOC,
+                                '%s/ledctrl.cpp'   % GIZMOLOC,
+                             ] + swig_sources,
+
+                    include_dirs =  gizmos_includes,
+                    define_macros = defines,
+
+                    library_dirs = libdirs,
+                    libraries = libs,
+
+                    extra_compile_args = cflags,
+                    extra_link_args = lflags,
+                    )
+
+    wxpExtensions.append(ext)
+
+
+
+#----------------------------------------------------------------------
+# Define the DLLWIDGET  extension module
+#----------------------------------------------------------------------
+
+if not GL_ONLY and BUILD_DLLWIDGET:
+    msg('Preparing DLLWIDGET...')
+    location = 'contrib/dllwidget'
+    swig_files = ['dllwidget_.i']
+
+    swig_sources = run_swig(swig_files, location, '', PKGDIR,
+                            USE_SWIG, swig_force, swig_args)
+
+    # copy a contrib project specific py module to the main package dir
+    copy_file(opj(location, 'dllwidget.py'), PKGDIR, update=1, verbose=0)
+
+    ext = Extension('dllwidget_c', [
+                                '%s/dllwidget.cpp' % location,
+                             ] + swig_sources,
+
+                    include_dirs =  includes,
+                    define_macros = defines,
+
+                    library_dirs = libdirs,
+                    libraries = libs,
+
+                    extra_compile_args = cflags,
+                    extra_link_args = lflags,
+                    )
+
+    wxpExtensions.append(ext)
+
+
+#----------------------------------------------------------------------
+# Tools and scripts
+#----------------------------------------------------------------------
+
+TOOLS = [("wxPython/tools",        glob.glob("tools/*.py")),
+         ("wxPython/tools/XRCed",  glob.glob("tools/XRCed/*.py") +
+                                   glob.glob("tools/XRCed/*.xrc") +
+                                   ["tools/XRCed/CHANGES",
+                                    "tools/XRCed/TODO",
+                                    "tools/XRCed/README"]),
+         ]
+
+
+
 
 #----------------------------------------------------------------------
 # Do the Setup/Build/Install/Whatever
@@ -765,11 +865,14 @@ if __name__ == "__main__":
               packages = [PKGDIR,
                           PKGDIR+'.lib',
                           PKGDIR+'.lib.editor',
-                          PKGDIR+'.lib.mixins'
+                          PKGDIR+'.lib.mixins',
+                          PKGDIR+'.lib.PyCrust',
                           ],
 
               ext_package = PKGDIR,
               ext_modules = wxpExtensions,
+
+              ##data_files = TOOLS,
               )
 
     else:
@@ -786,6 +889,7 @@ if __name__ == "__main__":
 
               ext_package = PKGDIR,
               ext_modules = wxpExtensions,
+
               )