From 9aaeb4623d3ff5746e665bc17914eefd292b7dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BChling?= Date: Sun, 2 Jan 2011 15:19:00 +0100 Subject: New OpenWrt package for GNU Octave. Experimental/probably still broken. Work in progress. Committing it as compilation seems to take forever. Not sure whether I can finish this within a few days. --- pygame/Makefile | 45 +++++++++++++++ pygame/patches/010-fix-paths.patch | 106 ++++++++++++++++++++++++++++++++++++ pygame/patches/020-scrup-stub.patch | 68 +++++++++++++++++++++++ 3 files changed, 219 insertions(+) create mode 100644 pygame/Makefile create mode 100644 pygame/patches/010-fix-paths.patch create mode 100644 pygame/patches/020-scrup-stub.patch (limited to 'pygame') diff --git a/pygame/Makefile b/pygame/Makefile new file mode 100644 index 0000000..42b2757 --- /dev/null +++ b/pygame/Makefile @@ -0,0 +1,45 @@ +# This is free software, licensed under the GNU General Public License +# v3. See /LICENSE for more information. +include $(TOPDIR)/rules.mk + +PKG_NAME:=pygame +PKG_VERSION:=1.9.1release +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.pygame.org/ftp/ + +PKG_BUILD_DEPENDS:=python + +include $(INCLUDE_DIR)/package.mk +-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk) + +define Package/pygame + SUBMENU:=Python + SECTION:=lang + CATEGORY:=Languages + TITLE:=pygame + URL:=http://pygame.org + DEPENDS:=+python-mini +libsdl +libpng +libjpeg +libsdl-image +libsdl-mixer +endef + +define Package/pygame/description +endef + +define Build/Compile + $(call Build/Compile/PyMod,,\ + install \ + --prefix="$(PKG_INSTALL_DIR)/usr" \ + , \ + LOCALBASE="$(STAGING_DIR)/usr" \ + NO_SCRAP=1 \ + ) +endef + +define Package/pygame/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) \ + $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \ + $(1)$(PYTHON_PKG_DIR) +endef + +$(eval $(call BuildPackage,pygame)) diff --git a/pygame/patches/010-fix-paths.patch b/pygame/patches/010-fix-paths.patch new file mode 100644 index 0000000..ac1bc49 --- /dev/null +++ b/pygame/patches/010-fix-paths.patch @@ -0,0 +1,106 @@ +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().strip() ++ libs = os.popen('%s %s --libs 2> /dev/null' % (command, lib)).readline().strip() ++ ++ 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,18 +170,22 @@ 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']), + #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 = [] +- 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': + + +--- 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; ++} -- cgit v1.2.3