From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: [PATCH] gnu: Add python-pygame. Date: Fri, 29 Jul 2016 17:13:33 -0400 Message-ID: <87bn1grvuq.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTF6s-0002F2-5r for guix-devel@gnu.org; Fri, 29 Jul 2016 17:14:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTF6n-00008s-Un for guix-devel@gnu.org; Fri, 29 Jul 2016 17:14:21 -0400 Received: from mail.openmailbox.org ([62.4.1.34]:48624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTF6n-00008i-Jq for guix-devel@gnu.org; Fri, 29 Jul 2016 17:14:17 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain The python-pygame patch as promised. Note that it requires the application of the most recently submitted libsmpeg patch. Would anyone else like to test this? :-) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-gnu-Add-python-pygame.patch Content-Transfer-Encoding: quoted-printable From=20644a7e3e274f854f1487ab36bef59bba2003887c Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 29 Jul 2016 17:11:59 -0400 Subject: [PATCH] gnu: Add python-pygame. * gnu/packages/game-development.scm (python-pygame): New variable. =2D-- gnu/packages/game-development.scm | 93 +++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 93 insertions(+) diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-developm= ent.scm index 7067a71..86471b1 100644 =2D-- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -31,6 +31,7 @@ #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (gnu packages) #:use-module (gnu packages curl) #:use-module (gnu packages databases) @@ -41,8 +42,11 @@ #:use-module (gnu packages gnunet) #:use-module (gnu packages guile) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages music) #:use-module (gnu packages ncurses) + #:use-module (gnu packages python) #:use-module (gnu packages qt) + #:use-module (gnu packages video) #:use-module (gnu packages compression) #:use-module (gnu packages zip) #:use-module (gnu packages gl) @@ -512,3 +516,92 @@ It offers the following features: OpenGL programs with character rendering services via an application progr= amming interface (API).") (license (list license:expat license:lgpl2.1+)))) + +(define-public python-pygame + (package + (name "python-pygame") + (version "1.9.1") + (source (origin + (method url-fetch) + (uri (string-append "http://pygame.org/ftp/pygame-" + version "release.tar.gz")) + (sha256 + (base32 + "0cyl0ww4fjlf289pjxa53q4klyn55ajvkgymw0qrdgp4593raq52")))) + (build-system python-build-system) + (arguments + `(#:python ,python-2 + #:tests? #f ; Tests require pygame to be installed first. + #:phases + (modify-phases %standard-phases + ;; Set the paths to the dependencies manually because + ;; the configure script does not allow passing them as + ;; parameters. This also means we can skip the configure + ;; phase. + (add-before 'build 'set-library-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((sdl-ref (assoc-ref inputs "sdl")) + (font-ref (assoc-ref inputs "sdl-ttf")) + (image-ref (assoc-ref inputs "sdl-image")) + (mixer-ref (assoc-ref inputs "sdl-mixer")) + (smpeg-ref (assoc-ref inputs "libsmpeg")) + (png-ref (assoc-ref inputs "libpng")) + (jpeg-ref (assoc-ref inputs "libjpeg")) + (v4l-ref (assoc-ref inputs "v4l-utils")) + (out-ref (assoc-ref outputs "out"))) + (substitute* "Setup.in" + (("SDL =3D -I/usr/include/SDL") + (string-append "SDL =3D -I" sdl-ref "/include/SDL -I."))) + (substitute* "Setup.in" + (("FONT =3D -lSDL_ttf") + (string-append "FONT =3D -I" font-ref "/include/SDL -L" + font-ref "/lib -lSDL_ttf"))) + (substitute* "Setup.in" + (("IMAGE =3D -lSDL_image") + (string-append "IMAGE =3D -I" image-ref "/include/SDL -L" + image-ref "/lib -lSDL_image"= ))) + (substitute* "Setup.in" + (("MIXER =3D -lSDL_mixer") + (string-append "MIXER =3D -I" mixer-ref "/include/SDL -L" + mixer-ref "/lib -lSDL_mixer"= ))) + (substitute* "Setup.in" + (("SMPEG =3D -lsmpeg") + (string-append "SMPEG =3D -I" smpeg-ref "/include/smpeg = -L" + smpeg-ref "/lib -lsmpeg"))) + (substitute* "Setup.in" + (("PNG =3D -lpng") + (string-append "PNG =3D -I" png-ref "/include -L" + png-ref "/lib -lpng"))) + (substitute* "Setup.in" + (("JPEG =3D -ljpeg") + (string-append "JPEG =3D -I" jpeg-ref "/include -L" + jpeg-ref "/lib -ljpeg"))) + (substitute* "Setup.in" + (("^pypm") "#pypm")) + (substitute* "src/movie.c") + ;; Create a path to a header file provided by v4l-utils. + (system* "mkdir" "linux") + (system* "ln" "--symbolic" + (string-append v4l-ref "/include/libv4l1-videodev.= h") + "linux/videodev.h") + (system* "ln" "--symbolic" "Setup.in" "Setup"))))))) + ;; The default tries to install libraries into the python directo= ry. + ;; Using --install-lib, we can provide the correct path. + (native-inputs + `(("python-setuptools" ,python-setuptools))) + (inputs + `(("sdl" ,sdl) + ("sdl-image" ,sdl-image) + ("sdl-mixer" ,sdl-mixer) + ("sdl-ttf" ,sdl-ttf) + ("sdl-gfx" ,sdl-gfx) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libX11" ,libx11) + ("libsmpeg" ,libsmpeg) + ("portmidi" ,portmidi) + ("v4l-utils" ,v4l-utils))) + (home-page "http://www.pygame.org") + (synopsis "SDL wrapper for Python") + (description "") + (license license:lgpl2.1+))) =2D-=20 2.9.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXm8b9AAoJEOal7jwZRnoNPwwP/1+H1H1T6+X81wL9M8teiZZx QeK3NbFzBSw4K1roZYuDBdjjYt2AsbpgtX4aadFiWHlUolbf9ZVube6yTYBEqJ5I 9kBFYsdF6DW7JERz51ftsa0CLxvPAf7EXwavBDtlrjiSXcDF93j+EOTL26lsiAFc zs2AnsL0Cv8+g1442cQLThGMtP51e8DWSO67+CXOeHy2jN635zkjlKLh9RyWucK6 5BXcHeA9vqrDy9J2uLZp2CAgQxiBYUgX2OtawYFYRNw4NF7dCApB3vGDLW9mUeU3 KQ1ouvLsKFwnl/nJd04WJJWz42KZclK19U5BqFqCnWlMsw1ffDCbcv/TwkO2qqQK BlQ3GOgIha3VbjBr5qSMIMD5/BpIO/eMz4WvonPI5tgTqg7ia0o40ESCEa6j51/y uAH5gi7rGaSLI1ODgGwDWv63g8LuxGN3UEZWOxkrgDKG2iHqE9F/Zymocpjn5h9k JVcX/ZgDsBZLQd0WPywxncVMK7ADHL0BmQMjjLI8csqja+SquMIiNunt7XZNasOr NXK8ZV4uR86THkfgVR5SCSoQn3bSjk11srZEr/w9r/KvbTNpGWwIKCb3Xeyaesak 7ZDW0lkdlEscGWPRBtNI7GvoeJkWGvRmEB39qZFw12n2DR+9IUxnjovD3EiWc/CU WN3iNP6en4m+ww08xpbb =meZT -----END PGP SIGNATURE----- --==-=-=--