unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gnu: guile: Add guile-wisp
@ 2015-09-19  4:24 Christopher Allan Webber
  2015-09-19  8:15 ` Ricardo Wurmus
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Christopher Allan Webber @ 2015-09-19  4:24 UTC (permalink / raw)
  To: guix-devel

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

Hello!

I've added guile-wisp here.  There's no "make install" and a few of the
commands are hardcoded in the autoconf stuff, but I've patched it up.

So here's the funny thing: it works just fine if you just use guix to
install the library and use a system guile from elsewhere:

  scheme@(guile-user)> ,L wisp
  Happy hacking with Wisp Scheme Syntax. See SRFI-119 for details. THIS IS EXPERIMENTAL, USE AT YOUR OWN RISK!  To switch back, type `,L scheme'.

But if you use guile-2.0 from Guix, you get the following issue:

  scheme@(guile-user)> ,L wisp
  While executing meta-command:
  ERROR: In procedure setlocale: Invalid argument
  scheme@(guile-user)> ,L wisp
  While executing meta-command:
  ERROR: no such language wisp

I'm pretty sure this is a Guix packaging of Guile issue, not a
guile-wisp issue.  I've tested building from the package and trying with
guix's guile-2.0 and I have the same issue there, but not with the Guile
from Debian.  Any ideas?

I think the patch is good to go, though, probably.  Let me know if
otherwise!

 - Chris


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

From 8d29d47c0558c24562c2c0760e1f05a78b064838 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Fri, 18 Sep 2015 16:58:31 -0500
Subject: [PATCH] gnu: guile: Add guile-wisp

* gnu/packages/guile.scm (guile-wisp): New variable.
---
 gnu/packages/guile.scm | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 60af92d..867f79a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gdbm)
+  #:use-module (gnu packages python)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -538,7 +539,7 @@ See http://minikanren.org/ for more on miniKanren generally.")
 
            ;; compile to the destination
            (compile-file gdbm.scm-dest
-                         #:output-file gdbm.go-dest)))))
+                           #:output-file gdbm.go-dest)))))
     (inputs
      `(("guile" ,guile-2.0)))
     (propagated-inputs
@@ -600,4 +601,79 @@ interface for reading articles in any format.")
 key-value cache and store.")
     (license lgpl3+)))
 
+(define-public guile-wisp
+  (package
+    (name "guile-wisp")
+    (version "0.8.6")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://bitbucket.org/ArneBab/wisp/downloads/wisp-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "021437nmnc5vqmbyyn2zgfl8fzvwv0phc5pph6hp2x98wf2lzvg8"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after
+          'unpack 'bootstrap
+          (lambda _
+            (zero? (system* "bash" "bootstrap.sh"))))
+         (add-before
+          'configure 'substitute-before-config
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((bash (assoc-ref inputs "bash")))
+              ;; configure checks for guile-2.0, but ours is just named "guile" :)
+              (substitute* "configure"
+                (("guile-2.0") "guile"))
+              ;; Puts together some test files with /bin/bash hardcoded
+              (substitute* "Makefile.in"
+                (("/bin/bash")
+                 (string-append bash "/bin/bash"))))))
+         ;; auto complilation breaks, but if we set HOME to /tmp,
+         ;; that works ok
+         (add-before
+          'check 'auto-compile-hacky-workaround
+          (lambda _
+            (setenv "HOME" "/tmp")))
+         (replace
+          'install
+          (lambda* (#:key outputs inputs #:allow-other-keys)
+            (use-modules (guix build utils)
+                         (system base compile))
+
+            (let* ((out (assoc-ref outputs "out"))
+                   (module-dir (string-append out "/share/guile/site/2.0"))
+                   (language-dir
+                    (string-append module-dir "/language/wisp"))
+                   (guild (string-append (assoc-ref inputs "guile")
+                                         "/bin/guild")))
+              ;; Make installation directories.
+              (for-each (lambda (x) (mkdir-p x))
+                        (list module-dir language-dir))
+
+              ;; copy the source
+              (copy-file "wisp-scheme.scm"
+                         (string-append module-dir "/wisp-scheme.scm"))
+              (copy-file "language/wisp/spec.scm"
+                         (string-append language-dir "/spec.scm"))
+
+              ;; compile to the destination
+              (compile-file "wisp-scheme.scm"
+                            #:output-file (string-append
+                                           module-dir "/wisp-scheme.go"))
+              (compile-file "language/wisp/spec.scm"
+                            #:output-file (string-append
+                                           language-dir "/spec.go"))))))))
+    (home-page "http://draketo.de/english/wisp")
+    (inputs
+     `(("guile" ,guile-2.0)
+       ("python" ,python)))
+    (synopsis "wisp is a whitespace to lisp syntax for Guile")
+    (description "wisp is a syntax for Guile which provides a Python-like
+whitespace-significant language.  It may be easier on the eyes for some
+users and in some situations.")
+    (license gpl3+)))
+
 ;;; guile.scm ends here
