diff mbox

: Add bambam

Message ID 20160830204313.GA25061@macbook42.flashner.co.il
State New
Headers show

Commit Message

Efraim Flashner Aug. 30, 2016, 8:43 p.m. UTC
Keyboard mashing game that both of my kids love.

Comments

Leo Famulari Aug. 30, 2016, 9:11 p.m. UTC | #1
On Tue, Aug 30, 2016 at 11:43:13PM +0300, Efraim Flashner wrote:
> Subject: [PATCH] gnu: Add bambam.
> 
> * gnu/packages/games.scm (bambam): New variable.

Looks good!

I had to use my phone to look up how to exit the game :p
Efraim Flashner Aug. 30, 2016, 9:29 p.m. UTC | #2
On Tue, Aug 30, 2016 at 05:11:08PM -0400, Leo Famulari wrote:
> On Tue, Aug 30, 2016 at 11:43:13PM +0300, Efraim Flashner wrote:
> > Subject: [PATCH] gnu: Add bambam.
> > 
> > * gnu/packages/games.scm (bambam): New variable.
> 
> Looks good!
> 
> I had to use my phone to look up how to exit the game :p

I think the first time I went to tty1 and pkilled it, then I read the
source code. I finally read the man page for it, 'mute' to mute the
sounds, 'unmute' to bring it back.

In case anyone is curious, type 'quit' to quit :).
Alex Kost Aug. 31, 2016, 6:56 a.m. UTC | #3
Efraim Flashner (2016-08-30 23:43 +0300) wrote:

> Keyboard mashing game that both of my kids love.

Wow, this is really nice game, thanks!
Alex Kost Aug. 31, 2016, 7:03 a.m. UTC | #4
Only a couple of small things :-)

