unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add Glulxe.
@ 2014-11-18 16:01 宋文武
  2014-11-18 16:45 ` Eric Bavier
  0 siblings, 1 reply; 6+ messages in thread
From: 宋文武 @ 2014-11-18 16:01 UTC (permalink / raw)
  To: guix-devel; +Cc: 宋文武

* gnu/packages/games.scm (glkterm, glulxe): New variables.
---
 gnu/packages/games.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c9bb678..5859cbc 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -733,3 +733,82 @@ single player.  Mods and texture packs allow players to personalize the game
 in different ways.")
     (home-page "http://minetest.net")
     (license license:lgpl2.1+)))
+
+(define glkterm
+  (package
+   (name "glkterm")
+   (version "1.0.4")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
+                         "glk/implementations/glkterm-104.tar.gz"))
+     (sha256
+      (base32
+       "0zlj9nlnkdlvgbiliczinirqygiq8ikg5hzh5vgcmnpg9pvnwga7"))))
+   (build-system gnu-build-system)
+   (propagated-inputs `(("ncurses" ,ncurses)))
+   (arguments
+    '(#:tests? #f ; no check target
+      #:phases
+      (alist-replace
+       'install
+       (lambda* (#:key outputs #:allow-other-keys)
+         (let ((out (assoc-ref outputs "out")))
+           (mkdir out)
+           (mkdir (string-append out "/include"))
+           (copy-file "glk.h" (string-append out "/include/glk.h"))
+           (copy-file "glkstart.h" (string-append out "/include/glkstart.h"))
+           (copy-file "gi_blorb.h" (string-append out "/include/gi_blorb.h"))
+           (copy-file "gi_dispa.h" (string-append out "/include/gi_dispa.h"))
+           (copy-file "Make.glkterm" (string-append out "/include/Make.glkterm"))
+           (mkdir (string-append out "/lib"))
+           (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
+       (alist-delete 'configure %standard-phases))))
+   (home-page "http://www.eblong.com/zarf/glk/")
+   (synopsis "Curses.h Implementation of the Glk API")
+   (description
+    "Glk defines a portable API for applications with text UIs.  It was
+primarily designed for interactive fiction, but it should be suitable for many
+interactive text utilities, particularly those based on a command line.
+This is an implementation of the Glk library which runs in a terminal window,
+using the curses.h library for screen control.")
+   (license (license:fsf-free "file://README"))))
+
+(define-public glulxe
+  (package
+   (name "glulxe")
+   (version "0.5.2")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
+                         "glulx/interpreters/glulxe/glulxe-052.tar.gz"))
+     (sha256
+      (base32
+       "19iw6kl8ncqcy9pv4gsqfh3xsa1n94zd234rqavvmxccnf3nj19g"))))
+   (build-system gnu-build-system)
+   (inputs `(("glk" ,glkterm)))
+   (arguments
+    '(#:tests? #f ; no check target
+      #:make-flags
+      (let* ((glk (assoc-ref %build-inputs "glk")))
+        (list (string-append "GLKINCLUDEDIR=" glk "/include")
+              (string-append "GLKLIBDIR=" glk "/lib")
+              (string-append "GLKMAKEFILE=" "Make.glkterm")))
+      #:phases
+      (alist-replace
+       'install
+       (lambda* (#:key outputs #:allow-other-keys)
+         (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+           (mkdir-p bin)
+           (copy-file "glulxe" (string-append bin "/glulxe"))))
+       (alist-delete 'configure %standard-phases))))
+   (home-page "http://www.eblong.com/zarf/glulx/")
+   (synopsis "Interpreter for Glulx VM")
+   (description
+    "Glulx is a 32-bit portable virtual machine intended for writing and
+playing interactive fiction.  It was designed by Andrew Plotkin to relieve
+some of the restrictions in the venerable Z-machine format.  This is the
+reference interpreter, using Glk API.")
+   (license (license:fsf-free "file://README"))))
-- 
1.9.2

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

* Re: [PATCH] gnu: Add Glulxe.
  2014-11-18 16:01 [PATCH] gnu: Add Glulxe 宋文武
@ 2014-11-18 16:45 ` Eric Bavier
  2014-11-19 11:57   ` 宋文武
  2014-12-03  5:10   ` Mark H Weaver
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Bavier @ 2014-11-18 16:45 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel


宋文武 writes:

> * gnu/packages/games.scm (glkterm, glulxe): New variables.
> ---
>  gnu/packages/games.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 79 insertions(+)
>
> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
> index c9bb678..5859cbc 100644
> --- a/gnu/packages/games.scm
> +++ b/gnu/packages/games.scm
> @@ -733,3 +733,82 @@ single player.  Mods and texture packs allow players to personalize the game
>  in different ways.")
>      (home-page "http://minetest.net")
>      (license license:lgpl2.1+)))
> +
> +(define glkterm
> +  (package
> +   (name "glkterm")
> +   (version "1.0.4")
> +   (source
> +    (origin
> +     (method url-fetch)
> +     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
> +                         "glk/implementations/glkterm-104.tar.gz"))
> +     (sha256
> +      (base32
> +       "0zlj9nlnkdlvgbiliczinirqygiq8ikg5hzh5vgcmnpg9pvnwga7"))))
> +   (build-system gnu-build-system)
> +   (propagated-inputs `(("ncurses" ,ncurses)))

Could you add a comment saying why ncurses needs to be propagated?

> +   (arguments
> +    '(#:tests? #f ; no check target
> +      #:phases
> +      (alist-replace
> +       'install
> +       (lambda* (#:key outputs #:allow-other-keys)
> +         (let ((out (assoc-ref outputs "out")))
> +           (mkdir out)
> +           (mkdir (string-append out "/include"))
> +           (copy-file "glk.h" (string-append out "/include/glk.h"))
> +           (copy-file "glkstart.h" (string-append out "/include/glkstart.h"))
> +           (copy-file "gi_blorb.h" (string-append out "/include/gi_blorb.h"))
> +           (copy-file "gi_dispa.h" (string-append out "/include/gi_dispa.h"))
> +           (copy-file "Make.glkterm" (string-append out "/include/Make.glkterm"))
> +           (mkdir (string-append out "/lib"))
> +           (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))

This is a bit terse, IMHO.  Perhaps something like:

(let* ((out (assoc-ref outputs "out"))
       (inc (string-append out "/include")))
  (begin
    (mkdir-p inc)
    (for-each
      (lambda (f) (copy-file f (string-append inc "/" f)))
      '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
    (mkdir-p lib)
    (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))

> +       (alist-delete 'configure %standard-phases))))
> +   (home-page "http://www.eblong.com/zarf/glk/")
> +   (synopsis "Curses.h Implementation of the Glk API")

"Curses implementation of the Glk API"?

Thanks!

-- 
Eric Bavier

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

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

* Re: [PATCH] gnu: Add Glulxe.
  2014-11-18 16:45 ` Eric Bavier
@ 2014-11-19 11:57   ` 宋文武
  2014-11-19 15:49     ` Eric Bavier
  2014-12-03  5:10   ` Mark H Weaver
  1 sibling, 1 reply; 6+ messages in thread
From: 宋文武 @ 2014-11-19 11:57 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

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

Eric Bavier <ericbavier@gmail.com> writes:

> 宋文武 writes:
>
>> * gnu/packages/games.scm (glkterm, glulxe): New variables.
>> ---
>>  gnu/packages/games.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 79 insertions(+)
>>
>> diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
>> index c9bb678..5859cbc 100644
>> --- a/gnu/packages/games.scm
>> +++ b/gnu/packages/games.scm
>> @@ -733,3 +733,82 @@ single player.  Mods and texture packs allow players to personalize the game
>>  in different ways.")
>>      (home-page "http://minetest.net")
>>      (license license:lgpl2.1+)))
>> +
>> +(define glkterm
>> +  (package
>> +   (name "glkterm")
>> +   (version "1.0.4")
>> +   (source
>> +    (origin
>> +     (method url-fetch)
>> +     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
>> +                         "glk/implementations/glkterm-104.tar.gz"))
>> +     (sha256
>> +      (base32
>> +       "0zlj9nlnkdlvgbiliczinirqygiq8ikg5hzh5vgcmnpg9pvnwga7"))))
>> +   (build-system gnu-build-system)
>> +   (propagated-inputs `(("ncurses" ,ncurses)))
>
> Could you add a comment saying why ncurses needs to be propagated?
It's required by Make.glkterm, due to the staticly build of libglkterm.a?
>
>> +   (arguments
>> +    '(#:tests? #f ; no check target
>> +      #:phases
>> +      (alist-replace
>> +       'install
>> +       (lambda* (#:key outputs #:allow-other-keys)
>> +         (let ((out (assoc-ref outputs "out")))
>> +           (mkdir out)
>> +           (mkdir (string-append out "/include"))
>> +           (copy-file "glk.h" (string-append out "/include/glk.h"))
>> +           (copy-file "glkstart.h" (string-append out "/include/glkstart.h"))
>> +           (copy-file "gi_blorb.h" (string-append out "/include/gi_blorb.h"))
>> +           (copy-file "gi_dispa.h" (string-append out "/include/gi_dispa.h"))
>> +           (copy-file "Make.glkterm" (string-append out "/include/Make.glkterm"))
>> +           (mkdir (string-append out "/lib"))
>> +           (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
>
> This is a bit terse, IMHO.  Perhaps something like:
>
> (let* ((out (assoc-ref outputs "out"))
>        (inc (string-append out "/include")))
>   (begin
>     (mkdir-p inc)
>     (for-each
>       (lambda (f) (copy-file f (string-append inc "/" f)))
>       '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
>     (mkdir-p lib)
>     (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
>
>> +       (alist-delete 'configure %standard-phases))))
>> +   (home-page "http://www.eblong.com/zarf/glk/")
>> +   (synopsis "Curses.h Implementation of the Glk API")
>
> "Curses implementation of the Glk API"?
Yes, this is better, thanks for reviewing!

New patch:

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-Glulxe.patch --]
[-- Type: text/x-patch, Size: 3909 bytes --]

From 59663e52e45181fec5f0a3c3bb5f9a5e9776150c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
Date: Tue, 18 Nov 2014 23:58:02 +0800
Subject: [PATCH] gnu: Add Glulxe.

* gnu/packages/games.scm (glkterm, glulxe): New variables.
---
 gnu/packages/games.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c9bb678..e79be3f 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -733,3 +733,81 @@ single player.  Mods and texture packs allow players to personalize the game
 in different ways.")
     (home-page "http://minetest.net")
     (license license:lgpl2.1+)))
+
+(define glkterm
+  (package
+   (name "glkterm")
+   (version "1.0.4")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
+                         "glk/implementations/glkterm-104.tar.gz"))
+     (sha256
+      (base32
+       "0zlj9nlnkdlvgbiliczinirqygiq8ikg5hzh5vgcmnpg9pvnwga7"))))
+   (build-system gnu-build-system)
+   (propagated-inputs `(("ncurses" ,ncurses))) ; required by Make.glkterm
+   (arguments
+    '(#:tests? #f ; no check target
+      #:phases
+      (alist-replace
+       'install
+       (lambda* (#:key outputs #:allow-other-keys)
+         (let* ((out (assoc-ref outputs "out"))
+                (inc (string-append out "/include")))
+           (mkdir-p inc)
+           (for-each
+            (lambda (file)
+              (copy-file file (string-append inc "/" file)))
+            '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
+           (mkdir (string-append out "/lib"))
+           (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
+       (alist-delete 'configure %standard-phases))))
+   (home-page "http://www.eblong.com/zarf/glk/")
+   (synopsis "Curses Implementation of the Glk API")
+   (description
+    "Glk defines a portable API for applications with text UIs.  It was
+primarily designed for interactive fiction, but it should be suitable for many
+interactive text utilities, particularly those based on a command line.
+This is an implementation of the Glk library which runs in a terminal window,
+using the curses.h library for screen control.")
+   (license (license:fsf-free "file://README"))))
+
+(define-public glulxe
+  (package
+   (name "glulxe")
+   (version "0.5.2")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append "http://www.ifarchive.org/if-archive/programming/"
+                         "glulx/interpreters/glulxe/glulxe-052.tar.gz"))
+     (sha256
+      (base32
+       "19iw6kl8ncqcy9pv4gsqfh3xsa1n94zd234rqavvmxccnf3nj19g"))))
+   (build-system gnu-build-system)
+   (inputs `(("glk" ,glkterm)))
+   (arguments
+    '(#:tests? #f ; no check target
+      #:make-flags
+      (let* ((glk (assoc-ref %build-inputs "glk")))
+        (list (string-append "GLKINCLUDEDIR=" glk "/include")
+              (string-append "GLKLIBDIR=" glk "/lib")
+              (string-append "GLKMAKEFILE=" "Make.glkterm")))
+      #:phases
+      (alist-replace
+       'install
+       (lambda* (#:key outputs #:allow-other-keys)
+         (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+           (mkdir-p bin)
+           (copy-file "glulxe" (string-append bin "/glulxe"))))
+       (alist-delete 'configure %standard-phases))))
+   (home-page "http://www.eblong.com/zarf/glulx/")
+   (synopsis "Interpreter for Glulx VM")
+   (description
+    "Glulx is a 32-bit portable virtual machine intended for writing and
+playing interactive fiction.  It was designed by Andrew Plotkin to relieve
+some of the restrictions in the venerable Z-machine format.  This is the
+reference interpreter, using Glk API.")
+   (license (license:fsf-free "file://README"))))
-- 
1.9.2


[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

>
> Thanks!
>
> -- 
> Eric Bavier
>
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html

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

* Re: [PATCH] gnu: Add Glulxe.
  2014-11-19 11:57   ` 宋文武
@ 2014-11-19 15:49     ` Eric Bavier
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Bavier @ 2014-11-19 15:49 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel


>> 宋文武 writes:
>>
>>> * gnu/packages/games.scm (glkterm, glulxe): New variables.
>>> ---
>>>  gnu/packages/games.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 79 insertions(+)

I pushed this as commit 77264d1.  Thanks!

-- 
Eric Bavier

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

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

* Re: [PATCH] gnu: Add Glulxe.
  2014-11-18 16:45 ` Eric Bavier
  2014-11-19 11:57   ` 宋文武
@ 2014-12-03  5:10   ` Mark H Weaver
  2014-12-03 11:27     ` 宋文武
  1 sibling, 1 reply; 6+ messages in thread
From: Mark H Weaver @ 2014-12-03  5:10 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <ericbavier@gmail.com> writes:

> This is a bit terse, IMHO.  Perhaps something like:
>
> (let* ((out (assoc-ref outputs "out"))
>        (inc (string-append out "/include")))
>   (begin
>     (mkdir-p inc)
>     (for-each
>       (lambda (f) (copy-file f (string-append inc "/" f)))
>       '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
>     (mkdir-p lib)
>     (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))

It's not important, but FYI the 'begin' above is not needed.  The 'let*'
includes an implicit 'begin'.

      Mark

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

* Re: [PATCH] gnu: Add Glulxe.
  2014-12-03  5:10   ` Mark H Weaver
@ 2014-12-03 11:27     ` 宋文武
  0 siblings, 0 replies; 6+ messages in thread
From: 宋文武 @ 2014-12-03 11:27 UTC (permalink / raw)
  To: Mark H Weaver, Eric Bavier; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> writes:

> Eric Bavier <ericbavier@gmail.com> writes:
>
>> This is a bit terse, IMHO.  Perhaps something like:
>>
>> (let* ((out (assoc-ref outputs "out"))
>>        (inc (string-append out "/include")))
>>   (begin
>>     (mkdir-p inc)
>>     (for-each
>>       (lambda (f) (copy-file f (string-append inc "/" f)))
>>       '("glk.h" "glkstart.h" "gi_blorb.h" "gi_dispa.h" "Make.glkterm"))
>>     (mkdir-p lib)
>>     (copy-file "libglkterm.a" (string-append out "/lib/libglkterm.a"))))
>
> It's not important, but FYI the 'begin' above is not needed.  The 'let*'
> includes an implicit 'begin'.
Thanks! I'll be care next time :)
>
>       Mark

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

end of thread, other threads:[~2014-12-03 11:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-18 16:01 [PATCH] gnu: Add Glulxe 宋文武
2014-11-18 16:45 ` Eric Bavier
2014-11-19 11:57   ` 宋文武
2014-11-19 15:49     ` Eric Bavier
2014-12-03  5:10   ` Mark H Weaver
2014-12-03 11:27     ` 宋文武

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).