[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add libsmpeg.

From: Roel Janssen
Subject: Re: [PATCH] gnu: Add libsmpeg.
Date: Sat, 23 Jul 2016 09:27:19 +0200
User-agent: mu4e 0.9.17; emacs 24.5.1

Hello Kei,

I had patches for PyGame including SMPEG as well.  Here's what I did:

(define-public python-pygame
    (name "python-pygame")
    (version "1.9.1")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
    (build-system gnu-build-system)
     `(#:tests? #f ; Tests require pygame to be installed first.
       (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* ""
                 (("SDL = -I/usr/include/SDL")
                  (string-append "SDL = -I" sdl-ref "/include/SDL -I.")))
               (substitute* ""
                 (("FONT = -lSDL_ttf")
                  (string-append "FONT = -I" font-ref "/include/SDL -L"
                                             font-ref "/lib -lSDL_ttf")))
               (substitute* ""
                 (("IMAGE = -lSDL_image")
                  (string-append "IMAGE = -I" image-ref "/include/SDL -L"
                                              image-ref "/lib -lSDL_image")))
               (substitute* ""
                 (("MIXER = -lSDL_mixer")
                  (string-append "MIXER = -I" mixer-ref "/include/SDL -L"
                                              mixer-ref "/lib -lSDL_mixer")))
               (substitute* ""
                 (("SMPEG = -lsmpeg")
                  (string-append "SMPEG = -I" smpeg-ref "/include/smpeg -L"
                                              smpeg-ref "/lib -lsmpeg")))
               (substitute* ""
                 (("PNG = -lpng")
                  (string-append "PNG = -I" png-ref "/include -L"
                                            png-ref "/lib -lpng")))
               (substitute* ""
                 (("JPEG = -ljpeg")
                  (string-append "JPEG = -I" jpeg-ref "/include -L"
                                 jpeg-ref "/lib -ljpeg")))
               (substitute* ""
                 (("^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")
               (system* "ln" "--symbolic" "" "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" "" "install"
                      (string-append "--install-lib="
                                     (assoc-ref outputs "out"))))))))
     `(("python-setuptools" ,python-setuptools)))
     `(("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 "";)
    (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 <address@hidden> 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 is not finding smpeg-config. This will be fun! Anyone
> with skill in Python is welcome to offer me assistance!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]