[...]
> +(define-public bambam
> +  (package
> +    (name "bambam")
> +    (version "0.5")
> +    (source
> +      (origin
> +        (method url-fetch)
> +        (uri (string-append "https://github.com/porridge/bambam/archive/"
> +                            version ".tar.gz"))
> +        (file-name (string-append name "-" version ".tar.gz"))
> +        (sha256
> +         (base32
> +          "10w110mjdwbvddzihh9rganvvjr5jfiz8cs9n7w12zndwwcc3ria"))))
> +    (build-system python-build-system)
> +    (arguments
> +     `(#:python ,python-2
> +       #:tests? #f ; no tests
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'build)
> +         (add-before 'install 'patch-data-dir-location
> +           (lambda _
> +             (substitute* "bambam.py"
> +                          (("'data'")
> +                           "'../share/bambam/data'"))

This is an unusual indentation, I would write:

             (substitute* "bambam.py"
               (("'data'") "'../share/bambam/data'"))


> +             #t))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out   (assoc-ref outputs "out"))
> +                    (bin   (string-append out "/bin"))
> +                    (share (string-append out "/share")))
> +               (mkdir-p bin)
> +               (copy-file "bambam.py" (string-append bin "/bambam"))
> +               (install-file "bambam.6" (string-append share "/man/man6"))
> +               (copy-recursively "data" (string-append share "/bambam/data")))
> +             #t))
> +         (add-after 'install 'wrap-binary
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin/bambam")))
> +               (wrap-program bin
> +                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
> +             #t)))))
> +    (inputs
> +     `(("python-pygame" ,python-pygame)))
> +    (home-page "https://github.com/porridge/bambam")
> +    (synopsis "keyboard mashing and doodling game for babies")
                  Keyboard
"guix lint" reported it should begin with an upper-case letter.

> +    (description "Bambam is a simple baby keyboard (and gamepad) masher
> +application that locks the keyboard and mouse and instead displays bright
> +colors, pictures, and sounds.")
> +    (license license:gpl3+)))
Eric Bavier Aug. 31, 2016, 5:21 p.m. UTC | #5
On Wed, 31 Aug 2016 10:03:37 +0300
Alex Kost <alezost@gmail.com> wrote:

> Only a couple of small things :-)
> 
> [...]
> > +(define-public bambam
> > +  (package
> > +    (name "bambam")
> > +    (version "0.5")
> > +    (source
> > +      (origin
> > +        (method url-fetch)
> > +        (uri (string-append "https://github.com/porridge/bambam/archive/"
> > +                            version ".tar.gz"))
> > +        (file-name (string-append name "-" version ".tar.gz"))
> > +        (sha256
> > +         (base32
> > +          "10w110mjdwbvddzihh9rganvvjr5jfiz8cs9n7w12zndwwcc3ria"))))
> > +    (build-system python-build-system)
> > +    (arguments
> > +     `(#:python ,python-2
> > +       #:tests? #f ; no tests
> > +       #:phases
> > +       (modify-phases %standard-phases
> > +         (delete 'build)
> > +         (add-before 'install 'patch-data-dir-location
> > +           (lambda _
> > +             (substitute* "bambam.py"
> > +                          (("'data'")
> > +                           "'../share/bambam/data'"))  
> 
> This is an unusual indentation, I would write:
> 
>              (substitute* "bambam.py"
>                (("'data'") "'../share/bambam/data'"))
> 
> 
> > +             #t))
> > +         (replace 'install
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let* ((out   (assoc-ref outputs "out"))
> > +                    (bin   (string-append out "/bin"))
> > +                    (share (string-append out "/share")))
> > +               (mkdir-p bin)
> > +               (copy-file "bambam.py" (string-append bin "/bambam"))
> > +               (install-file "bambam.6" (string-append share "/man/man6"))
> > +               (copy-recursively "data" (string-append share "/bambam/data")))
> > +             #t))
> > +         (add-after 'install 'wrap-binary
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let* ((out (assoc-ref outputs "out"))
> > +                    (bin (string-append out "/bin/bambam")))
> > +               (wrap-program bin
> > +                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
> > +             #t)))))
> > +    (inputs
> > +     `(("python-pygame" ,python-pygame)))
> > +    (home-page "https://github.com/porridge/bambam")
> > +    (synopsis "keyboard mashing and doodling game for babies")  
>                   Keyboard
> "guix lint" reported it should begin with an upper-case letter.
> 
> > +    (description "Bambam is a simple baby keyboard (and gamepad) masher
> > +application that locks the keyboard and mouse and instead displays bright
> > +colors, pictures, and sounds.")
> > +    (license license:gpl3+)))  
> 

Since I accidentaly pushed this patch with another batch, I went ahead
and made these changes.  I also removed the wrap-binary phase, which is
handled by python-build-system.  Pushed in
46a0622481c398bd9337522e93f6f9082d2b9015.

Thanks,
`~Eric
diff mbox

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index ed5d7fd..9e44fbc 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -21,7 +21,7 @@ 
 ;;; Copyright © 2016 Albin Söderqvist <albin@fripost.org>
 ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org>
 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il"
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -103,6 +103,7 @@ 
   #:use-module (gnu packages xdisorg)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system trivial))
 
@@ -2773,3 +2774,55 @@  Your robot ant can be programmed in many languages: OCaml, Python, C, C++,
 Java, Ruby, Lua, JavaScript, Pascal, Perl, Scheme, Vala, Prolog.  Experienced
 programmers may also add their own favorite language.")
     (license license:gpl3+)))
+
+(define-public bambam
+  (package
+    (name "bambam")
+    (version "0.5")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://github.com/porridge/bambam/archive/"
+                            version ".tar.gz"))
+        (file-name (string-append name "-" version ".tar.gz"))
+        (sha256
+         (base32
+          "10w110mjdwbvddzihh9rganvvjr5jfiz8cs9n7w12zndwwcc3ria"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'build)
+         (add-before 'install 'patch-data-dir-location
+           (lambda _
+             (substitute* "bambam.py"
+                          (("'data'")
+                           "'../share/bambam/data'"))
+             #t))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out   (assoc-ref outputs "out"))
+                    (bin   (string-append out "/bin"))
+                    (share (string-append out "/share")))
+               (mkdir-p bin)
+               (copy-file "bambam.py" (string-append bin "/bambam"))
+               (install-file "bambam.6" (string-append share "/man/man6"))
+               (copy-recursively "data" (string-append share "/bambam/data")))
+             #t))
+         (add-after 'install 'wrap-binary
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin/bambam")))
+               (wrap-program bin
+                 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
+             #t)))))
+    (inputs
+     `(("python-pygame" ,python-pygame)))
+    (home-page "https://github.com/porridge/bambam")
+    (synopsis "keyboard mashing and doodling game for babies")
+    (description "Bambam is a simple baby keyboard (and gamepad) masher
+application that locks the keyboard and mouse and instead displays bright
+colors, pictures, and sounds.")
+    (license license:gpl3+)))