all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add Mr. Rescue.
@ 2016-09-17 13:24 宋文武
  2016-09-18  8:17 ` Ricardo Wurmus
  2016-09-18  9:07 ` Hartmut Goebel
  0 siblings, 2 replies; 5+ messages in thread
From: 宋文武 @ 2016-09-17 13:24 UTC (permalink / raw)
  To: guix-devel; +Cc: 宋文武

* gnu/packages/games.scm (mrrescue): New variable.
---
 gnu/packages/games.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index d386e2c..8d321fc 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2856,3 +2856,51 @@ programmers may also add their own favorite language.")
 application that locks the keyboard and mouse and instead displays bright
 colors, pictures, and sounds.")
     (license license:gpl3+)))
+
+(define-public mrrescue
+  (package
+    (name "mrrescue")
+    (version "1.02e")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/SimonLarsen/mrrescue/releases/"
+                    "download/" version "/" name version ".love"))
+              (file-name (string-append name "-" version ".love"))
+              (sha256
+               (base32
+                "0jwzbwkgp1l5ia6c7s760gmdirbsncp6nfqp7vqdqsfb63la9gl2"))))
+    (build-system trivial-build-system)
+    (arguments
+     '(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (let* ((out     (assoc-ref %outputs "out"))
+                (bindir  (string-append out "/bin"))
+                (prog    (string-append bindir "/mrrescue"))
+                (source  (assoc-ref %build-inputs "source"))
+                (guile   (string-append (assoc-ref %build-inputs "guile")
+                                        "/bin/guile"))
+                (love    (string-append (assoc-ref %build-inputs "love")
+                                        "/bin/love")))
+           (mkdir-p bindir)
+           (with-output-to-file prog
+             (lambda ()
+               (format #t "#!~a --no-auto-compile~%!#~%" guile)
+               (write `(execl ,love "mrrescue" ,source))
+               (newline)))
+           (chmod prog #o755)
+           #t))))
+    (inputs
+     `(("guile" ,guile-2.0)
+       ("love" ,love)))
+    (home-page "http://tangramgames.dk/games/mrrescue")
+    (synopsis "Arcade-style fire fighting game")
+    (description
+     "Mr. Rescue is an arcade styled 2d action game centered around evacuating
+civilians from burning buildings.  The game features fast paced fire
+extinguishing action, intense boss battles, a catchy soundtrack and lots of
+throwing people around in pseudo-randomly generated buildings.")
+    (license (list license:zlib             ; for source code
+                   license:cc-by-sa3.0))))  ; for graphics and music assets
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add Mr. Rescue.
  2016-09-17 13:24 [PATCH] gnu: Add Mr. Rescue 宋文武
@ 2016-09-18  8:17 ` Ricardo Wurmus
  2016-09-18 11:24   ` 宋文武
  2016-09-18  9:07 ` Hartmut Goebel
  1 sibling, 1 reply; 5+ messages in thread
From: Ricardo Wurmus @ 2016-09-18  8:17 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel


宋文武 <iyzsong@gmail.com> writes:

> * gnu/packages/games.scm (mrrescue): New variable.
> ---
>  gnu/packages/games.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index d386e2c..8d321fc 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -2856,3 +2856,51 @@ programmers may also add their own favorite language.")
>  application that locks the keyboard and mouse and instead displays bright
>  colors, pictures, and sounds.")
>      (license license:gpl3+)))
> +
> +(define-public mrrescue
> +  (package
> +    (name "mrrescue")
> +    (version "1.02e")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "https://github.com/SimonLarsen/mrrescue/releases/"
> +                    "download/" version "/" name version ".love"))
> +              (file-name (string-append name "-" version ".love"))

What is this file?  Are these sources or is this a binary image?

> +              (sha256
> +               (base32
> +                "0jwzbwkgp1l5ia6c7s760gmdirbsncp6nfqp7vqdqsfb63la9gl2"))))
> +    (build-system trivial-build-system)
> +    (arguments
> +     '(#:modules ((guix build utils))
> +       #:builder
> +       (begin
> +         (use-modules (guix build utils))
> +         (let* ((out     (assoc-ref %outputs "out"))
> +                (bindir  (string-append out "/bin"))
> +                (prog    (string-append bindir "/mrrescue"))
> +                (source  (assoc-ref %build-inputs "source"))
> +                (guile   (string-append (assoc-ref %build-inputs "guile")
> +                                        "/bin/guile"))
> +                (love    (string-append (assoc-ref %build-inputs "love")
> +                                        "/bin/love")))
> +           (mkdir-p bindir)
> +           (with-output-to-file prog
> +             (lambda ()
> +               (format #t "#!~a --no-auto-compile~%!#~%" guile)
> +               (write `(execl ,love "mrrescue" ,source))
> +               (newline)))
> +           (chmod prog #o755)
> +           #t))))

Is the “.love” file the source archive?  In the repository I only see
“.lua” files.  Shouldn’t we compile them from source?

~~ Ricardo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add Mr. Rescue.
  2016-09-17 13:24 [PATCH] gnu: Add Mr. Rescue 宋文武
  2016-09-18  8:17 ` Ricardo Wurmus
@ 2016-09-18  9:07 ` Hartmut Goebel
  2016-09-18 11:33   ` 宋文武
  1 sibling, 1 reply; 5+ messages in thread
From: Hartmut Goebel @ 2016-09-18  9:07 UTC (permalink / raw)
  To: guix-devel

Am 17.09.2016 um 15:24 schrieb 宋文武:
> +         (let* ((out     (assoc-ref %outputs "out"))
> +                (bindir  (string-append out "/bin"))
> +                (prog    (string-append bindir "/mrrescue"))
> +                (source  (assoc-ref %build-inputs "source"))
> +                (guile   (string-append (assoc-ref %build-inputs "guile")
> +                                        "/bin/guile"))
> +                (love    (string-append (assoc-ref %build-inputs "love")
> +                                        "/bin/love")))
> +           (mkdir-p bindir)
> +           (with-output-to-file prog
> +             (lambda ()
> +               (format #t "#!~a --no-auto-compile~%!#~%" guile)
> +               (write `(execl ,love "mrrescue" ,source))
> +               (newline)))

