From f6d705bc8d3b30c8e65b9605c306c91aedfc2228 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 15 Feb 2010 20:06:35 +0100 Subject: [PATCH] More pygame cleanups. It at least compiles now. --- pygame/Makefile | 8 ++- ...10-fix-paths.patch => 010-fix-paths.patch} | 39 +++++++++-- pygame/patches/020-scrup-stub.patch | 68 +++++++++++++++++++ 3 files changed, 109 insertions(+), 6 deletions(-) rename pygame/patches/{10-fix-paths.patch => 010-fix-paths.patch} (71%) create mode 100644 pygame/patches/020-scrup-stub.patch diff --git a/pygame/Makefile b/pygame/Makefile index fa10c5a..42b2757 100644 --- a/pygame/Makefile +++ b/pygame/Makefile @@ -26,7 +26,13 @@ define Package/pygame/description endef define Build/Compile - $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr",LOCALBASE="$(STAGING_DIR)/usr") + $(call Build/Compile/PyMod,,\ + install \ + --prefix="$(PKG_INSTALL_DIR)/usr" \ + , \ + LOCALBASE="$(STAGING_DIR)/usr" \ + NO_SCRAP=1 \ + ) endef define Package/pygame/install diff --git a/pygame/patches/10-fix-paths.patch b/pygame/patches/010-fix-paths.patch similarity index 71% rename from pygame/patches/10-fix-paths.patch rename to pygame/patches/010-fix-paths.patch index e53d9be..ac1bc49 100644 --- a/pygame/patches/10-fix-paths.patch +++ b/pygame/patches/010-fix-paths.patch @@ -20,8 +20,8 @@ index 1cece2a..0fec7e0 100644 + 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() ++ cflags = os.popen('%s %s --cflags 2> /dev/null' % (command, lib)).readline().strip() ++ libs = os.popen('%s %s --libs 2> /dev/null' % (command, lib)).readline().strip() + + self.ver = version + self.found = 1 @@ -42,7 +42,7 @@ index 1cece2a..0fec7e0 100644 class Dependency: def __init__(self, name, checkhead, checklib, libs): self.name = name -@@ -137,13 +170,13 @@ sdl_lib_name = 'SDL' +@@ -137,18 +170,22 @@ sdl_lib_name = 'SDL' def main(): print ('\nHunting dependencies...') DEPS = [ @@ -56,10 +56,20 @@ index 1cece2a..0fec7e0 100644 - Dependency('PNG', 'png.h', 'libpng', ['png']), + DependencyPkgConfig('PNG', 'libpng'), Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']), - Dependency('SCRAP', '', 'libX11', ['X11']), +- Dependency('SCRAP', '', 'libX11', ['X11']), Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']), Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']), -@@ -159,10 +182,10 @@ def main(): + #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']), + ] ++ if not os.environ.get('NO_SCRAP', None): ++ DEPS += Dependency('SCRAP', '', 'libX11', ['X11']), ++ else: ++ DEPS += Dependency('SCRAP', '', '', []), ++ + if not DEPS[0].found: + print ('Unable to run "sdl-config". Please make sure a development version of SDL is installed.') + raise SystemExit +@@ -159,10 +186,10 @@ def main(): else: incdirs = [] libdirs = [] @@ -75,3 +85,22 @@ index 1cece2a..0fec7e0 100644 for arg in DEPS[0].cflags.split(): if arg[:2] == '-I': + +--- a/config_unix.py ++++ b/config_unix.py +@@ -182,15 +209,6 @@ def main(): + for d in DEPS: + d.configure(incdirs, libdirs) + +- for d in DEPS[1:]: +- if not d.found: +- if not confirm(""" +-Warning, some of the pygame dependencies were not found. Pygame can still +-compile and install, but games that depend on those missing dependencies +-will not run. Would you like to continue the configuration?"""): +- raise SystemExit +- break +- + return DEPS + + if __name__ == '__main__': diff --git a/pygame/patches/020-scrup-stub.patch b/pygame/patches/020-scrup-stub.patch new file mode 100644 index 0000000..e6e3b75 --- /dev/null +++ b/pygame/patches/020-scrup-stub.patch @@ -0,0 +1,68 @@ +--- a/src/scrap.c ++++ b/src/scrap.c +@@ -70,7 +70,7 @@ static uint32_t _cliptype = 0; + #define MAC_SCRAP + #include "scrap_mac.c" + #else +- #error Unknown window manager for clipboard handling ++ #include "scrap_stub.c" + #endif /* scrap type */ + + /** +--- /dev/null ++++ b/src/scrap_stub.c +@@ -0,0 +1,54 @@ ++/* ++ pygame - Python Game Library ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Library General Public ++ License as published by the Free Software Foundation; either ++ version 2 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Library General Public License for more details. ++ ++ You should have received a copy of the GNU Library General Public ++ License along with this library; if not, write to the Free ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++*/ ++ ++ ++int ++pygame_scrap_init (void) ++{ ++ return 1; ++} ++ ++int ++pygame_scrap_lost (void) ++{ ++ return 0; ++} ++ ++int ++pygame_scrap_put (char *type, int srclen, char *src) ++{ ++ return 1; ++} ++ ++char* ++pygame_scrap_get (char *type, unsigned long *count) ++{ ++ return NULL; ++} ++ ++int ++pygame_scrap_contains (char *type) ++{ ++ return 0; ++} ++ ++char** ++pygame_scrap_get_types (void) ++{ ++ return NULL; ++}