]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/setup.py
update from Vegh Janos
[wxWidgets.git] / wxPython / setup.py
index e95880bca79d1ef3d2063716c583949b5c328257..43bcbe66119f3206031d898cff886e892e491b94 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #----------------------------------------------------------------------
 
-import sys, os, glob, fnmatch
+import sys, os, glob, fnmatch, commands
 from distutils.core      import setup, Extension
 from distutils.file_util import copy_file
 from distutils.dir_util  import mkpath
@@ -15,7 +15,7 @@ from distutils.command.install_data import install_data
 
 VER_MAJOR        = 2      # The first three must match wxWindows
 VER_MINOR        = 5
-VER_RELEASE      = 0
+VER_RELEASE      = 1
 VER_SUBREL       = 0      # wxPython release num for x.y.z release of wxWindows
 VER_FLAGS        = "p1"   # release flags, such as prerelease num, unicode, etc.
 
@@ -23,7 +23,11 @@ DESCRIPTION      = "Cross platform GUI toolkit for Python"
 AUTHOR           = "Robin Dunn"
 AUTHOR_EMAIL     = "Robin Dunn <robin@alldunn.com>"
 URL              = "http://wxPython.org/"
-LICENSE          = "wxWindows (LGPL derivative)"
+DOWNLOAD_URL     = "http://wxPython.org/download.php"
+LICENSE          = "wxWindows Library License (LGPL derivative)"
+PLATFORMS        = "WIN32,OSX,POSIX"
+KEYWORDS         = "GUI,wx,wxWindows,cross-platform"
+
 LONG_DESCRIPTION = """\
 wxPython is a GUI toolkit for Python that is a wrapper around the
 wxWindows C++ GUI library.  wxPython provides a large variety of
@@ -32,6 +36,22 @@ feel (by using the native widgets) on the platforms it is supported
 on.
 """
 
+CLASSIFIERS      = """\
+Development Status :: 6 - Mature
+Environment :: MacOS X :: Carbon
+Environment :: Win32 (MS Windows)
+Environment :: X11 Applications :: GTK
+Intended Audience :: Developers
+License :: OSI Approved
+Operating System :: MacOS :: MacOS X
+Operating System :: Microsoft :: Windows :: Windows 95/98/2000
+Operating System :: POSIX
+Programming Language :: Python
+Topic :: Software Development :: User Interfaces
+"""
+
+## License :: OSI Approved :: wxWindows Library Licence
+
 
 # Config values below this point can be reset on the setup.py command line.
 
@@ -106,7 +126,8 @@ HYBRID = 1         # 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 = '250'   # Version part of wxWindows DLL name
+                   # Version part of wxWindows LIB/DLL names
+WXDLLVER = '%d%d' % (VER_MAJOR, VER_MINOR)
 
 
 #----------------------------------------------------------------------
@@ -321,14 +342,14 @@ def makeLibName(name):
     if os.name == 'posix':
         libname = '%s_%s-%s' % (WXBASENAME, name, WXRELEASE)
     else:
-        raise NotImplementedError
+        libname = 'wxmsw%s%s_%s' % (WXDLLVER, libFlag(), name)
 
     return [libname]
 
 
 
 def adjustCFLAGS(cflags, defines, includes):