This looks like you are creating a starter-script which is pointing to
the source. This will not work, since the source will not be installed
when installing the package.

You want to

- copy the source file into (string-append out "/share/" ,name)

- create a starter script

I also suggest using a shell-script as starter (instead of a guile
wrapper), since this is more natural for me.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add Mr. Rescue.
  2016-09-18  8:17 ` Ricardo Wurmus
@ 2016-09-18 11:24   ` 宋文武
  0 siblings, 0 replies; 5+ messages in thread
From: 宋文武 @ 2016-09-18 11:24 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> writes:

> 宋文武 <iyzsong@gmail.com> writes:
>
>> * gnu/packages/games.scm (mrrescue): New variable.
>> ---
>>  gnu/packages/games.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 48 insertions(+)
>>
>> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
>> index d386e2c..8d321fc 100644
>> --- a/gnu/packages/games.scm
>> +++ b/gnu/packages/games.scm
>> @@ -2856,3 +2856,51 @@ programmers may also add their own favorite language.")
>>  application that locks the keyboard and mouse and instead displays bright
>>  colors, pictures, and sounds.")
>>      (license license:gpl3+)))
>> +
>> +(define-public mrrescue
>> +  (package
>> +    (name "mrrescue")
>> +    (version "1.02e")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append
>> +                    "https://github.com/SimonLarsen/mrrescue/releases/"
>> +                    "download/" version "/" name version ".love"))
>> +              (file-name (string-append name "-" version ".love"))
>
> What is this file?  Are these sources or is this a binary image?
>
>> [...]
>
> Is the “.love” file the source archive?  In the repository I only see
> “.lua” files.  Shouldn’t we compile them from source?

It's both the love2d package format and source archive [1], which is
just a zip file of the project directory.

[1] https://love2d.org/wiki/Game_Distribution

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: Add Mr. Rescue.
  2016-09-18  9:07 ` Hartmut Goebel
@ 2016-09-18 11:33   ` 宋文武
  0 siblings, 0 replies; 5+ messages in thread
From: 宋文武 @ 2016-09-18 11:33 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 17.09.2016 um 15:24 schrieb 宋文武:
>> +         (let* ((out     (assoc-ref %outputs "out"))
>> +                (bindir  (string-append out "/bin"))
>> +                (prog    (string-append bindir "/mrrescue"))
>> +                (source  (assoc-ref %build-inputs "source"))
>> +                (guile   (string-append (assoc-ref %build-inputs "guile")
>> +                                        "/bin/guile"))
>> +                (love    (string-append (assoc-ref %build-inputs "love")
>> +                                        "/bin/love")))
>> +           (mkdir-p bindir)
>> +           (with-output-to-file prog
>> +             (lambda ()
>> +               (format #t "#!~a --no-auto-compile~%!#~%" guile)
>> +               (write `(execl ,love "mrrescue" ,source))
>> +               (newline)))
>
> This looks like you are creating a starter-script which is pointing to
> the source. This will not work, since the source will not be installed
> when installing the package.

Yes, but it works.  The source is referenced by the script, so it will
be downloaded into the store.

>
> You want to
>
> - copy the source file into (string-append out "/share/" ,name)
>
> - create a starter script
>
> I also suggest using a shell-script as starter (instead of a guile
> wrapper), since this is more natural for me.

OK, both are fine to me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-18 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-17 13:24 [PATCH] gnu: Add Mr. Rescue 宋文武
2016-09-18  8:17 ` Ricardo Wurmus
2016-09-18 11:24   ` 宋文武
2016-09-18  9:07 ` Hartmut Goebel
2016-09-18 11:33   ` 宋文武

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.