unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 05/15] gnu: Add chez-matchable.
@ 2016-10-16 15:31 Federico Beffa
  2016-10-17 13:54 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Federico Beffa @ 2016-10-16 15:31 UTC (permalink / raw)
  To: Guix-devel

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



[-- Attachment #2: 0005-gnu-Add-chez-matchable.patch --]
[-- Type: text/x-patch, Size: 2896 bytes --]

From 5821d3e41e37df01492141f128a0a09b5e70498f Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Sun, 16 Oct 2016 16:08:33 +0200
Subject: [PATCH 05/15] gnu: Add chez-matchable.

* gnu/packages/chez.scm (chez-matchable): New variable.
---
 gnu/packages/chez.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm
index 6579b81..bc763df 100644
--- a/gnu/packages/chez.scm
+++ b/gnu/packages/chez.scm
@@ -19,7 +19,8 @@
 (define-module (gnu packages chez)
   #:use-module (gnu packages)
   #:use-module ((guix licenses)
-                #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat))
+                #:select (gpl2+ lgpl2.0+ lgpl2.1+ asl2.0 bsd-3 expat
+                          public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -347,3 +348,52 @@ Chez Scheme.")
     (description "Chez-sockets is an extensible sockets library for
 Chez Scheme.")
     (license expat)))
+
+;; Help function for Chez Scheme to add the current path to
+;; CHEZSCHEMELIBDIRS.
+(define chez-configure
+  '(lambda _
+     (let ((chez-env (getenv "CHEZSCHEMELIBDIRS")))
+       (setenv "CHEZSCHEMELIBDIRS"
+               (if chez-env
+                   (string-append ".:" chez-env)
+                   "."))
+       #t)))
+
+;; Help function to define make flags for some Chez Scheme custom make
+;; files.
+(define (chez-make-flags name version)
+  `(let ((out (assoc-ref %outputs "out")))
+     (list (string-append "PREFIX=" out)
+           (string-append "DOCDIR=" out "/share/doc/"
+                          ,name "-" ,version))))
+
+(define-public chez-matchable
+  (package
+    (name "chez-matchable")
+    (version "20160306")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/fedeinthemix/chez-matchable/archive"
+             "/v" version ".tar.gz"))
+       (sha256
+        (base32 "0cl4vc6487pikjq159pj4n5ghyaax31nywb5n4yn1682h3ir1hs0"))
+       (file-name (string-append name "-" version ".tar.gz"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("chez-srfi" ,chez-srfi))) ; for tests
+    (native-inputs
+     `(("chez-scheme" ,chez-scheme)))
+    (arguments
+     `(#:make-flags ,(chez-make-flags name version)
+       #:test-target "test"
+       #:phases (modify-phases %standard-phases
+                  (replace 'configure ,chez-configure))))
+    (home-page "https://github.com/fedeinthemix/chez-matchable")
+    (synopsis "Portable hygienic pattern matcher for Scheme")
+    (description "This package provides a superset of the popular
+Scheme 'match' package by Andrew Wright, written in fully portable
+'syntax-rules' and thus preserving hygiene.")
+    (license public-domain)))
-- 
2.7.4


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

* Re: [PATCH 05/15] gnu: Add chez-matchable.
  2016-10-16 15:31 [PATCH 05/15] gnu: Add chez-matchable Federico Beffa
@ 2016-10-17 13:54 ` Ludovic Courtès
  2016-10-17 16:10   ` Federico Beffa
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-10-17 13:54 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

Federico Beffa <beffa@ieee.org> skribis:

> From 5821d3e41e37df01492141f128a0a09b5e70498f Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> Date: Sun, 16 Oct 2016 16:08:33 +0200
> Subject: [PATCH 05/15] gnu: Add chez-matchable.
>
> * gnu/packages/chez.scm (chez-matchable): New variable.

[...]

> +;; Help function for Chez Scheme to add the current path to
> +;; CHEZSCHEMELIBDIRS.
> +(define chez-configure
> +  '(lambda _
> +     (let ((chez-env (getenv "CHEZSCHEMELIBDIRS")))
> +       (setenv "CHEZSCHEMELIBDIRS"
> +               (if chez-env
> +                   (string-append ".:" chez-env)
> +                   "."))
> +       #t)))

Would it make sense to define a chez-build-system?

> +;; Help function to define make flags for some Chez Scheme custom make
> +;; files.
> +(define (chez-make-flags name version)
> +  `(let ((out (assoc-ref %outputs "out")))
> +     (list (string-append "PREFIX=" out)
> +           (string-append "DOCDIR=" out "/share/doc/"
> +                          ,name "-" ,version))))
> +
> +(define-public chez-matchable
> +  (package
> +    (name "chez-matchable")
> +    (version "20160306")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://github.com/fedeinthemix/chez-matchable/archive"

It’s a good idea to define ‘home-page’ above and reuse it here.

> +    (description "This package provides a superset of the popular
> +Scheme 'match' package by Andrew Wright, written in fully portable
> +'syntax-rules' and thus preserving hygiene.")

@code{match} and @code{syntax-rules}.

Otherwise LGTM, thanks!

Ludo’.

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

* Re: [PATCH 05/15] gnu: Add chez-matchable.
  2016-10-17 13:54 ` Ludovic Courtès
@ 2016-10-17 16:10   ` Federico Beffa
  0 siblings, 0 replies; 3+ messages in thread
From: Federico Beffa @ 2016-10-17 16:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On Mon, Oct 17, 2016 at 3:54 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Federico Beffa <beffa@ieee.org> skribis:
>
>> From 5821d3e41e37df01492141f128a0a09b5e70498f Mon Sep 17 00:00:00 2001
>> From: Federico Beffa <beffa@fbengineering.ch>
>> Date: Sun, 16 Oct 2016 16:08:33 +0200
>> Subject: [PATCH 05/15] gnu: Add chez-matchable.
>>
>> * gnu/packages/chez.scm (chez-matchable): New variable.
>
> [...]
>
>> +;; Help function for Chez Scheme to add the current path to
>> +;; CHEZSCHEMELIBDIRS.
>> +(define chez-configure
>> +  '(lambda _
>> +     (let ((chez-env (getenv "CHEZSCHEMELIBDIRS")))
>> +       (setenv "CHEZSCHEMELIBDIRS"
>> +               (if chez-env
>> +                   (string-append ".:" chez-env)
>> +                   "."))
>> +       #t)))
>
> Would it make sense to define a chez-build-system?

I don't think so: There aren't so many libraries and everybody is
doing his thing.

Fede

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

end of thread, other threads:[~2016-10-17 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-16 15:31 [PATCH 05/15] gnu: Add chez-matchable Federico Beffa
2016-10-17 13:54 ` Ludovic Courtès
2016-10-17 16:10   ` Federico Beffa

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