-- 
2.1.4


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

* Re: gnu: guile: Add guile-wisp
  2015-09-19  4:24 gnu: guile: Add guile-wisp Christopher Allan Webber
@ 2015-09-19  8:15 ` Ricardo Wurmus
  2015-09-19 19:03   ` Christopher Allan Webber
  2015-09-20  0:39 ` Mark H Weaver
  2015-09-20 16:35 ` Ludovic Courtès
  2 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2015-09-19  8:15 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel


Christopher Allan Webber <cwebber@dustycloud.org> writes:

> But if you use guile-2.0 from Guix, you get the following issue:
>
>   scheme@(guile-user)> ,L wisp
>   While executing meta-command:
>   ERROR: In procedure setlocale: Invalid argument
>   scheme@(guile-user)> ,L wisp
>   While executing meta-command:
>   ERROR: no such language wisp

Is this on GuixSD or on some other host system (you mention Debian below
but it is not clear to me if this applies for the example above).  If it
is the latter, do you have locales installed and LOCPATH set to point at
the Guix-installed locales?

~~ Ricardo

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

* Re: gnu: guile: Add guile-wisp
  2015-09-19  8:15 ` Ricardo Wurmus
@ 2015-09-19 19:03   ` Christopher Allan Webber
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Allan Webber @ 2015-09-19 19:03 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus writes:

> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
>> But if you use guile-2.0 from Guix, you get the following issue:
>>
>>   scheme@(guile-user)> ,L wisp
>>   While executing meta-command:
>>   ERROR: In procedure setlocale: Invalid argument
>>   scheme@(guile-user)> ,L wisp
>>   While executing meta-command:
>>   ERROR: no such language wisp
>
> Is this on GuixSD or on some other host system (you mention Debian below
> but it is not clear to me if this applies for the example above).  If it
> is the latter, do you have locales installed and LOCPATH set to point at
> the Guix-installed locales?
>
> ~~ Ricardo

Ah, it is on Debian with Guix installed as an alternate package manager :)

I see there is this page:
  https://www.gnu.org/software/guix/manual/html_node/Application-Setup.html

That fixed it!  (How did I not know of this sooner?)

So I think I'm happy to say that this seems fine then, and the
guile-wisp package is ready to go from my perspective.

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

* Re: gnu: guile: Add guile-wisp
  2015-09-19  4:24 gnu: guile: Add guile-wisp Christopher Allan Webber
  2015-09-19  8:15 ` Ricardo Wurmus
@ 2015-09-20  0:39 ` Mark H Weaver
  2015-10-06 21:45   ` Christopher Allan Webber
  2015-09-20 16:35 ` Ludovic Courtès
  2 siblings, 1 reply; 7+ messages in thread
