Commits

Lenard Lindstrom committed c57e7c3

Update Windows config for new deps

  • Participants
  • Parent commits d473581

Comments (0)

Files changed (20)

File config_msys.py

 
 #these get prefixes with '/usr/local' and /mingw or the $LOCALBASE
 origincdirs = ['/include', '/include/SDL', '/include/SDL11',
-               '/include/smpeg' ]
+               '/include/smpeg', '/include/libpng12', ]
 origlibdirs = ['/lib']
 
 
         Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.dll.a'),
         Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.dll.a'),
         DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', m),
-        Dependency('PNG', 'png.h', 'libpng.dll.a'),
+        Dependency('PNG', 'png.h', 'libpng12.dll.a'),
         Dependency('JPEG', 'jpeglib.h', 'libjpeg.dll.a'),
         DependencyWin('SCRAP', ['user32', 'gdi32']),
         DependencyDLL('TIFF'),

File config_win.py

 
 class Dependency(object):
     inc_hunt = ['include']
-    lib_hunt = ['VisualC\\SDL\\Release', 'VisualC\\Release', 'Release', 'lib']
+    lib_hunt = ['VisualC\\SDL\\Release', 'VisualC\\Release', 'Release', 'lib', 'objs']
     def __init__(self, name, wildcards, libs=None, required = 0):
         if libs is None:
             libs = [dll.name_to_root(name)]
     Dependency('SMPEG', ['smpeg-[0-9].*', 'smpeg']),
     DependencyWin('SCRAP', ['user32', 'gdi32']),
     Dependency('JPEG', ['jpeg-[6-9]*']),
-    Dependency('PNG', ['libpng1[2-9]-[0-9].*']),
+    Dependency('PNG', ['libpng-[1-9].*']),
     DependencyDLL('TIFF', ['tiff-[3-9].*']),
     DependencyDLL('VORBIS', ['libvorbis-[1-9].*']),
     DependencyDLL('OGG', ['libogg-[1-9].*']),

File configtest/test_config_msys.py

         'IMAGE': Dependency('IMAGE', 'include/sdl', 'lib'),
         'MIXER': Dependency('MIXER', 'include', 'lib'),  # A deviant include dir
         'SMPEG': Dependency('SMPEG', 'include', 'lib'),  # ? uses smpeg-config script
-        'PNG': Dependency('PNG', 'include', 'lib'),
+        'PNG': Dependency('PNG', 'include/libpng12', 'lib'),
         'JPEG': Dependency('JPEG', 'include/sdl', 'lib'),  # A deviant include dir
         'SCRAP': Dependency(libs=['user32', 'gdi32']),
         'COPYLIB_SDL': Dependency('SDL', lib_dir_rel='bin/sdl.dll'),
         'COPYLIB_MIXER': Dependency('MIXER', lib_dir_rel='lib/sdl_mixer.dll'),  # Where the search starts
         'COPYLIB_SMPEG': Dependency('SMPEG', lib_dir_rel='bin/smpeg.dll'),
         'COPYLIB_TIFF': Dependency('TIFF', lib_dir_rel='bin/libtiff.dll'),
-        'COPYLIB_PNG': Dependency('PNG', lib_dir_rel='bin/libpng13.dll'),
+        'COPYLIB_PNG': Dependency('PNG', lib_dir_rel='bin/libpng12-0.dll'),
         'COPYLIB_JPEG': Dependency('JPEG', lib_dir_rel='bin/jpeg.dll'),
         'COPYLIB_Z': Dependency('Z', lib_dir_rel='bin/zlib1.dll'),
         'COPYLIB_VORBISFILE': Dependency('VORBISFILE', lib_dir_rel='bin/libvorbisfile-3.dll'),
         'COPYLIB_VORBIS': Dependency('VORBIS', lib_dir_rel='bin/libvorbis-0.dll'),
         'COPYLIB_OGG': Dependency('OGG', lib_dir_rel='bin/libogg-0.dll'),
+        'COPYLIB_FREETYPE': Dependency('FREETYPE', lib_dir_rel='bin/libfreetype-6.dll'),
         }
 
     def test_dependencies(self):