-    '''Extrace the raw -I, -D, and -U flags and put them into
+    '''Extract the raw -I, -D, and -U flags and put them into
        defines and includes as needed.'''
     newCFLAGS = []
     for flag in cflags:
@@ -349,7 +370,7 @@ def adjustCFLAGS(cflags, defines, includes):
 
 
 def adjustLFLAGS(lfags, libdirs, libs):
-    '''Extrace the -L and -l flags and put them in libdirs and libs as needed'''
+    '''Extract the -L and -l flags and put them in libdirs and libs as needed'''
     newLFLAGS = []
     for flag in lflags:
         if flag[:2] == '-L':
@@ -401,17 +422,13 @@ if os.name == 'nt':
     GENDIR = 'msw'
 
     includes = ['src',
-                opj(WXDIR, 'lib', 'mswdll' + libFlag()),
+                opj(WXDIR, 'lib', 'vc_dll', 'msw' + libFlag()),
                 opj(WXDIR, 'include'),
+                opj(WXDIR, 'contrib', 'include'),
                 ]
 
     defines = [ ('WIN32', None),
-                ('__WIN32__', None),
                 ('_WINDOWS', None),
-                ('__WINDOWS__', None),
-                ('WINVER', '0x0400'),
-                ('__WIN95__', None),
-                ('STRICT', None),
 
                 (WXPLAT, None),
                 ('WXUSINGDLL', '1'),
@@ -428,9 +445,14 @@ if os.name == 'nt':
     if not FINAL or HYBRID:
         defines.append( ('__WXDEBUG__', None) )
 
-    libdirs = [ opj(WXDIR, 'lib') ]
-    wxdll = 'wxmsw' + WXDLLVER + libFlag()
-    libs = [ wxdll ]
+    libdirs = [ opj(WXDIR, 'lib', 'vc_dll') ]
+    libs = [ 'wxbase' + WXDLLVER + libFlag(),  # TODO: trim this down to what is really needed for the core
+             'wxbase' + WXDLLVER + libFlag() + '_net',
+             'wxbase' + WXDLLVER + libFlag() + '_xml',
+             makeLibName('core')[0],
+             makeLibName('adv')[0],
+             makeLibName('html')[0],
+             ]
 
     libs = libs + ['kernel32', 'user32', 'gdi32', 'comdlg32',
             'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
@@ -477,6 +499,8 @@ elif os.name == 'posix':
     if debug:
         cflags.append('-g')
         cflags.append('-O0')
+    else:
+        cflags.append('-O3')
 
     lflags = os.popen(WX_CONFIG + ' --libs', 'r').read()[:-1]
     lflags = lflags.split()
@@ -515,11 +539,12 @@ elif os.name == 'posix':
 
         cflags += portcfg.split()
 
-        # Some distros (e.g. Mandrake) put libGLU in /usr/X11R6/lib, but
-        # wx-config doesn't output that for some reason.  For now, just
-        # add it unconditionally but we should really check if the lib is
-        # really found there or wx-config should be fixed.
-        libdirs.append("/usr/X11R6/lib")
+    # If you get unresolved symbol errors on Solaris and are using gcc, then
+    # uncomment this block to add the right flags to the link step and build
+    # again.
+    ## if os.uname()[0] == 'SunOS':
+    ##     libs.append('gcc')
+    ##     libdirs.append(commands.getoutput("gcc -print-search-dirs | grep '^install' | awk '{print $2}'")[:-1])
 
 
     # Move the various -I, -D, etc. flags we got from the *config scripts
@@ -717,7 +742,6 @@ if BUILD_GLCANVAS:
     msg('Preparing GLCANVAS...')
     location = 'contrib/glcanvas'
     swig_files = ['glcanvas.i']
-    other_sources = []
 
     swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
                             USE_SWIG, swig_force, swig_args, swig_deps)
@@ -728,12 +752,11 @@ if BUILD_GLCANVAS:
         gl_lflags = gl_config.split() + lflags
         gl_libs = libs
     else:
-        other_sources = [opj(location, 'msw/myglcanvas.cpp')]
-        gl_libs = libs + ['opengl32', 'glu32']
+        gl_libs = libs + ['opengl32', 'glu32'] + makeLibName('gl')
         gl_lflags = lflags
 
     ext = Extension('glcanvasc',
-                    swig_sources + other_sources,
+                    swig_sources,
 
                     include_dirs = includes,
                     define_macros = defines,
@@ -786,7 +809,10 @@ if BUILD_OGL:
 if BUILD_STC:
     msg('Preparing STC...')
     location = 'contrib/stc'
-    STC_H = opj(WXPREFIX, 'include/wx/stc')
+    if os.name == 'nt':
+        STC_H = opj(WXDIR, 'contrib', 'include/wx/stc')
+    else:
+        STC_H = opj(WXPREFIX, 'include/wx/stc')
 
 ## NOTE: need to add this to the stc.bkl...
 
@@ -903,7 +929,7 @@ if BUILD_GIZMOS:
                             USE_SWIG, swig_force, swig_args, swig_deps)
 
     ext = Extension('gizmosc',
-                    swig_sources,
+                    [ '%s/treelistctrl.cpp' % location ] + swig_sources,
 
                     include_dirs =  includes,
                     define_macros = defines,
@@ -992,8 +1018,12 @@ if __name__ == "__main__":
               author           = AUTHOR,
               author_email     = AUTHOR_EMAIL,
               url              = URL,
+              download_url     = DOWNLOAD_URL,
               license          = LICENSE,
-
+              platforms        = PLATFORMS,
+              classifiers      = filter(None, CLASSIFIERS.split("\n")),
+              keywords         = KEYWORDS,
+              
               packages = ['wxPython',
                           'wxPython.lib',
                           'wxPython.lib.colourchooser',