diff mbox

gnu: Add libsmpeg.

Message ID 8737n1tm1f.fsf@openmailbox.org
State New
Headers show

Commit Message

Kei Yamashita July 22, 2016, 9:12 p.m. UTC
Vincent Legoll <vincent.legoll@gmail.com> writes:

>> Pygame's config.py is not finding smpeg-config. This will be fun! Anyone
>> with skill in Python is welcome to offer me assistance!
>
> Maybe I can help, could you elaborate on how to reproduce ?

Sure. Apply the libsmpeg patch and the attached Pygame patch to a copy
of the Guix repo and attempt to build python-pygame. The error is
contained in the build log. I'll copy it below:

starting phase `build'
running "python setup.py" with command "build" and parameters ()


WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...

/gnu/store/b1yqjimbdh5bf9jnizd4h7yf110744j2-bash-4.3.42/bin/sh: smpeg-config: c
ommand not found                                                              

Hunting dependencies...
WARNING: "smpeg-config" failed!
SDL     : found 1.2.15
FONT    : not found
IMAGE   : not found
MIXER   : not found
SMPEG   : not found
PNG     : not found
JPEG    : not found
SCRAP   : found
PORTMIDI: not found
PORTTIME: not found


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? [Y/n]:Traceback (mo
st recent call last):                                                         
  File "setup.py", line 132, in <module>
    config.main()
  File "/tmp/guix-build-python-pygame-1.9.1.drv-0/pygame-1.9.1release/config.py
", line 137, in main                                                          
    deps = CFG.main()
  File "/tmp/guix-build-python-pygame-1.9.1.drv-0/pygame-1.9.1release/config_un
ix.py", line 180, in main                                                     
    will not run. Would you like to continue the configuration?"""):
  File "/tmp/guix-build-python-pygame-1.9.1.drv-0/pygame-1.9.1release/config_un
ix.py", line 24, in confirm                                                   
    reply = raw_input('\n' + message + ' [Y/n]:')
EOFError: EOF when reading a line
phase `build' failed after 0.8 seconds
builder for `/gnu/store/fgrm7ph1z050mldbzwg4s872373lqj1j-python-pygame-1.9.1.dr
v' failed with exit code 1                                                    
guix package: error: build failed: build of `/gnu/store/fgrm7ph1z050mldbzwg4s87
2373lqj1j-python-pygame-1.9.1.drv' failed
From f15ce6a6050543ad6da623dd5758c114ec95fd60 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Fri, 22 Jul 2016 17:06:11 -0400
Subject: [PATCH] gnu: Add python-pygame.

* gnu/packages/game-development.scm (python-pygame): Add python-pygame.
---
 gnu/packages/game-development.scm | 44 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

Comments

Vincent Legoll July 22, 2016, 10:21 p.m. UTC | #1
>     reply = raw_input('\n' + message + ' [Y/n]:')
> EOFError: EOF when reading a line

That setup.py is handcrafted, and is interactive. It asks a
question to the user and waits for a keypress in return.

And it looks like it is getting EOF instead of a keypress.

I see 2 solutions, either you find a way to answer its question,
I think I remember having seen some package that does this,
but cannot find it now. :-/

I think it was done with (display "Y" port) and port should be
the stdin of setup.py

You'll have to hunt that scm example.

hope that helps
Vincent Legoll July 22, 2016, 10:25 p.m. UTC | #2
> I see 2 solutions

The other solution could be to patch the setup.py script, if you
want to do that I'll tell you what to change
Kei Yamashita July 27, 2016, 3:21 p.m. UTC | #3
Vincent Legoll <vincent.legoll@gmail.com> writes:

>> I see 2 solutions
>
> The other solution could be to patch the setup.py script, if you
> want to do that I'll tell you what to change

I want to try patching the setup.py script, that way I could see how
pygame tries to detect the libraries that it says are missing.
Vincent Legoll July 29, 2016, 12:42 p.m. UTC | #4
>>> I see 2 solutions
>>
>> The other solution could be to patch the setup.py script, if you
>> want to do that I'll tell you what to change
>
> I want to try patching the setup.py script, that way I could see how
> pygame tries to detect the libraries that it says are missing.

Could you try the attached untested patch, that will avoid user interaction.
diff mbox

Patch

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 7067a71..e3ecc79 100644
--- 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,6 +42,7 @@ 
   #: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 qt)
   #:use-module (gnu packages compression)
@@ -60,7 +62,8 @@ 
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages mp3)
-  #:use-module (gnu packages xml))
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages video))
 
 (define-public bullet
   (package
@@ -512,3 +515,42 @@  It offers the following features:
 OpenGL programs with character rendering services via an application programming
 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://www.pygame.org/ftp/pygame-"
+                                  version "release.tar.gz"))
+              (sha256
+               (base32
+                "0cyl0ww4fjlf289pjxa53q4klyn55ajvkgymw0qrdgp4593raq52"))))
+    (build-system python-build-system)
+    (inputs `(("libpng" ,libpng)
+              ("libjpeg" ,libjpeg)
+              ("libsmpeg" ,libsmpeg)
+              ("portmidi" ,portmidi)
+              ("sdl" ,sdl)
+              ("sdl-ttf" ,sdl-ttf)
+              ("sdl-image" ,sdl-image)
+              ("sdl-mixer" ,sdl-mixer)))
+    (home-page "http://www.pygame.org")
+    (synopsis "Set of Python modules designed for writing games using SDL")
+    (description
+     "Pygame is a cross-platform library designed to make it easy to write
+multimedia software, such as games, in Python. Pygame requires the Python
+language and SDL multimedia library. It can also make use of several other
+popular libraries.")
+    (license (list license:bsd-2
+                   ;; python numeric license as listed by Debian looks like
+                   ;; an Expat-style license with a warranty disclaimer for
+                   ;; the U.S. government and the University of California.
+                   license:expat
+                   license:lgpl2.0+
+                   license:lgpl2.1+
+                   license:gpl3+
+                   license:psfl
+                   license:public-domain))))