File configtest/test_config_win.py

 
     # Pygame dependencies
     expectations = {
-        'SDL': Dependency('SDL', 'sdl-1.2.12/include', 'sdl-1.2.12/visualc/sdl/release'),
+        'SDL': Dependency('SDL', 'sdl-1.2/include', 'sdl-1.2/visualc/sdl/release'),
         'FONT': Dependency('FONT', 'sdl_ttf-2.0.9', 'sdl_ttf-2.0.9/release'),
         'IMAGE': Dependency('IMAGE', 'sdl_image-1.2.6', 'sdl_image-1.2.6/visualc/release'),
-        'MIXER': Dependency('MIXER', 'sdl_mixer-1.2.8', 'sdl_mixer-1.2.8/release'),
+        'MIXER': Dependency('MIXER', 'sdl_mixer-1.2', 'sdl_mixer-1.2/release'),
         'SMPEG': Dependency('SMPEG', 'smpeg', 'smpeg/release'),
-        'PNG': Dependency('PNG', 'libpng-1.2.19', 'libpng-1.2.19/lib'),
+        'PNG': Dependency('PNG', 'libpng-1.2.32', 'libpng-1.2.32/lib'),
         'JPEG': Dependency('JPEG', 'jpeg-6b', 'jpeg-6b/release'),
         'SCRAP': Dependency(libs=['user32', 'gdi32']),
         'COPYLIB_SDL': Dependency('SDL',
-                                  lib_dir_rel='sdl-1.2.12/visualc/sdl/release/sdl.dll'),
+                                  lib_dir_rel='sdl-1.2/visualc/sdl/release/sdl.dll'),
         'COPYLIB_FONT': Dependency('FONT',
                                    lib_dir_rel='sdl_ttf-2.0.9/release/sdl_ttf.dll'),
         'COPYLIB_IMAGE': Dependency('IMAGE',
                                     lib_dir_rel='sdl_image-1.2.6/visualc/release/sdl_image.dll'),
         'COPYLIB_MIXER': Dependency('MIXER',
-                                    lib_dir_rel='sdl_mixer-1.2.8/release/sdl_mixer.dll'),
+                                    lib_dir_rel='sdl_mixer-1.2/release/sdl_mixer.dll'),
         'COPYLIB_SMPEG': Dependency('SMPEG', lib_dir_rel='smpeg/release/smpeg.dll'),
         'COPYLIB_TIFF': Dependency('TIFF', lib_dir_rel='tiff-3.8.2/release/libtiff.dll'),
-        'COPYLIB_PNG': Dependency('PNG', lib_dir_rel='libpng-1.2.19/lib/libpng13.dll'),
+        'COPYLIB_PNG': Dependency('PNG', lib_dir_rel='libpng-1.2.32/lib/libpng13.dll'),
         'COPYLIB_JPEG': Dependency('JPEG', lib_dir_rel='jpeg-6b/release/jpeg.dll'),
         'COPYLIB_Z': Dependency('Z', lib_dir_rel='zlib-1.2.3/release/zlib1.dll'),
         'COPYLIB_VORBISFILE': Dependency('VORBISFILE',
         'COPYLIB_VORBIS': Dependency('VORBIS',
                                      lib_dir_rel='libvorbis-1.2.0/release/libvorbis-0.dll'),
         'COPYLIB_OGG': Dependency('OGG', lib_dir_rel='libogg-1.1.3/release/libogg-0.dll'),
+        'COPYLIB_FREETYPE': Dependency('FREETYPE',
+                                       lib_dir_rel='freetype-2.3.7/objs/freetype.dll'),
         }
 
     def test_dependencies(self):

File configtest/test_dll.py

         ('SMPEG', ['smpeg.dll', 'SMPEG.DLL', 'libsmpeg.dll'], ['smpeg.dll.a']),
         ('TIFF', ['tiff.dll', 'TIFF.DLL', 'libtiff.dll'], ['tiff.dll.a']),
         ('JPEG', ['jpeg.dll', 'JPEG.DLL', 'libjpeg.dll'], ['jpeg.dll.a']),
-        ('PNG', ['libpng13.dll', 'LIBPNG13.DLL', 'libpng12.dll', 'png12.dll', 'png13.dll'],
-                ['libpng.dll', 'libpng13.dll.a']),
+        ('PNG', ['libpng13.dll', 'LIBPNG13.DLL', 'libpng12.dll', 'png12.dll', 'png13.dll', 'libpng12-0.dll'],
+                ['libpng.dll', 'libpng13.dll.a', 'libpng12.dll.a']),
         ('Z', ['zlib1.dll', 'ZLIB1.DLL'], ['z.dll', 'libzlib1.dll', 'zlib1.dll.a']),
         ('VORBIS', ['vorbis.dll', 'VORBIS.DLL', 'libvorbis-0.dll'], ['libvorbis-1.dll', 'libvorbis-0.dll.a']),
         ('VORBISFILE', ['vorbisfile.dll', 'VORBISFILE.DLL', 'libvorbisfile-3.dll'],
                        ['libvorbisfile-0.dll', 'libvorbisfile-3.dll.a']),
         ('OGG', ['ogg.dll', 'OGG.DLL', 'libogg-0.dll'], ['libogg-1.dll', 'libogg-0.dll.a']),
+        ('FREETYPE', ['freetype.dll', 'FREETYPE.DLL', 'libfreetype-6.dll'],
+         ['libfreetype.dll.a']),
         ]
 
     def test_compat(self):
 
     def test_multiple_dependencies(self):
         """Ensure dependencies are recursively traced"""
-        expected_libs = ['vorbisfile', 'vorbis', 'ogg']
-        libs = dll.dependencies(['vorbisfile'])
+        expected_libs = ['VORBISFILE', 'VORBIS', 'OGG']
+        libs = dll.dependencies(['VORBISFILE'])
         self.failUnlessEqual(len(libs), len(expected_libs))
         for lib in expected_libs:
             self.failUnless(lib in libs)
 
     def test_multiple_libs(self):
         """Ensure mutliple libraries in a list are handled"""
