From 608c1b748e8d6b43f65f63a2bbc238ed3a173fed Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 15 Feb 2010 16:31:29 +0100 Subject: [PATCH] Some pygame cleanups/fixes --- pygame/Makefile | 5 +- pygame/patches/10-fix-paths.patch | 77 +++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 pygame/patches/10-fix-paths.patch diff --git a/pygame/Makefile b/pygame/Makefile index 5c7d8bd..fa10c5a 100644 --- a/pygame/Makefile +++ b/pygame/Makefile @@ -19,15 +19,14 @@ define Package/pygame CATEGORY:=Languages TITLE:=pygame URL:=http://pygame.org - DEPENDS:=+python-mini +libsdl + DEPENDS:=+python-mini +libsdl +libpng +libjpeg +libsdl-image +libsdl-mixer endef define Package/pygame/description - serial port python bindings endef define Build/Compile - $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr") + $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr",LOCALBASE="$(STAGING_DIR)/usr") endef define Package/pygame/install diff --git a/pygame/patches/10-fix-paths.patch b/pygame/patches/10-fix-paths.patch new file mode 100644 index 0000000..e53d9be --- /dev/null +++ b/pygame/patches/10-fix-paths.patch @@ -0,0 +1,77 @@ +diff --git a/config_unix.py b/config_unix.py +index 1cece2a..0fec7e0 100644 +--- a/config_unix.py ++++ b/config_unix.py +@@ -69,6 +69,39 @@ class DependencyProg: + else: + print (self.name + ' '[len(self.name):] + ': not found') + ++class DependencyPkgConfig: ++ def __init__(self, name, lib): ++ self.name = name ++ self.lib_dir = '' ++ self.inc_dir = '' ++ self.libs = [] ++ self.cflags = '' ++ command = os.environ.get('PKG_CONFIG', 'pkg-config') ++ try: ++ version = os.popen('%s %s --modversion 2> /dev/null' % (command, lib)).readline() ++ if not version.strip(): ++ self.found = 0 ++ return ++ ++ cflags = os.popen('%s %s --cflags 2> /dev/null' % (command, lib)).readline() ++ libs = os.popen('%s %s --libs 2> /dev/null' % (command, lib)).readline() ++ ++ self.ver = version ++ self.found = 1 ++ ++ self.cflags = '%s %s' % (cflags, libs) ++ except Exception, e: ++ print e ++ print ('WARNING: "pkg-config" failed!') ++ self.found = 0 ++ self.ver = '0' ++ ++ def configure(self, incdirs, libdir): ++ if self.found: ++ print (self.name + ' '[len(self.name):] + ': found ' + self.ver) ++ else: ++ print (self.name + ' '[len(self.name):] + ': not found') ++ + class Dependency: + def __init__(self, name, checkhead, checklib, libs): + self.name = name +@@ -137,13 +170,13 @@ sdl_lib_name = 'SDL' + def main(): + print ('\nHunting dependencies...') + DEPS = [ +- DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']), ++ DependencyPkgConfig('SDL', 'sdl'), + Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', ['SDL_ttf']), +- Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', ['SDL_image']), ++ DependencyPkgConfig('IMAGE', 'SDL_image'), + Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', ['SDL_mixer']), + DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', ['smpeg']), +- Dependency('PNG', 'png.h', 'libpng', ['png']), ++ DependencyPkgConfig('PNG', 'libpng'), + Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']), + Dependency('SCRAP', '', 'libX11', ['X11']), + Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']), + Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']), +@@ -159,10 +182,10 @@ def main(): + else: + incdirs = [] + libdirs = [] +- incdirs += ["/usr"+d for d in origincdirs] +- libdirs += ["/usr"+d for d in origlibdirs] +- incdirs += ["/usr/local"+d for d in origincdirs] +- libdirs += ["/usr/local"+d for d in origlibdirs] ++# incdirs += ["/usr"+d for d in origincdirs] ++# libdirs += ["/usr"+d for d in origlibdirs] ++# incdirs += ["/usr/local"+d for d in origincdirs] ++# libdirs += ["/usr/local"+d for d in origlibdirs] + + for arg in DEPS[0].cflags.split(): + if arg[:2] == '-I': +