From: Mark H Weaver @ 2015-09-20  0:39 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> From 8d29d47c0558c24562c2c0760e1f05a78b064838 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber@dustycloud.org>
> Date: Fri, 18 Sep 2015 16:58:31 -0500
> Subject: [PATCH] gnu: guile: Add guile-wisp
>
> * gnu/packages/guile.scm (guile-wisp): New variable.
> ---
>  gnu/packages/guile.scm | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 77 insertions(+), 1 deletion(-)
>
>
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index 60af92d..867f79a 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -39,6 +39,7 @@
>    #:use-module (gnu packages texinfo)
>    #:use-module (gnu packages gettext)
>    #:use-module (gnu packages gdbm)
> +  #:use-module (gnu packages python)
>    #:use-module (guix packages)
>    #:use-module (guix download)
>    #:use-module (guix git-download)
> @@ -538,7 +539,7 @@ See http://minikanren.org/ for more on miniKanren generally.")
>  
>             ;; compile to the destination
>             (compile-file gdbm.scm-dest
> -                         #:output-file gdbm.go-dest)))))
> +                           #:output-file gdbm.go-dest)))))

This hunk looks like a mistake, it should be omitted.

> +(define-public guile-wisp
> +  (package
> +    (name "guile-wisp")
> +    (version "0.8.6")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "https://bitbucket.org/ArneBab/wisp/downloads/wisp-"

Please keep lines to 80 columns or less.

> +                                  version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "021437nmnc5vqmbyyn2zgfl8fzvwv0phc5pph6hp2x98wf2lzvg8"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (add-after
> +          'unpack 'bootstrap
> +          (lambda _
> +            (zero? (system* "bash" "bootstrap.sh"))))
> +         (add-before
> +          'configure 'substitute-before-config
> +          (lambda* (#:key inputs #:allow-other-keys)
> +            (let ((bash (assoc-ref inputs "bash")))
> +              ;; configure checks for guile-2.0, but ours is just named "guile" :)
> +              (substitute* "configure"
> +                (("guile-2.0") "guile"))
> +              ;; Puts together some test files with /bin/bash hardcoded
> +              (substitute* "Makefile.in"
> +                (("/bin/bash")
> +                 (string-append bash "/bin/bash"))))))

I guess this 'bash' is used at build-time only, right?  If so, you can
just replace it with "bash" instead of the absolute path.  This also
allows you to get rid of the 'let' and change the 'lambda*' to just
(lambda _ ...).

Also, phase procedures are expected to return a boolean indicating
success (#t) or failure (#f), but the return value of 'substitute*' is
unspecified.  Please add a #t after the last 'substitute*' call.

> +         ;; auto complilation breaks, but if we set HOME to /tmp,

There's an extra 'l' in "complilation".

> +         ;; that works ok
> +         (add-before
> +          'check 'auto-compile-hacky-workaround
> +          (lambda _
> +            (setenv "HOME" "/tmp")))

As above, please add #t after the 'setenv' call.

> +         (replace
> +          'install
> +          (lambda* (#:key outputs inputs #:allow-other-keys)
> +            (use-modules (guix build utils)
> +                         (system base compile))
> +
> +            (let* ((out (assoc-ref outputs "out"))
> +                   (module-dir (string-append out "/share/guile/site/2.0"))
> +                   (language-dir
> +                    (string-append module-dir "/language/wisp"))
> +                   (guild (string-append (assoc-ref inputs "guile")
> +                                         "/bin/guild")))
> +              ;; Make installation directories.
> +              (for-each (lambda (x) (mkdir-p x))
> +                        (list module-dir language-dir))

(lambda (x) (mkdir-p x)) is equivalent to just 'mkdir-p', so you can
just write this as:

  (for-each mkdir-p (list module-dir language-dir))

However, in this case, I wonder if it's simpler and more readable to
just write:

  (mkdir-p module-dir)
  (mkdir-p language-dir)

What do you think?

> +
> +              ;; copy the source
> +              (copy-file "wisp-scheme.scm"
> +                         (string-append module-dir "/wisp-scheme.scm"))
> +              (copy-file "language/wisp/spec.scm"
> +                         (string-append language-dir "/spec.scm"))
> +
> +              ;; compile to the destination
> +              (compile-file "wisp-scheme.scm"
> +                            #:output-file (string-append
> +                                           module-dir "/wisp-scheme.go"))
> +              (compile-file "language/wisp/spec.scm"
> +                            #:output-file (string-append
> +                                           language-dir "/spec.go"))))))))

As above, please add #t after the last call to 'compile-file'.