-        expected_libs = ['SDL', 'z']  # Chosen for not having dependencies
+        expected_libs = ['SDL', 'Z']  # Chosen for not having dependencies
         libs = dll.dependencies(expected_libs)
         self.failUnlessEqual(len(libs), len(expected_libs))
         for lib in expected_libs:

File configtest/testdir/SDL-1.2.12/VisualC/SDL/Release/SDL.dll

-A bogus DLL

File configtest/testdir/SDL-1.2.12/include/SDL.h

-/* Just a bogus header file */

File configtest/testdir/SDL-1.2/VisualC/SDL/Release/SDL.dll

+A bogus DLL

File configtest/testdir/SDL-1.2/include/SDL.h

+/* Just a bogus header file */

File configtest/testdir/SDL_mixer-1.2.8/Release/SDL_mixer.dll

-A bogus DLL

File configtest/testdir/SDL_mixer-1.2/Release/SDL_mixer.dll

+A bogus DLL

File configtest/testdir/bin/libfreetype-6.dll

+A bogus DLL

File configtest/testdir/bin/libpng12-0.dll

+A bogus DLL

File configtest/testdir/bin/libpng13.dll

-A bogus DLL

File configtest/testdir/freetype-2.3.7/objs/freetype.dll

+A bogus DLL

File configtest/testdir/include/libpng12/png.h

+/* Just a bogus header file */

File configtest/testdir/include/png.h

-/* Just a bogus header file */

File configtest/testdir/libpng-1.2.19/lib/libpng13.dll

-A bogus DLL

File configtest/testdir/libpng-1.2.32/lib/libpng13.dll

+A bogus DLL
 # name, root, File regex, Dependency list of file root names
 libraries = [
     ('MIXER', 'SDL_mixer', r'(lib){0,1}SDL_mixer\.dll$',
-     ['SDL', 'vorbisfile', 'smpeg']),
+     ['SDL', 'VORBISFILE', 'SMPEG']),
     ('VORBISFILE', 'vorbisfile',  r'(lib){0,1}vorbisfile(-3){0,1}\.dll$',
-     ['vorbis']),
-    ('VORBIS', 'vorbis', r'(lib){0,1}vorbis(-0){0,1}\.dll$', ['ogg']),
+     ['VORBIS']),
+    ('VORBIS', 'vorbis', r'(lib){0,1}vorbis(-0){0,1}\.dll$', ['OGG']),
     ('OGG', 'ogg', r'(lib){0,1}ogg(-0){0,1}\.dll$', []),
     ('SMPEG', 'smpeg', r'(lib){0,1}smpeg\.dll$', ['SDL']),
     ('IMAGE', 'SDL_image', r'(lib){0,1}SDL_image\.dll$',
-     ['SDL', 'jpeg', 'png', 'tiff']),
-    ('TIFF', 'tiff', r'(lib){0,1}tiff\.dll$',  ['jpeg', 'z']),
+     ['SDL', 'JPEG', 'PNG', 'TIFF']),
+    ('TIFF', 'tiff', r'(lib){0,1}tiff\.dll$',  ['JPEG', 'Z']),
     ('JPEG', 'jpeg', r'(lib){0,1}jpeg\.dll$', []),
-    ('PNG', 'png', r'(lib){0,1}png(1[23])(-0){0,1}\.dll$', ['z']),
-    ('FONT', 'SDL_ttf', r'(lib){0,1}SDL_ttf\.dll$', ['freetype', 'SDL']),
-    ('FREETYPE', 'freetype', r'(lib)freetype(-6)\.dll$', ['z']),
+    ('PNG', 'png12', r'(lib){0,1}png(1[23])(-0){0,1}\.dll$', ['Z']),
+    ('FONT', 'SDL_ttf', r'(lib){0,1}SDL_ttf\.dll$', ['FREETYPE', 'SDL']),
+    ('FREETYPE', 'freetype', r'(lib){0,1}freetype(-6){0,1}\.dll$', ['Z']),
     ('Z', 'z', r'zlib1\.dll$', []),
     ('SDL', 'SDL', r'(lib){0,1}SDL\.dll$', [])
 ]
 file_root_names = {}
 for name, root, regex, deps in libraries:
     regexs[name] = regex
-    lib_dependencies[root] = deps
+    lib_dependencies[name] = deps
     file_root_names[name] = root
 del name, root, regex, deps
 
     test.library_name = name  # Available for debugging.
     return test
 
-def dependencies(roots):
-    """Return a set of dependencies for the list of library file roots
+def dependencies(names):
+    """Return a set of dependencies for the list of library names
 
-    The return set is a dictionary keyed on library root name with values of 1.
+    The return set is a dictionary keyed on library name with values of 1.
     """
 
-    root_set = {}
-    for root in roots:
+    name_set = {}
+    for name in names:
         try:
-            deps = lib_dependencies[root]
+            deps = lib_dependencies[name]
         except KeyError:
             pass
         else:
-            root_set[root] = 1
-            root_set.update(dependencies(deps))
-    return root_set
+            name_set[name] = 1
+            name_set.update(dependencies(deps))
+    return name_set
 
 def name_to_root(name):
     """Return the library file root for the library name"""