~ubuntu-branches/ubuntu/maverick/pygame/maverick

« back to all changes in this revision

Viewing changes to config_msys.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-01-14 17:02:11 UTC
  • mfrom: (1.3.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100114170211-21eop2ja7mr9vdcr
Tags: 1.9.1release-0ubuntu1
* New upstream version (lp: #433304)
* debian/control:
  - build-depends on libportmidi-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Requires Python 2.4 or better and win32api.
2
2
 
3
 
"""Config on Msys mingw"""
 
3
"""Config on Msys mingw
 
4
 
 
5
This version expects the Pygame 1.9.0 dependencies as built by
 
6
msys_build_deps.py
 
7
"""
4
8
 
5
9
import dll
 
10
from setup_win_common import get_definitions
6
11
import msys
7
12
import os, sys, string
8
13
from glob import glob
14
19
 
15
20
#these get prefixes with '/usr/local' and /mingw or the $LOCALBASE
16
21
origincdirs = ['/include', '/include/SDL', '/include/SDL11',
17
 
               '/include/smpeg' ]
 
22
               '/include/smpeg', '/include/libpng12', ]
18
23
origlibdirs = ['/lib']
19
24
 
20
25
 
155
160
        else:
156
161
            print_(self.name + '        '[len(self.name):] + ': not found')
157
162
 
158
 
class DependencyWin:
159
 
    needs_dll = False
160
 
    def __init__(self, name, libs):
161
 
        self.name = name
162
 
        self.inc_dir = None
163
 
        self.lib_dir = None
164
 
        self.libs = libs
165
 
        self.found = 1
166
 
        self.cflags = ''
167
 
        
168
 
    def configure(self, incdirs, libdirs):
169
 
        pass
170
 
 
171
163
class DependencyDLL:
172
164
    needs_dll = False
173
165
    def __init__(self, name, libs=None):
174
166
        if libs is None:
175
 
            libs = [dll.name_to_root(name)]
176
 
        self.name = 'COPYLIB_' + name
 
167
            libs = dll.libraries(name)
 
168
        self.name = 'COPYLIB_' + dll.name_to_root(name)
177
169
        self.inc_dir = None
178
170
        self.lib_dir = '_'
179
171
        self.libs = libs
216
208
        # Not found
217
209
        return False
218
210
 
 
211
class DependencyWin:
 
212
    needs_dll = False
 
213
    def __init__(self, name, cflags):
 
214
        self.name = name
 
215
        self.inc_dir = None
 
216
        self.lib_dir = None
 
217
        self.libs = []
 
218
        self.found = 1
 
219
        self.cflags = cflags
 
220
        
 
221
    def configure(self, incdirs, libdirs):
 
222
        pass
 
223
 
219
224
 
220
225
def main():
221
226
    m = msys.Msys(require_mingw=False)
222
227
    print_('\nHunting dependencies...')
223
228
    DEPS = [
224
 
        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', m),
 
229
        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2.13', m),
225
230
        Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.dll.a'),
226
231
        Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.dll.a'),
227
232
        Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.dll.a'),
228
233
        DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', m),
229
 
        Dependency('PNG', 'png.h', 'libpng.dll.a'),
 
234
        Dependency('PNG', 'png.h', 'libpng12.dll.a'),
230
235
        Dependency('JPEG', 'jpeglib.h', 'libjpeg.dll.a'),
231
 
        DependencyWin('SCRAP', ['user32', 'gdi32']),
 
236
        Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.dll.a'),
 
237
        Dependency('PORTTIME', 'portmidi.h', 'libportmidi.dll.a'),
232
238
        DependencyDLL('TIFF'),
233
239
        DependencyDLL('VORBISFILE'),
234
240
        DependencyDLL('VORBIS'),
235
241
        DependencyDLL('OGG'),
 
242
        DependencyDLL('FREETYPE'),
236
243
        DependencyDLL('Z'),
237
244
    ]
238
245
 
265
272
            dll_deps.append(dll_dep)
266
273
 
267
274
    DEPS += dll_deps
 
275
    for d in get_definitions():
 
276
        DEPS.append(DependencyWin(d.name, d.value))
268
277
    for d in DEPS:
269
278
        if isinstance(d, DependencyDLL):
270
279
            if d.lib_dir == '':