> +    (home-page "http://draketo.de/english/wisp")
> +    (inputs
> +     `(("guile" ,guile-2.0)
> +       ("python" ,python)))
> +    (synopsis "wisp is a whitespace to lisp syntax for Guile")
> +    (description "wisp is a syntax for Guile which provides a Python-like
> +whitespace-significant language.  It may be easier on the eyes for some
> +users and in some situations.")
> +    (license gpl3+)))

Otherwise it looks good to me.

    Thanks!
      Mark

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

* Re: gnu: guile: Add guile-wisp
  2015-09-19  4:24 gnu: guile: Add guile-wisp Christopher Allan Webber
  2015-09-19  8:15 ` Ricardo Wurmus
  2015-09-20  0:39 ` Mark H Weaver
@ 2015-09-20 16:35 ` Ludovic Courtès
  2 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2015-09-20 16:35 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> But if you use guile-2.0 from Guix, you get the following issue:
>
>   scheme@(guile-user)> ,L wisp
>   While executing meta-command:
>   ERROR: In procedure setlocale: Invalid argument

IMO this is a bug in WISP: it should gracefully handle ‘setlocale’
errors (and it shouldn’t call ‘setlocale’ at the top-level in the first
place.)

Ludo’.

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

* Re: gnu: guile: Add guile-wisp
  2015-09-20  0:39 ` Mark H Weaver
@ 2015-10-06 21:45   ` Christopher Allan Webber
  2015-10-12  1:48     ` Mark H Weaver
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Allan Webber @ 2015-10-06 21:45 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

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

Mark H Weaver writes:

> Christopher Allan Webber <cwebber@dustycloud.org> writes:
>
>> From 8d29d47c0558c24562c2c0760e1f05a78b064838 Mon Sep 17 00:00:00 2001
>> From: Christopher Allan Webber <cwebber@dustycloud.org>
>> Date: Fri, 18 Sep 2015 16:58:31 -0500
>> Subject: [PATCH] gnu: guile: Add guile-wisp
>>
>> * gnu/packages/guile.scm (guile-wisp): New variable.
>> ---
>>  gnu/packages/guile.scm | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 77 insertions(+), 1 deletion(-)
>>
>>
>> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
>> index 60af92d..867f79a 100644
>> --- a/gnu/packages/guile.scm
>> +++ b/gnu/packages/guile.scm
>> @@ -39,6 +39,7 @@
>>    #:use-module (gnu packages texinfo)
>>    #:use-module (gnu packages gettext)
>>    #:use-module (gnu packages gdbm)
>> +  #:use-module (gnu packages python)
>>    #:use-module (guix packages)
>>    #:use-module (guix download)
>>    #:use-module (guix git-download)
>> @@ -538,7 +539,7 @@ See http://minikanren.org/ for more on miniKanren generally.")
>>  
>>             ;; compile to the destination
>>             (compile-file gdbm.scm-dest
>> -                         #:output-file gdbm.go-dest)))))
>> +                           #:output-file gdbm.go-dest)))))
>
> This hunk looks like a mistake, it should be omitted.

Fixed

>> +(define-public guile-wisp
>> +  (package
>> +    (name "guile-wisp")
>> +    (version "0.8.6")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append "https://bitbucket.org/ArneBab/wisp/downloads/wisp-"
>
> Please keep lines to 80 columns or less.

Done

>> +                                  version ".tar.gz"))
>> +              (sha256
>> +               (base32
>> +                "021437nmnc5vqmbyyn2zgfl8fzvwv0phc5pph6hp2x98wf2lzvg8"))))
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +     '(#:phases
>> +       (modify-phases %standard-phases
>> +         (add-after
>> +          'unpack 'bootstrap
>> +          (lambda _
>> +            (zero? (system* "bash" "bootstrap.sh"))))
>> +         (add-before
>> +          'configure 'substitute-before-config
>> +          (lambda* (#:key inputs #:allow-other-keys)
>> +            (let ((bash (assoc-ref inputs "bash")))
>> +              ;; configure checks for guile-2.0, but ours is just named "guile" :)
>> +              (substitute* "configure"
>> +                (("guile-2.0") "guile"))
>> +              ;; Puts together some test files with /bin/bash hardcoded
>> +              (substitute* "Makefile.in"
>> +                (("/bin/bash")
>> +                 (string-append bash "/bin/bash"))))))
>
> I guess this 'bash' is used at build-time only, right?  If so, you can
> just replace it with "bash" instead of the absolute path.  This also
> allows you to get rid of the 'let' and change the 'lambda*' to just
> (lambda _ ...).

Not used just at build time, it's used in the unit tests run later, and
the package will not build with tests if I switch this part, I found.

> Also, phase procedures are expected to return a boolean indicating
> success (#t) or failure (#f), but the return value of 'substitute*' is
> unspecified.  Please add a #t after the last 'substitute*' call.

Okay, done

>> +         ;; auto complilation breaks, but if we set HOME to /tmp,
>
> There's an extra 'l' in "complilation".

Done

>> +         ;; that works ok
>> +         (add-before
>> +          'check 'auto-compile-hacky-workaround
>> +          (lambda _
>> +            (setenv "HOME" "/tmp")))
>
> As above, please add #t after the 'setenv' call.

Done

>> +         (replace
>> +          'install
>> +          (lambda* (#:key outputs inputs #:allow-other-keys)
>> +            (use-modules (guix build utils)
>> +                         (system base compile))
>> +
>> +            (let* ((out (assoc-ref outputs "out"))
>> +                   (module-dir (string-append out "/share/guile/site/2.0"))
>> +                   (language-dir
>> +                    (string-append module-dir "/language/wisp"))
>> +                   (guild (string-append (assoc-ref inputs "guile")
>> +                                         "/bin/guild")))
>> +              ;; Make installation directories.
>> +              (for-each (lambda (x) (mkdir-p x))
>> +                        (list module-dir language-dir))
>
> (lambda (x) (mkdir-p x)) is equivalent to just 'mkdir-p', so you can
> just write this as:
>
>   (for-each mkdir-p (list module-dir language-dir))
>
> However, in this case, I wonder if it's simpler and more readable to
> just write:
>
>   (mkdir-p module-dir)
>   (mkdir-p language-dir)
>
> What do you think?

Simple enough, went with the latter

>> +
>> +              ;; copy the source
>> +              (copy-file "wisp-scheme.scm"
>> +                         (string-append module-dir "/wisp-scheme.scm"))
>> +              (copy-file "language/wisp/spec.scm"
>> +                         (string-append language-dir "/spec.scm"))
>> +
>> +              ;; compile to the destination
>> +              (compile-file "wisp-scheme.scm"
>> +                            #:output-file (string-append
>> +                                           module-dir "/wisp-scheme.go"))
>> +              (compile-file "language/wisp/spec.scm"
>> +                            #:output-file (string-append
>> +                                           language-dir "/spec.go"))))))))
>
> As above, please add #t after the last call to 'compile-file'.

Done

>> +    (home-page "http://draketo.de/english/wisp")
>> +    (inputs
>> +     `(("guile" ,guile-2.0)
>> +       ("python" ,python)))
>> +    (synopsis "wisp is a whitespace to lisp syntax for Guile")
>> +    (description "wisp is a syntax for Guile which provides a Python-like
>> +whitespace-significant language.  It may be easier on the eyes for some
>> +users and in some situations.")
>> +    (license gpl3+)))
>
> Otherwise it looks good to me.
>
>     Thanks!
>       Mark

