From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roel Janssen Subject: Re: [PATCH] gnu: Add libsmpeg. Date: Sat, 23 Jul 2016 09:27:19 +0200 Message-ID: <87invw24rs.fsf@gnu.org> References: <87bn1pu4lx.fsf@openmailbox.org> <877fcdtq97.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrKv-0000dM-4P for guix-devel@gnu.org; Sat, 23 Jul 2016 03:27:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrKr-0000CW-UQ for guix-devel@gnu.org; Sat, 23 Jul 2016 03:27:01 -0400 In-reply-to: <877fcdtq97.fsf@openmailbox.org> 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: Kei Kebreau Cc: guix-devel@gnu.org Hello Kei, I had patches for PyGame including SMPEG as well. Here's what I did: (define-public python-pygame (package (name "python-pygame") (version "1.9.1") (source (origin (method url-fetch) (uri (string-append "https://github.com/illume/pygame/archive/release_" (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version) "release.tar.gz")) (sha256 (base32 "0cbfff7lv15pgw5hifnj6hx4c63g1v9lyi3f8l47gjda3pbpkria")))) (build-system gnu-build-system) (arguments `(#: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. (replace 'configure (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 "smpeg")) (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 = -I/usr/include/SDL") (string-append "SDL = -I" sdl-ref "/include/SDL -I."))) (substitute* "Setup.in" (("FONT = -lSDL_ttf") (string-append "FONT = -I" font-ref "/include/SDL -L" font-ref "/lib -lSDL_ttf"))) (substitute* "Setup.in" (("IMAGE = -lSDL_image") (string-append "IMAGE = -I" image-ref "/include/SDL -L" image-ref "/lib -lSDL_image"))) (substitute* "Setup.in" (("MIXER = -lSDL_mixer") (string-append "MIXER = -I" mixer-ref "/include/SDL -L" mixer-ref "/lib -lSDL_mixer"))) (substitute* "Setup.in" (("SMPEG = -lsmpeg") (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L" smpeg-ref "/lib -lsmpeg"))) (substitute* "Setup.in" (("PNG = -lpng") (string-append "PNG = -I" png-ref "/include -L" png-ref "/lib -lpng"))) (substitute* "Setup.in" (("JPEG = -ljpeg") (string-append "JPEG = -I" jpeg-ref "/include -L" jpeg-ref "/lib -ljpeg"))) (substitute* "Setup.in" (("^pypm") "#pypm")) ;; 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 directory. ;; Using --install-lib, we can provide the correct path. (replace 'install (lambda* (#:key outputs #:allow-other-keys) (system* "python" "setup.py" "install" (string-append "--install-lib=" (assoc-ref outputs "out")))))))) (native-inputs `(("python-setuptools" ,python-setuptools))) (inputs `(("python" ,python-2) ("sdl" ,sdl) ("sdl-image" ,sdl-image) ("sdl-mixer" ,sdl-mixer) ("sdl-ttf" ,sdl-ttf) ("sdl-gfx" ,sdl-gfx) ("libjpeg" ,libjpeg) ("libpng" ,libpng) ("libX11" ,libx11) ("smpeg" ,smpeg) ("portmidi" ,portmidi) ("v4l-utils" ,v4l-utils))) (home-page "http://www.pygame.org") (synopsis "SDL wrapper for Python") (description "") (license lgpl2.1+))) Hope you can adapt it to your needs. Kind regards, Roel Janssen Kei Kebreau writes: > Kei Kebreau writes: > >> This is a preliminary patch for pygame. I don't really have a test case >> for it outside of (hopefully) a successful build of pygame. We'll see >> how it goes. > > Pygame's config.py is not finding smpeg-config. This will be fun! Anyone > with skill in Python is welcome to offer me assistance!