lol

pygame: update to 1.9.1

Enable PNG and JPEG support
Use pygame-v4l patch from AUR

+108 -29
+20 -29
pkgs/development/python-modules/pygame/default.nix
··· 1 - { fetchurl, stdenv, python, pkgconfig, SDL, SDL_image, SDL_mixer, SDL_ttf 2 - , numeric }: 1 + { stdenv, fetchurl, python, pkgconfig 2 + , SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, libjpeg 3 + }: 3 4 4 5 stdenv.mkDerivation { 5 - name = "pygame-1.7"; 6 + name = "pygame-1.9.1"; 6 7 7 8 src = fetchurl { 8 - url = http://www.pygame.org/ftp/pygame-1.7.1release.tar.gz ; 9 - sha256 = "0hl0rmgjcqj217fibwyilz7w9jpg0kh7hsa7vyzd4cgqyliskpqi"; 9 + url = "http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz"; 10 + sha256 = "0cyl0ww4fjlf289pjxa53q4klyn55ajvkgymw0qrdgp4593raq52"; 10 11 }; 11 12 12 - buildInputs = [python pkgconfig SDL SDL_image SDL_ttf numeric]; 13 - 14 - configurePhase = '' 15 - export LOCALBASE=/// 16 - sed -e "/origincdirs =/a'${SDL_image}/include/SDL','${SDL_image}/include'," -i config_unix.py 17 - sed -e "/origlibdirs =/aoriglibdirs += '${SDL_image}/lib'," -i config_unix.py 18 - sed -e "/origincdirs =/a'${SDL_mixer}/include/SDL','${SDL_mixer}/include'," -i config_unix.py 19 - sed -e "/origlibdirs =/aoriglibdirs += '${SDL_mixer}/lib'," -i config_unix.py 20 - sed -e "/origincdirs =/a'${SDL_ttf}/include/SDL','${SDL_ttf}/include'," -i config_unix.py 21 - sed -e "/origlibdirs =/aoriglibdirs += '${SDL_ttf}/lib'," -i config_unix.py 22 - sed -e "/origincdirs =/a'${numeric}/include/python2.5'," -i config_unix.py 13 + buildInputs = [ 14 + python pkgconfig SDL SDL_image SDL_mixer SDL_ttf libpng libjpeg 15 + ]; 23 16 24 - sed -e "s|get_python_inc(0)|\"${numeric}/include/python2.5\"|g" -i config_unix.py 17 + patches = [ ./pygame-v4l.patch ]; 25 18 26 - # XXX: `Numeric.pth' should be found by Python but it's not, hence the 27 - # $PYTHONPATH setting below. Gobolinux has the same problem: 28 - # http://bugs.python.org/issue1431 . 29 - yes Y | \ 30 - PYTHONPATH="${numeric}/lib/python2.5/site-packages/Numeric:$PYTHONPATH" \ 31 - python config.py 19 + configurePhase = '' 20 + for i in ${SDL_image} ${SDL_mixer} ${SDL_ttf} ${libpng} ${libjpeg}; do 21 + sed -e "/origincdirs =/a'$i/include'," -i config_unix.py 22 + sed -e "/origlibdirs =/aoriglibdirs += '$i/lib'," -i config_unix.py 23 + done 32 24 33 - # That `config.py' is really deeply broken. 34 - sed -i Setup \ 35 - -e "s|^NUMERIC *=.*$|NUMERIC = -I${numeric}/include/python2.5|g ; 36 - s|^MIXER *=.*$|MIXER = -I${SDL_mixer}/include -L${SDL_mixer}/lib -lSDL_mixer|g" 25 + yes Y | LOCALBASE=/ python config.py 37 26 ''; 38 27 39 - buildPhase = "yes Y | python setup.py build"; 28 + buildPhase = "python setup.py build"; 40 29 41 - installPhase = "yes Y | python setup.py install --prefix=\${out} "; 30 + installPhase = "python setup.py install --prefix=$out"; 42 31 43 32 meta = { 44 33 description = "Python library for games"; 34 + homepage = "http://www.pygame.org/"; 35 + licences = "LGPLv2.1+"; 45 36 }; 46 37 }
+88
pkgs/development/python-modules/pygame/pygame-v4l.patch
··· 1 + diff -crB pygame-1.9.1release/Setup.in pygame-1.9.1release-v4lpatch//Setup.in 2 + *** pygame-1.9.1release/Setup.in Thu Jul 2 06:41:56 2009 3 + --- pygame-1.9.1release-v4lpatch//Setup.in Thu Mar 24 17:31:22 2011 4 + *************** 5 + *** 34,40 **** 6 + _numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG) 7 + movie src/movie.c $(SDL) $(SMPEG) $(DEBUG) 8 + scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG) 9 + ! _camera src/_camera.c src/camera_v4l2.c src/camera_v4l.c $(SDL) $(DEBUG) 10 + pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG) 11 + 12 + GFX = src/SDL_gfx/SDL_gfxPrimitives.c 13 + --- 34,40 ---- 14 + _numericsndarray src/_numericsndarray.c $(SDL) $(MIXER) $(DEBUG) 15 + movie src/movie.c $(SDL) $(SMPEG) $(DEBUG) 16 + scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG) 17 + ! _camera src/_camera.c src/camera_v4l2.c $(SDL) $(DEBUG) 18 + pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG) 19 + 20 + GFX = src/SDL_gfx/SDL_gfxPrimitives.c 21 + diff -crB pygame-1.9.1release/src/_camera.c pygame-1.9.1release-v4lpatch//src/_camera.c 22 + *** pygame-1.9.1release/src/_camera.c Sun Mar 15 20:30:41 2009 23 + --- pygame-1.9.1release-v4lpatch//src/_camera.c Thu Mar 24 16:58:18 2011 24 + *************** 25 + *** 160,179 **** 26 + { 27 + #if defined(__unix__) 28 + if (v4l2_open_device(self) == 0) { 29 + ! if (v4l_open_device(self) == 0) { 30 + ! v4l2_close_device(self); 31 + ! return NULL; 32 + ! } else { 33 + ! self->camera_type = CAM_V4L; 34 + ! if (v4l_init_device(self) == 0) { 35 + ! v4l2_close_device(self); 36 + ! return NULL; 37 + ! } 38 + ! if (v4l_start_capturing(self) == 0) { 39 + ! v4l2_close_device(self); 40 + ! return NULL; 41 + ! } 42 + ! } 43 + } else { 44 + self->camera_type = CAM_V4L2; 45 + if (v4l2_init_device(self) == 0) { 46 + --- 160,167 ---- 47 + { 48 + #if defined(__unix__) 49 + if (v4l2_open_device(self) == 0) { 50 + ! v4l2_close_device(self); 51 + ! return NULL; 52 + } else { 53 + self->camera_type = CAM_V4L2; 54 + if (v4l2_init_device(self) == 0) { 55 + diff -crB pygame-1.9.1release/src/camera.h pygame-1.9.1release-v4lpatch//src/camera.h 56 + *** pygame-1.9.1release/src/camera.h Fri Oct 10 04:37:10 2008 57 + --- pygame-1.9.1release-v4lpatch//src/camera.h Thu Mar 24 16:44:32 2011 58 + *************** 59 + *** 39,45 **** 60 + 61 + #include <asm/types.h> /* for videodev2.h */ 62 + 63 + - #include <linux/videodev.h> 64 + #include <linux/videodev2.h> 65 + #endif 66 + 67 + --- 39,44 ---- 68 + *************** 69 + *** 51,57 **** 70 + #define RGB_OUT 1 71 + #define YUV_OUT 2 72 + #define HSV_OUT 4 73 + - #define CAM_V4L 1 74 + #define CAM_V4L2 2 75 + 76 + struct buffer 77 + --- 50,55 ---- 78 + *************** 79 + *** 111,118 **** 80 + int v4l2_close_device (PyCameraObject* self); 81 + int v4l2_open_device (PyCameraObject* self); 82 + 83 + - /* internal functions specific to v4l */ 84 + - int v4l_open_device (PyCameraObject* self); 85 + - int v4l_init_device(PyCameraObject* self); 86 + - int v4l_start_capturing(PyCameraObject* self); 87 + #endif 88 + --- 109,112 ----