diff mbox series

[bug#41849] Add frozen-bubble

Message ID 87pna1esu6.fsf@nicolasgoaziou.fr
State Accepted
Headers show
Series [bug#41849] Add frozen-bubble | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Nicolas Goaziou June 14, 2020, 12:26 p.m. UTC
Hello,

These three patches add perl-alien-sdl, perl-sdl, and, ultimately,
frozen-bubble.

Feedback welcome,

Regards,

Comments

Ludovic Courtès June 17, 2020, 9:35 a.m. UTC | #1
Hi,

Nicolas Goaziou <mail@nicolasgoaziou.fr> skribis:

>>From 2586c90f5a25985bd02b0ea5bc65c5fc982b50d8 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Sun, 14 Jun 2020 11:50:43 +0200
> Subject: [PATCH 1/3] gnu: Add perl-alien-sdl.
>
> * gnu/packages/perl.scm (perl-alien-sdl): New variable.

LGTM.

>>From 64744949f1d80b40317d942807b871f3c3f0f490 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Sun, 14 Jun 2020 12:44:28 +0200
> Subject: [PATCH 2/3] gnu: Add perl-sdl.
>
> * gnu/packages/perl.scm (perl-sdl): New variable.

LGTM.

>>From 6ff230c8ec69cdc21d6b8148b54f170b3fd859e9 Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Sun, 14 Jun 2020 12:50:34 +0200
> Subject: [PATCH 3/3] gnu: Add frozen-bubble.
>
> * gnu/packages/games.scm (frozen-bubble): New variable.

[...]

> +(define-public frozen-bubble
> +  (let ((commit "d6a029110ad6ab9e4960052e175addc98807fb7e")
> +        (revision "1"))

Please add a comment stating why we’re pick this revision.

> +           (add-after 'unpack 'fix-permissions
> +             (lambda _ (invoke "chmod" "-R" "+w" "server")))

How about: (for-each make-file-writable
                     (find-files "servers" "." #:directories? #t))

Otherwise LGTM.

I can’t wait to try it again, so many years later.  :-)

Thanks!

Ludo’.
Nicolas Goaziou June 17, 2020, 10:05 a.m. UTC | #2
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> Please add a comment stating why we’re pick this revision.

Done.

>> +           (add-after 'unpack 'fix-permissions
>> +             (lambda _ (invoke "chmod" "-R" "+w" "server")))
>
> How about: (for-each make-file-writable
>                      (find-files "servers" "." #:directories? #t))

OK.

I also removed the #:module-build-flags argument in frozen-bubble
package, as it didn't seem to be necessary, and I was not sure why I had
added it in the first place.

> I can’t wait to try it again, so many years later.  :-)

Heh.

Thank you for the review. I pushed the changes.

Regards,
diff mbox series

Patch

From 6ff230c8ec69cdc21d6b8148b54f170b3fd859e9 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Sun, 14 Jun 2020 12:50:34 +0200
Subject: [PATCH 3/3] gnu: Add frozen-bubble.

* gnu/packages/games.scm (frozen-bubble): New variable.
---
 gnu/packages/games.scm | 102 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 100 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 32d7d8d478..1bd2032d57 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -146,6 +146,7 @@ 
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-check)
+  #:use-module (gnu packages perl-compression)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -176,14 +177,15 @@ 
   #:use-module (gnu packages messaging)
   #:use-module (gnu packages networking)
   #:use-module (guix build-system copy)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
-  #:use-module (guix build-system scons)
+  #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
-  #:use-module (guix build-system cmake)
   #:use-module (guix build-system qt)
+  #:use-module (guix build-system scons)
   #:use-module (guix build-system trivial)
   #:use-module ((srfi srfi-1) #:hide (zip))
   #:use-module (srfi srfi-26))
@@ -6842,6 +6844,102 @@  when packaged in Blorb container files or optionally from individual files.")
       (home-page "http://frotz.sourceforge.net")
       (license license:gpl2+))))
 
+(define-public frozen-bubble
+  (let ((commit "d6a029110ad6ab9e4960052e175addc98807fb7e")
+        (revision "1"))
+    (package
+      (name "frozen-bubble")
+      (version (git-version "2.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/kthakore/frozen-bubble.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1rfrcym5lf4qac2qdklikb1ywijyxypq298azzxahy461dadl6cx"))))
+      (build-system perl-build-system)
+      (arguments
+       `(#:module-build-flags '("installdir=vendors")
+         #:phases
+         (modify-phases %standard-phases
+           ;; Build process needs to create files in the "server"
+           ;; directory.
+           (add-after 'unpack 'fix-permissions
+             (lambda _ (invoke "chmod" "-R" "+w" "server")))
+           ;; By default, build stops at warnings.
+           (add-after 'unpack 'prevent-build-error
+             (lambda _
+               (substitute* "inc/My/Builder.pm"
+                 (("-Werror") ""))
+               #t))
+           (add-after 'install 'install-desktop-file-and-icons
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((share (string-append (assoc-ref outputs "out") "/share"))
+                      (hicolor (string-append share "/icons/hicolor")))
+                 ;; Create desktop entry.
+                 (make-desktop-entry-file
+                  (string-append share "/applications/" ,name ".desktop")
+                  #:name "Frozen Bubble"
+                  #:comment "Frozen Bubble arcade game"
+                  #:exec ,name
+                  #:icon ,name
+                  #:categories '("Game" "ArcadeGame"))
+                 ;; Add icons.
+                 (with-directory-excursion "share/icons"
+                   (for-each
+                    (lambda (size)
+                      (let* ((dim (string-append size "x" size))
+                             (dir (string-append hicolor "/" dim "/apps")))
+                        (mkdir-p dir)
+                        (copy-file
+                         (string-append "frozen-bubble-icon-" dim ".png")
+                         (string-append dir "/frozen-bubble.png"))))
+                    '("16" "32" "48" "64"))))
+               #t))
+           (add-after 'install 'wrap-perl-libs
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out"))
+                     (perl5lib (getenv "PERL5LIB")))
+                 (for-each (lambda (prog)
+                             (wrap-program (string-append out "/" prog)
+                               `("PERL5LIB" ":" prefix
+                                 (,(string-append perl5lib ":" out
+                                                  "/lib/perl5/site_perl")))))
+                           (find-files "bin" ".")))
+               #t)))))
+      (native-inputs
+       `(("perl-alien-sdl" ,perl-alien-sdl)
+         ("perl-capture-tiny" ,perl-capture-tiny)
+         ("perl-locale-maketext-lexicon" ,perl-locale-maketext-lexicon)
+         ("perl-module-build" ,perl-module-build)
+         ("pkg-config" ,pkg-config)))
+      (inputs
+       `(("glib" ,glib)
+         ("perl-compress-bzip2" ,perl-compress-bzip2)
+         ("perl-file-sharedir" ,perl-file-sharedir)
+         ("perl-file-slurp" ,perl-file-slurp)
+         ("perl-file-which" ,perl-file-which)
+         ("perl-ipc-system-simple" ,perl-ipc-system-simple)
+         ("perl-sdl" ,perl-sdl)
+         ("sdl" ,(sdl-union (list sdl sdl-image sdl-mixer sdl-pango sdl-ttf)))))
+      (home-page "http://frozen-bubble.org/")
+      (synopsis "Puzzle with Bubbles")
+      (description
+       "Frozen-Bubble is a clone of the popular Puzzle Bobble game, in which
+you attempt to shoot bubbles into groups of the same color to cause them to
+pop.
+
+Players compete as penguins and must use the arrow keys to aim a colored
+bubble at groups of bubbles.  The objective is to clear all the bubbles off
+the screen before a bubble passes below a line at the bottom.
+
+It features 100 single-player levels, a two-player mode, music and striking
+graphics.  A level editor is also included to allow players to create and play
+their own levels.")
+      (license license:gpl2))))
+
 (define-public libmanette
   (package
     (name "libmanette")
-- 
2.26.2