Whoo!  New patch attached...


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

From ba284a78424dc87577983066aa04a8503d7a1e32 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Fri, 18 Sep 2015 16:58:31 -0500
Subject: [PATCH] gnu: guile: Add guile-wisp

* gnu/packages/guile.scm (guile-wisp): New variable.
---
 gnu/packages/guile.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index d5a95a0..07e3185 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gdbm)
+  #:use-module (gnu packages python)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -600,4 +601,81 @@ interface for reading articles in any format.")
 key-value cache and store.")
     (license lgpl3+)))
 
+(define-public guile-wisp
+  (package
+    (name "guile-wisp")
+    (version "0.9.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://bitbucket.org/ArneBab/"
+                                  "wisp/downloads/wisp-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "0y5fxacalkgbv9s71h58vdvm2h2ln3rk024dd0vszwcf953as5fq"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before
+          'configure 'substitute-before-config
+
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((bash (assoc-ref inputs "bash")))
+              ;; configure checks for guile-2.0, but ours is just named "guile" :)
+              (substitute* "configure"
+                (("guile-2.0") "guile"))
+              ;; Puts together some test files with /bin/bash hardcoded
+              (substitute* "Makefile.in"
+                (("/bin/bash")
+                 (string-append bash "/bin/bash") ))
+              #t)))
+
+         ;; auto compilation breaks, but if we set HOME to /tmp,
+         ;; that works ok
+         (add-before
+          'check 'auto-compile-hacky-workaround
+          (lambda _
+            (setenv "HOME" "/tmp")
+            #t))
+         (replace
+          'install
+          (lambda* (#:key outputs inputs #:allow-other-keys)
+            (use-modules (guix build utils)
+                         (system base compile))
+
+            (let* ((out (assoc-ref outputs "out"))
+                   (module-dir (string-append out "/share/guile/site/2.0"))
+                   (language-dir
+                    (string-append module-dir "/language/wisp"))
+                   (guild (string-append (assoc-ref inputs "guile")
+                                         "/bin/guild")))
+              ;; Make installation directories.
+              (mkdir-p module-dir)
+              (mkdir-p language-dir)
+
+              ;; copy the source
+              (copy-file "wisp-scheme.scm"
+                         (string-append module-dir "/wisp-scheme.scm"))
+              (copy-file "language/wisp/spec.scm"
+                         (string-append language-dir "/spec.scm"))
+
+              ;; compile to the destination
+              (compile-file "wisp-scheme.scm"
+                            #:output-file (string-append
+                                           module-dir "/wisp-scheme.go"))
+              (compile-file "language/wisp/spec.scm"
+                            #:output-file (string-append
+                                           language-dir "/spec.go"))
+              #t))))))
+    (home-page "http://draketo.de/english/wisp")
+    (inputs
+     `(("guile" ,guile-2.0)
+       ("python" ,python)))
+    (synopsis "wisp is a whitespace to lisp syntax for Guile")
+    (description "wisp is a syntax for Guile which provides a Python-like
+whitespace-significant language.  It may be easier on the eyes for some
+users and in some situations.")
+    (license gpl3+)))
+
 ;;; guile.scm ends here
-- 
2.1.4


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

* Re: gnu: guile: Add guile-wisp
  2015-10-06 21:45   ` Christopher Allan Webber
@ 2015-10-12  1:48     ` Mark H Weaver
  0 siblings, 0 replies; 7+ messages in thread
From: Mark H Weaver @ 2015-10-12  1:48 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Christopher Allan Webber <cwebber@dustycloud.org> writes:

> From ba284a78424dc87577983066aa04a8503d7a1e32 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber@dustycloud.org>
> Date: Fri, 18 Sep 2015 16:58:31 -0500
> Subject: [PATCH] gnu: guile: Add guile-wisp

Pushed with one minor change:

> +         (replace
> +          'install
> +          (lambda* (#:key outputs inputs #:allow-other-keys)
> +            (use-modules (guix build utils)
> +                         (system base compile))

I removed this 'use-modules' form and replaced it with the following in
the 'arguments' field:

--8<---------------cut here---------------start------------->8---
       #:modules ((system base compile)
                  ,@%gnu-build-system-modules)
--8<---------------cut here---------------end--------------->8---

    Thanks!
      Mark

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

end of thread, other threads:[~2015-10-12  1:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-19  4:24 gnu: guile: Add guile-wisp Christopher Allan Webber
2015-09-19  8:15 ` Ricardo Wurmus
2015-09-19 19:03   ` Christopher Allan Webber
2015-09-20  0:39 ` Mark H Weaver
2015-10-06 21:45   ` Christopher Allan Webber
2015-10-12  1:48     ` Mark H Weaver
2015-09-20 16:35 ` 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).