unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* Grue Hunter: Can't create directories in the store
@ 2013-05-14 19:36 Nikita Karetnikov
  2013-05-15  0:59 ` Cyril Roelandt
  2013-05-15 12:11 ` Ludovic Courtès
  0 siblings, 2 replies; 13+ messages in thread
From: Nikita Karetnikov @ 2013-05-14 19:36 UTC (permalink / raw)
  To: bug-guix


[-- Attachment #1.1: Type: text/plain, Size: 826 bytes --]

I'm trying to package Grue Hunter [1].

The game is just a single Perl file.  What directories should be created
in the store?  And how can I create such directories?

I've tried several things:

1. (zero? (system (format #f "cp -r . ~a" out)))

   Pollutes the profile with 'AGPLv3.txt', 'gh.pl', and 'README'.

2. (zero? (system (format #f "mkdir bin ~a/" out)))

   Creates 'bin', but the output doesn't contain it.

3. (zero? (system (format #f "mkdir bin ~a/" out)))
   (zero? (system (format #f "cp gh.pl ~a/bin/" out)))

   Creates a file called 'bin', not a directory.  Could anyone explain
   why?  Fails with:

   cp: cannot create regular file '/nix/store/clwpaljwanw7397qafxv82vj1b8jm82q-grue-hunter-1.0/bin/': Not a directory

I'm attaching a recipe and a related patch.

[1] http://jxself.org/grue-hunter.shtml


[-- Attachment #1.2: grue-hunter.scm --]
[-- Type: text/plain, Size: 2865 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages grue-hunter)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages perl))

(define-public grue-hunter
  (package
    (name "grue-hunter")
    (version "1.0")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "http://jxself.org/" name ".tar.gz"))
      (sha256
       (base32
        "1hjcpy5439qs3v2zykis7hsi0i17zjs62gks3zd8mnfw9ni4i2h3"))))
    (build-system gnu-build-system) ; no Makefile.PL
    (arguments `(#:modules ((guix build gnu-build-system)
                            (guix build utils)
                            (srfi srfi-1))
                 #:phases
                 (alist-replace
                  'install
                  (lambda* (#:key outputs #:allow-other-keys)
                    (let ((out (assoc-ref outputs "out")))
                      ;; (zero? (system (format #f "cp -r . ~a" out)))

                      (zero? (system (format #f "mkdir bin ~a/" out)))
                      (zero? (system (format #f "cp gh.pl ~a/bin/" out)))))
                  (alist-delete
                   'configure
                   (alist-delete
                    'patch-generated-file-shebangs
                    (alist-delete
                     'build
                     (alist-delete
                      'check
                      (alist-delete
                       'patch-shebangs
                       (alist-delete
                        'strip
                        %standard-phases)))))))
                 #:tests? #f)) ; no test target
    (inputs `(("perl" ,perl)))
    (home-page "http://jxself.org/grue-hunter.shtml")
    (synopsis "Text adventure game")
    (description
     "Grue Hunter is a text adventure game written in Perl.  You must make
your way through an underground cave system in search of the Grue.  Can you
capture it and get out alive?")
   (license agpl3+)))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0001-licenses-Add-agpl3-and-agpl3.patch --]
[-- Type: text/x-diff, Size: 1228 bytes --]

From 436dc3da50aa2a82a7d47930c493ccb73a3accec Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Tue, 14 May 2013 18:57:42 +0000
Subject: [PATCH] licenses: Add 'agpl3' and 'agpl3+'.

* guix/licenses.scm (agpl3, agpl3+): New variables.
---
 guix/licenses.scm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/guix/licenses.scm b/guix/licenses.scm
index 9c4e177..c0a0e60 100644
--- a/guix/licenses.scm
+++ b/guix/licenses.scm
@@ -21,6 +21,7 @@
 (define-module (guix licenses)
   #:use-module (srfi srfi-9)
   #:export (license? license-name license-uri license-comment
+            agpl3 agpl3+
             asl2.0
             boost1.0
             bsd-2 bsd-3 bsd-4 bsd-style
@@ -60,6 +61,16 @@
 ;;;
 ;;; Code:
 
+(define agpl3
+  (license "AGPL 3"
+           "https://gnu.org/licenses/agpl.html"
+           "https://gnu.org/licenses/why-affero-gpl.html"))
+
+(define agpl3+
+  (license "AGPL 3+"
+           "https://gnu.org/licenses/agpl.html"
+           "https://gnu.org/licenses/why-affero-gpl.html"))
+
 (define asl2.0
   (license "ASL 2.0"
            "http://directory.fsf.org/wiki/License:Apache2.0"
-- 
1.7.5.4


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-14 19:36 Grue Hunter: Can't create directories in the store Nikita Karetnikov
@ 2013-05-15  0:59 ` Cyril Roelandt
  2013-05-15 12:11 ` Ludovic Courtès
  1 sibling, 0 replies; 13+ messages in thread
From: Cyril Roelandt @ 2013-05-15  0:59 UTC (permalink / raw)
  To: bug-guix

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

On 05/14/2013 09:36 PM, Nikita Karetnikov wrote:
> I'm trying to package Grue Hunter [1].
>
> The game is just a single Perl file.  What directories should be created
> in the store?  And how can I create such directories?
>


I think you want to use mkdir/mkdir-p and copy-file. See the attached 
recipe.


Cyril Roelandt.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: grue-hunter.scm --]
[-- Type: text/x-scheme; name="grue-hunter.scm", Size: 2775 bytes --]

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages grue-hunter)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages perl))

(define-public grue-hunter
  (package
    (name "grue-hunter")
    (version "1.0")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "http://jxself.org/" name ".tar.gz"))
      (sha256
       (base32
        "1hjcpy5439qs3v2zykis7hsi0i17zjs62gks3zd8mnfw9ni4i2h3"))))
    (build-system gnu-build-system) ; no Makefile.PL
    (arguments `(#:modules ((guix build gnu-build-system)
                            (guix build utils)
                            (srfi srfi-1))
                 #:phases
                 (alist-replace
                  'install
                  (lambda* (#:key outputs #:allow-other-keys)
                    (let* ((out (assoc-ref outputs "out"))
                          (bin (string-append out "/bin")))
                      (mkdir-p bin)
                      (copy-file "gh.pl" (string-append bin "/grue-hunter"))
                      #t))
                  (alist-delete
                   'configure
                   (alist-delete
                    'patch-generated-file-shebangs
                    (alist-delete
                     'build
                     (alist-delete
                      'check
                      (alist-delete
                       'patch-shebangs
                       (alist-delete
                        'strip
                        %standard-phases)))))))
                 #:tests? #f)) ; no test target
    (inputs `(("perl" ,perl)))
    (home-page "http://jxself.org/grue-hunter.shtml")
    (synopsis "Text adventure game")
    (description
     "Grue Hunter is a text adventure game written in Perl.  You must make
your way through an underground cave system in search of the Grue.  Can you
capture it and get out alive?")
   (license agpl3+)))

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-14 19:36 Grue Hunter: Can't create directories in the store Nikita Karetnikov
  2013-05-15  0:59 ` Cyril Roelandt
@ 2013-05-15 12:11 ` Ludovic Courtès
  2013-05-16  2:35   ` Nikita Karetnikov
  1 sibling, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2013-05-15 12:11 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Hello!

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> The game is just a single Perl file.

I think this is a good use case for ‘trivial-build-system’.

Basically, with ‘trivial-build-system’, you just pass a Scheme
expression that produces the result.  In your case that would be along
the lines of:

  (begin
    (use-modules (guix build utils))

    (let* ((gh   (assoc-ref %build-inputs "source"))
           (perl (assoc-ref %build-inputs "perl"))
           (out  (assoc-ref %outputs "out"))
           (bin  (string-append out "/bin)))
      (mkdir-p bin)
      (copy-file gh (string-append bin "/gh"))
      (patch-shebang (string-append bin "/gh")
                     (list (string-append perl "/bin")))
      ;; ...
      ))

> What directories should be created in the store?

$out/bin for the program, and $out/share/doc/grue-hunter for the license file.

> And how can I create such directories?

With the ‘mkdir’ and ‘mkdir-p’ procedures.

> I've tried several things:
>
> 1. (zero? (system (format #f "cp -r . ~a" out)))

Avoid calling out to Coreutils.  Guile and the (guix build utils)
provide us with everything we need to do that.

HTH!

Ludo’.

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-15 12:11 ` Ludovic Courtès
@ 2013-05-16  2:35   ` Nikita Karetnikov
  2013-05-16 16:33     ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Nikita Karetnikov @ 2013-05-16  2:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

> I think this is a good use case for ‘trivial-build-system’.

Yes, I forgot about it.

>    (let* ((gh   (assoc-ref %build-inputs "source"))

What is the associated value here?  I assume it should be 'gh.pl'.

I've tried to specify (inputs `(("source" ,source))), but it's just a
tarball.  So I'd have to use 'tar' to unpack it (see 'unpack' in
'gnu-build-system.scm').

I guess I'm missing something because you said that "Guile and the (guix
build utils) provide us with everything we need."

Also, why is it necessary to specify (guix build utils) in #:modules and
import it via 'use-modules' in #:builder too?  According to the manual,
all arguments are passed to the build system.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-16  2:35   ` Nikita Karetnikov
@ 2013-05-16 16:33     ` Ludovic Courtès
  2013-05-24  9:24       ` Nikita Karetnikov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2013-05-16 16:33 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>>    (let* ((gh   (assoc-ref %build-inputs "source"))
>
> What is the associated value here?  I assume it should be 'gh.pl'.

Yes.  Actually, “source” is the name of the input that corresponds to
the ‘source’ field of the package.  So, if your package does

  (package
    (source (origin (... (uri ".../gh.pl"))))
    ...)

then in the builder, (assoc-ref %build-inputs "source") will be
/nix/store/...-gh.pl.

> I guess I'm missing something because you said that "Guile and the (guix
> build utils) provide us with everything we need."

I meant they provide procedures equivalent in functionality to
Coreutils, Findutils, and sed.

> Also, why is it necessary to specify (guix build utils) in #:modules and
> import it via 'use-modules' in #:builder too?  According to the manual,
> all arguments are passed to the build system.

(guix build utils) is not a standard Guile module, so if your build
script wants to use it, it needs to be made available in the chroot
where that build script is run.  That’s what the #:module argument does.

Then ‘use-modules’ does the actual import.

HTH,
Ludo’.

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-16 16:33     ` Ludovic Courtès
@ 2013-05-24  9:24       ` Nikita Karetnikov
  2013-05-24 12:51         ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Nikita Karetnikov @ 2013-05-24  9:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

>>>    (let* ((gh   (assoc-ref %build-inputs "source"))
>>
>> What is the associated value here?  I assume it should be 'gh.pl'.

> Yes.  Actually, “source” is the name of the input that corresponds to
> the ‘source’ field of the package.  So, if your package does

>   (package
>     (source (origin (... (uri ".../gh.pl"))))
>     ...)

> then in the builder, (assoc-ref %build-inputs "source") will be
> /nix/store/...-gh.pl.

Makes sense, but I don't understand the (uri ".../gh.pl") part.  It
should be (uri "...tar.gz") instead.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-24  9:24       ` Nikita Karetnikov
@ 2013-05-24 12:51         ` Ludovic Courtès
  2013-05-24 14:34           ` Nikita Karetnikov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2013-05-24 12:51 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>>>>    (let* ((gh   (assoc-ref %build-inputs "source"))
>>>
>>> What is the associated value here?  I assume it should be 'gh.pl'.
>
>> Yes.  Actually, “source” is the name of the input that corresponds to
>> the ‘source’ field of the package.  So, if your package does
>
>>   (package
>>     (source (origin (... (uri ".../gh.pl"))))
>>     ...)
>
>> then in the builder, (assoc-ref %build-inputs "source") will be
>> /nix/store/...-gh.pl.
>
> Makes sense, but I don't understand the (uri ".../gh.pl") part.  It
> should be (uri "...tar.gz") instead.

Ah, maybe.  I thought the source of Grue Hunter was a single Perl file.

Ludo’.

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-24 12:51         ` Ludovic Courtès
@ 2013-05-24 14:34           ` Nikita Karetnikov
  2013-05-24 15:32             ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Nikita Karetnikov @ 2013-05-24 14:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

How can I unpack the tarball?  The following returns "In execvp of tar:
No such file or directory."

(arguments `(#:modules ...
			 #:builder
			 (begin
			   ...
			   (let* ((tarball (assoc-ref %build-inputs "tarball"))
					  ...)
				 (system* "tar" "xvf" tarball)
				 ...))))

(inputs `(...
		  ("tarball" ,source)))

(display tarball) returns '/nix/store/6xwqfw5k58l0bhzzm8s81rrkmhm88vk4-grue-hunter.tar.gz'.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: Grue Hunter: Can't create directories in the store
  2013-05-24 14:34           ` Nikita Karetnikov
@ 2013-05-24 15:32             ` Ludovic Courtès
  2013-05-30  3:40               ` [PATCH] gnu: Add Grue Hunter Nikita Karetnikov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2013-05-24 15:32 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

> 				 (system* "tar" "xvf" tarball)

The ‘PATH’ environment variable is empty.  So this should be:

  (let ((tar (string-append (assoc-ref %build-inputs "tar")
             "/bin/tar")))
    (zero? (system* tar "xvf" tarball)))

And tar needs to be explicitly added as an input.

Note ‘zero?’ to make sure ‘tar’ exits normally.

See ‘package-from-tarball’ for an example, in bootstrap.scm.

HTH,
Ludo’.

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

* [PATCH] gnu: Add Grue Hunter.
  2013-05-24 15:32             ` Ludovic Courtès
@ 2013-05-30  3:40               ` Nikita Karetnikov
  2013-05-30 11:53                 ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Nikita Karetnikov @ 2013-05-30  3:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix


[-- Attachment #1.1: Type: text/plain, Size: 689 bytes --]

> See ‘package-from-tarball’ for an example, in bootstrap.scm.

Thanks.  Can I push the attached patch along with this one [1,2]?

Two questions, though:

1. Is it necessary to use 'begin' here?

(begin
  (mkdir out)
  (copy-file tarball "grue-hunter.tar.gz")
  ...)

2. I'd like to use

(patch-shebang (string-append bin "/grue-hunter")
			   (list perl))

instead of

(substitute* (string-append bin "/grue-hunter")
  (("#!/usr/bin/perl") (string-append "#!" perl)))

But the former fails to find Perl.  Why?

[1] https://lists.gnu.org/archive/html/bug-guix/2013-05/txtJNCpY2SXeq.txt
[2] https://lists.gnu.org/archive/html/bug-guix/2013-05/msg00036.html


[-- Attachment #1.2: 0001-gnu-Add-Grue-Hunter.patch --]
[-- Type: text/x-diff, Size: 4973 bytes --]

From a3592f86b78a3823fc8c4372ef4a1a574a9c6ad0 Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov <nikita@karetnikov.org>
Date: Thu, 30 May 2013 03:15:37 +0000
Subject: [PATCH] gnu: Add Grue Hunter.

* gnu/packages/grue-hunter.scm: New file.
* Makefile.am (MODULES): Add it.
---
 Makefile.am                  |    1 +
 gnu/packages/grue-hunter.scm |   84 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+), 0 deletions(-)
 create mode 100644 gnu/packages/grue-hunter.scm

diff --git a/Makefile.am b/Makefile.am
index 8592c5b..3d823ea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,6 +114,7 @@ MODULES =					\
   gnu/packages/gprolog.scm			\
   gnu/packages/groff.scm			\
   gnu/packages/grub.scm				\
+  gnu/packages/grue-hunter.scm			\
   gnu/packages/gsasl.scm			\
   gnu/packages/gtk.scm				\
   gnu/packages/guile.scm			\
diff --git a/gnu/packages/grue-hunter.scm b/gnu/packages/grue-hunter.scm
new file mode 100644
index 0000000..764eda0
--- /dev/null
+++ b/gnu/packages/grue-hunter.scm
@@ -0,0 +1,84 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages grue-hunter)
+  #:use-module (guix licenses)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system trivial)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages perl))
+
+(define-public grue-hunter
+  (package
+    (name "grue-hunter")
+    (version "1.0")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "http://jxself.org/" name ".tar.gz"))
+      (sha256
+       (base32
+        "1hjcpy5439qs3v2zykis7hsi0i17zjs62gks3zd8mnfw9ni4i2h3"))))
+    (build-system trivial-build-system) ; no Makefile.PL
+    (arguments `(#:modules ((guix build utils))
+                 #:builder
+                 (begin
+                   (use-modules (guix build utils))
+                   (use-modules (srfi srfi-1))
+
+                   (let* ((tarball (assoc-ref %build-inputs "tarball"))
+                          (perl    (string-append (assoc-ref %build-inputs
+                                                             "perl")
+                                                  "/bin/perl"))
+                          (gunzip  (string-append (assoc-ref %build-inputs
+                                                             "gzip")
+                                                  "/bin/gunzip"))
+                          (tar     (string-append (assoc-ref %build-inputs
+                                                             "tar")
+                                                  "/bin/tar"))
+                          (out     (assoc-ref %outputs "out"))
+                          (bin     (string-append out "/bin"))
+                          (doc     (string-append out "/share/doc")))
+                     (begin
+                       (mkdir out)
+                       (copy-file tarball "grue-hunter.tar.gz")
+                       (zero? (system* gunzip "grue-hunter.tar.gz"))
+                       (zero? (system* tar "xvf"  "grue-hunter.tar"))
+
+                       (mkdir-p bin)
+                       (copy-file "grue-hunter/gh.pl"
+                                  (string-append bin "/grue-hunter"))
+                       (substitute* (string-append bin "/grue-hunter")
+                         (("#!/usr/bin/perl") (string-append "#!" perl)))
+
+                       (mkdir-p doc)
+                       (copy-file "grue-hunter/AGPLv3.txt"
+                                  (string-append doc "/grue-hunter")))))))
+    (inputs `(("perl" ,perl)
+              ("tar" ,tar)
+              ("gzip" ,gzip)
+              ("tarball" ,source)))
+    (home-page "http://jxself.org/grue-hunter.shtml")
+    (synopsis "Text adventure game")
+    (description
+     "Grue Hunter is a text adventure game written in Perl.  You must make
+your way through an underground cave system in search of the Grue.  Can you
+capture it and get out alive?")
+   (license agpl3+)))
-- 
1.7.5.4


[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: [PATCH] gnu: Add Grue Hunter.
  2013-05-30  3:40               ` [PATCH] gnu: Add Grue Hunter Nikita Karetnikov
@ 2013-05-30 11:53                 ` Ludovic Courtès
  2013-06-03  3:18                   ` Nikita Karetnikov
  0 siblings, 1 reply; 13+ messages in thread
From: Ludovic Courtès @ 2013-05-30 11:53 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> See ‘package-from-tarball’ for an example, in bootstrap.scm.
>
> Thanks.  Can I push the attached patch along with this one [1,2]?

OK for [1].

Comments about the rest:

> Two questions, though:
>
> 1. Is it necessary to use 'begin' here?
>
> (begin
>   (mkdir out)
>   (copy-file tarball "grue-hunter.tar.gz")
>   ...)

Yes, because it’s a sequence of instructions.

> 2. I'd like to use
>
> (patch-shebang (string-append bin "/grue-hunter")
> 			   (list perl))

Should be (list (string-append perl "/bin")).

Free free to commit after that change if it works as expected.

> +    (synopsis "Text adventure game")
> +    (description
> +     "Grue Hunter is a text adventure game written in Perl.  You must make
> +your way through an underground cave system in search of the Grue.  Can you
> +capture it and get out alive?")
> +   (license agpl3+)))

The indentation of ‘(license’ differs from the lines above.

Thanks,
Ludo’.

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

* Re: [PATCH] gnu: Add Grue Hunter.
  2013-05-30 11:53                 ` Ludovic Courtès
@ 2013-06-03  3:18                   ` Nikita Karetnikov
  2013-06-03 10:14                     ` Ludovic Courtès
  0 siblings, 1 reply; 13+ messages in thread
From: Nikita Karetnikov @ 2013-06-03  3:18 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guix

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

> > 2. I'd like to use
> >
> > (patch-shebang (string-append bin "/grue-hunter")
> > 			   (list perl))

> Should be (list (string-append perl "/bin")).

I don't think so.  Here's the output of (display (string-append "PERL: " perl "\n")):

PERL: /nix/store/rp1fdpa8fa4cdx3j76yyhi45lgx796nw-perl-5.16.1/bin/perl

And 'perl' is defined like this:

(perl (string-append (assoc-ref %build-inputs
                                "perl")
                     "/bin/perl"))

There is also a corresponding line in 'inputs'.  Why does the mentioned
'patch-shebang' line return the following?

patch-shebang: /nix/store/k6w3d29k2i9acj3v9ypy19v4sqxki8gk-grue-hunter-1.0/bin/grue-hunter: warning: no binary for interpreter `perl' found in $PATH

Note that 'substitute*' works fine.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

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

* Re: [PATCH] gnu: Add Grue Hunter.
  2013-06-03  3:18                   ` Nikita Karetnikov
@ 2013-06-03 10:14                     ` Ludovic Courtès
  0 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2013-06-03 10:14 UTC (permalink / raw)
  To: Nikita Karetnikov; +Cc: bug-guix

Nikita Karetnikov <nikita@karetnikov.org> skribis:

>> > 2. I'd like to use
>> >
>> > (patch-shebang (string-append bin "/grue-hunter")
>> > 			   (list perl))
>
>> Should be (list (string-append perl "/bin")).
>
> I don't think so.  Here's the output of (display (string-append "PERL: " perl "\n")):
>
> PERL: /nix/store/rp1fdpa8fa4cdx3j76yyhi45lgx796nw-perl-5.16.1/bin/perl
>
> And 'perl' is defined like this:
>
> (perl (string-append (assoc-ref %build-inputs
>                                 "perl")
>                      "/bin/perl"))

Ah OK.  Then remove the /perl part ($PATH should only contain directory
names.)

> There is also a corresponding line in 'inputs'.  Why does the mentioned
> 'patch-shebang' line return the following?
>
> patch-shebang: /nix/store/k6w3d29k2i9acj3v9ypy19v4sqxki8gk-grue-hunter-1.0/bin/grue-hunter: warning: no binary for interpreter `perl' found in $PATH

Because ‘perl’ was not found in $PATH, because of the above.

HTH,
Ludo’.

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

end of thread, other threads:[~2013-06-03 10:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14 19:36 Grue Hunter: Can't create directories in the store Nikita Karetnikov
2013-05-15  0:59 ` Cyril Roelandt
2013-05-15 12:11 ` Ludovic Courtès
2013-05-16  2:35   ` Nikita Karetnikov
2013-05-16 16:33     ` Ludovic Courtès
2013-05-24  9:24       ` Nikita Karetnikov
2013-05-24 12:51         ` Ludovic Courtès
2013-05-24 14:34           ` Nikita Karetnikov
2013-05-24 15:32             ` Ludovic Courtès
2013-05-30  3:40               ` [PATCH] gnu: Add Grue Hunter Nikita Karetnikov
2013-05-30 11:53                 ` Ludovic Courtès
2013-06-03  3:18                   ` Nikita Karetnikov
2013-06-03 10:14                     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).