unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add guile-minikanren
@ 2015-04-22 15:15 Christopher Allan Webber
  2015-04-23 13:17 ` Andreas Enge
  0 siblings, 1 reply; 12+ messages in thread
From: Christopher Allan Webber @ 2015-04-22 15:15 UTC (permalink / raw)
  To: guix-devel

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

Here's a patch to add minikanren via ijp's port to r6rs packaging to
Guix.  It's my first Guix patch... I hope I did okay!

I named it guile-minikanren which isn't really accurate.  I'm not sure
how else I could name it though?  I'd be open to suggestions!

 - Chris


[-- Attachment #2: 0001-gnu-Add-guile-minikanren.patch --]
[-- Type: text/x-diff, Size: 3924 bytes --]

From ff72111b7f65afb02f6e52f8f48cf7ae02837380 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Tue, 21 Apr 2015 22:40:15 -0500
Subject: [PATCH] gnu: Add guile-minikanren.

* gnu/packages/guile.scm (guile-minikanren): New variable.
---
 AUTHORS                |  1 +
 gnu/packages/guile.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index fa1835b..e2dafe0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,5 +35,6 @@ alphabetical order):
           David Thompson <dthompson2@worcester.edu>
            Paul van der Walt <paul@denknerd.org>
         Mark H. Weaver <mhw@netris.org>
+ Christopher A. Webber <cwebber@dustycloud.org>
            Andy Wingo <wingo@pobox.com>
         Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index c605533..86bb4da 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +37,9 @@
   #:use-module (gnu packages base)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (ice-9 match))
 
@@ -358,4 +361,51 @@ http:://json.org specification.  These are the main features:
 - Allows JSON pretty printing.")
     (license lgpl3+)))
 
+(define-public guile-minikanren
+  (package
+    (name "guile-minikanren")
+    (version "2012.11.07")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ijp/minikanren.git")
+                    (commit "10d507785eab30b0f8b47bf8bb37d880731fc031")))
+              ;; sha256 goes here
+              (sha256
+               (base32
+                "00cq5k3yk58yzmjl0c3d72590xprb2cg7zvhnalql4v4f2pd8ida"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (begin
+           (let* ((out (assoc-ref %outputs "out"))
+                  (package-libs-dir
+                   (string-append out "/share/guile/site/2.0/"))
+                  (source (assoc-ref %build-inputs "source"))
+                  (doc (string-append out "share/doc")))
+             (mkdir-p package-libs-dir)
+             (copy-file (string-append source "/minikanren.scm")
+                        (string-append package-libs-dir "minikanren.scm"))
+             (copy-recursively (string-append source "/minikanren")
+                               (string-append package-libs-dir "/minikanren"))
+             (mkdir-p doc)
+             (copy-file (string-append source "/COPYING")
+                        (string-append doc "/guile-minikanren")))))))
+    (native-inputs `(("guile" ,guile-2.0)))
+    (home-page "https://github.com/ijp/minikanren")
+    (synopsis "The miniKanren declarative logic system, ported to Guile")
+    (description
+     "MiniKanren is a relational programming extension to the Scheme
+programming Language, written as a smaller version of Kanren suitable for
+pedagogical purposes. It is featured in the book, The Reasoned Schemer,
+written by Dan Friedman, William Byrd, and Oleg Kiselyov.
+
+This is a port to Guile.
+
+See http://minikanren.org/ for more on miniKanren generally.")
+    (license expat)))
+
 ;;; guile.scm ends here
-- 
2.1.4


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

* Re: Add guile-minikanren
  2015-04-22 15:15 Add guile-minikanren Christopher Allan Webber
@ 2015-04-23 13:17 ` Andreas Enge
  2015-04-23 13:44   ` Taylan Ulrich Bayırlı/Kammer
  2015-04-23 13:46   ` Thompson, David
  0 siblings, 2 replies; 12+ messages in thread
From: Andreas Enge @ 2015-04-23 13:17 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

On Wed, Apr 22, 2015 at 10:15:27AM -0500, Christopher Allan Webber wrote:
> Here's a patch to add minikanren via ijp's port to r6rs packaging to
> Guix.  It's my first Guix patch... I hope I did okay!

Thanks for contributing!

> I named it guile-minikanren which isn't really accurate.  I'm not sure
> how else I could name it though?  I'd be open to suggestions!

There is a chapter in the documentation about this:
   https://www.gnu.org/software/guix/manual/guix.html#Package-Naming
The main idea is to not think too much, but to simply use the upstream
project name. Here this seems to be "minikanren" without "guile-".
We have special rules for perl and python; maybe we also need a special
rule for guile?

> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/ijp/minikanren.git")
> +                    (commit "10d507785eab30b0f8b47bf8bb37d880731fc031")))

Is there no tarball? If possiblem we would prefer this.

> +              ;; sha256 goes here

Can be dropped.

> +    (native-inputs `(("guile" ,guile-2.0)))

"native-inputs" are used during the build of the package, which is not
the case here. Is guile needed at all as an input?

> +    (synopsis "The miniKanren declarative logic system, ported to Guile")

Do not start with an article, how about
"Guile implementation of the miniKanren domain specific language" ?

> +     "MiniKanren is a relational programming extension to the Scheme
> +programming Language, written as a smaller version of Kanren suitable for
> +pedagogical purposes. It is featured in the book, The Reasoned Schemer,

Use two spaces after ".". For such questions, you can run
   ./pre-inst-env guix lint PACKAGE

Concerning the content, I let the scheme specialists pronounce themselves.

Andreas

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

* Re: Add guile-minikanren
  2015-04-23 13:17 ` Andreas Enge
@ 2015-04-23 13:44   ` Taylan Ulrich Bayırlı/Kammer
  2015-04-23 13:46   ` Thompson, David
  1 sibling, 0 replies; 12+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-04-23 13:44 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> writes:

>> I named it guile-minikanren which isn't really accurate.  I'm not sure
>> how else I could name it though?  I'd be open to suggestions!
>
> There is a chapter in the documentation about this:
>    https://www.gnu.org/software/guix/manual/guix.html#Package-Naming
> The main idea is to not think too much, but to simply use the upstream
> project name. Here this seems to be "minikanren" without "guile-".
> We have special rules for perl and python; maybe we also need a special
> rule for guile?

I think the issue here is that miniKanren is a project of its own, and
this is a Guile port by a third party, so the package probably shouldn't
squat the name "minikanren".

IMO "guile-foo" is sensible for packages that install a Guile module,
akin to "perl-foo" and "python-foo".

Taylan

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

* Re: Add guile-minikanren
  2015-04-23 13:17 ` Andreas Enge
  2015-04-23 13:44   ` Taylan Ulrich Bayırlı/Kammer
@ 2015-04-23 13:46   ` Thompson, David
  2015-04-23 13:52     ` Andreas Enge
                       ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Thompson, David @ 2015-04-23 13:46 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

On Thu, Apr 23, 2015 at 9:17 AM, Andreas Enge <andreas@enge.fr> wrote:
> On Wed, Apr 22, 2015 at 10:15:27AM -0500, Christopher Allan Webber wrote:
>
>> I named it guile-minikanren which isn't really accurate.  I'm not sure
>> how else I could name it though?  I'd be open to suggestions!
>
> There is a chapter in the documentation about this:
>    https://www.gnu.org/software/guix/manual/guix.html#Package-Naming
> The main idea is to not think too much, but to simply use the upstream
> project name. Here this seems to be "minikanren" without "guile-".
> We have special rules for perl and python; maybe we also need a special
> rule for guile?

The prefix "guile-" is important here because the build system
installs the Scheme modules into a directory that is specifically for
Guile, not other R6RS compliant Scheme implementations.

>
>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://github.com/ijp/minikanren.git")
>> +                    (commit "10d507785eab30b0f8b47bf8bb37d880731fc031")))
>
> Is there no tarball? If possiblem we would prefer this.

No tarball.  I would recommend that the first 7 characters of the
commit SHA be used as the package version, and this string here could
just be replaced with 'version'.

>> +    (native-inputs `(("guile" ,guile-2.0)))
>
> "native-inputs" are used during the build of the package, which is not
> the case here. Is guile needed at all as an input?

It will be needed.  The build system should compile the Scheme files,
but it doesn't.

As a final note, I would like to add that the 'license' field can be
simply 'expat', instead of using the 'non-copyleft' procedure.

Thanks for working on this, Chris!

- Dave

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

* Re: Add guile-minikanren
  2015-04-23 13:46   ` Thompson, David
@ 2015-04-23 13:52     ` Andreas Enge
  2015-04-23 18:57     ` Ludovic Courtès
  2015-04-24  2:46     ` Christopher Allan Webber
  2 siblings, 0 replies; 12+ messages in thread
From: Andreas Enge @ 2015-04-23 13:52 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

On Thu, Apr 23, 2015 at 09:46:19AM -0400, Thompson, David wrote:
> No tarball.  I would recommend that the first 7 characters of the
> commit SHA be used as the package version, and this string here could
> just be replaced with 'version'.

For upgrades to work, the version needs to be sortable. So using the date
would be preferable.

Andreas

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

* Re: Add guile-minikanren
  2015-04-23 13:46   ` Thompson, David
  2015-04-23 13:52     ` Andreas Enge
@ 2015-04-23 18:57     ` Ludovic Courtès
  2015-04-23 19:48       ` Eric Bavier
  2015-04-24  2:46     ` Christopher Allan Webber
  2 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2015-04-23 18:57 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

"Thompson, David" <dthompson2@worcester.edu> skribis:

> On Thu, Apr 23, 2015 at 9:17 AM, Andreas Enge <andreas@enge.fr> wrote:
>> On Wed, Apr 22, 2015 at 10:15:27AM -0500, Christopher Allan Webber wrote:
>>
>>> I named it guile-minikanren which isn't really accurate.  I'm not sure
>>> how else I could name it though?  I'd be open to suggestions!
>>
>> There is a chapter in the documentation about this:
>>    https://www.gnu.org/software/guix/manual/guix.html#Package-Naming
>> The main idea is to not think too much, but to simply use the upstream
>> project name. Here this seems to be "minikanren" without "guile-".
>> We have special rules for perl and python; maybe we also need a special
>> rule for guile?
>
> The prefix "guile-" is important here because the build system
> installs the Scheme modules into a directory that is specifically for
> Guile, not other R6RS compliant Scheme implementations.

I agree with you an Taylan; “guile-minikanren” sounds right here.

>>> +    (source (origin
>>> +              (method git-fetch)
>>> +              (uri (git-reference
>>> +                    (url "https://github.com/ijp/minikanren.git")
>>> +                    (commit "10d507785eab30b0f8b47bf8bb37d880731fc031")))
>>
>> Is there no tarball? If possiblem we would prefer this.
>
> No tarball.  I would recommend that the first 7 characters of the
> commit SHA be used as the package version, and this string here could
> just be replaced with 'version'.

Maybe make the version (string-append "0-" commit) so we can eventually
increment that zero to make upgrades work, as Andreas notes?
(I think upstream minikanren is frozen anyway.)

>>> +    (native-inputs `(("guile" ,guile-2.0)))
>>
>> "native-inputs" are used during the build of the package, which is not
>> the case here. Is guile needed at all as an input?
>
> It will be needed.  The build system should compile the Scheme files,
> but it doesn't.

Even when it does this won’t be needed: there’s implicitly a Guile
running the build script already.  :-)

> As a final note, I would like to add that the 'license' field can be
> simply 'expat', instead of using the 'non-copyleft' procedure.

+1

Chris, could you post an updated patch taking into account alllll these
comments?  :-)

I hope the thorough review did not drive you away already.  ;-)
At any rate, welcome, and thanks for helping out!

Ludo’.

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

* Re: Add guile-minikanren
  2015-04-23 18:57     ` Ludovic Courtès
@ 2015-04-23 19:48       ` Eric Bavier
  2015-04-23 19:51         ` Andreas Enge
  2015-04-23 21:10         ` Ludovic Courtès
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Bavier @ 2015-04-23 19:48 UTC (permalink / raw)
  To: ludo; +Cc: guix-devel

On 2015-04-23 13:57, ludo@gnu.org wrote:
>>>> +    (source (origin
>>>> +              (method git-fetch)
>>>> +              (uri (git-reference
>>>> +                    (url "https://github.com/ijp/minikanren.git")
>>>> +                    (commit 
>>>> "10d507785eab30b0f8b47bf8bb37d880731fc031")))
>>> 
>>> Is there no tarball? If possiblem we would prefer this.
>> 
>> No tarball.  I would recommend that the first 7 characters of the
>> commit SHA be used as the package version, and this string here could
>> just be replaced with 'version'.
> 
> Maybe make the version (string-append "0-" commit) so we can eventually
> increment that zero to make upgrades work, as Andreas notes?
> (I think upstream minikanren is frozen anyway.)

Why not use YYYYMMDD.<7-char-sha> so that the version is less arbitrary? 
  It would still sort for upgrades.

Sounds like another set of conventions to document in the manual ;)

-- 
`~Eric

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

* Re: Add guile-minikanren
  2015-04-23 19:48       ` Eric Bavier
@ 2015-04-23 19:51         ` Andreas Enge
  2015-04-23 21:10         ` Ludovic Courtès
  1 sibling, 0 replies; 12+ messages in thread
From: Andreas Enge @ 2015-04-23 19:51 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

On Thu, Apr 23, 2015 at 02:48:50PM -0500, Eric Bavier wrote:
> Why not use YYYYMMDD.<7-char-sha> so that the version is less arbitrary?  It
> would still sort for upgrades.

I would support this idea, or drop the git hash (it is in the source code
anyway, and I think it unlikely we will have create two releases on the same
day).

Andreas

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

* Re: Add guile-minikanren
  2015-04-23 19:48       ` Eric Bavier
  2015-04-23 19:51         ` Andreas Enge
@ 2015-04-23 21:10         ` Ludovic Courtès
  1 sibling, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2015-04-23 21:10 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <ericbavier@openmailbox.org> skribis:

> On 2015-04-23 13:57, ludo@gnu.org wrote:
>>>>> +    (source (origin
>>>>> +              (method git-fetch)
>>>>> +              (uri (git-reference
>>>>> +                    (url "https://github.com/ijp/minikanren.git")
>>>>> +                    (commit
>>>>> "10d507785eab30b0f8b47bf8bb37d880731fc031")))
>>>>
>>>> Is there no tarball? If possiblem we would prefer this.
>>>
>>> No tarball.  I would recommend that the first 7 characters of the
>>> commit SHA be used as the package version, and this string here could
>>> just be replaced with 'version'.
>>
>> Maybe make the version (string-append "0-" commit) so we can eventually
>> increment that zero to make upgrades work, as Andreas notes?
>> (I think upstream minikanren is frozen anyway.)
>
> Why not use YYYYMMDD.<7-char-sha> so that the version is less
> arbitrary? It would still sort for upgrades.

Fine with me!

Ludo’.

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

* Re: Add guile-minikanren
  2015-04-23 13:46   ` Thompson, David
  2015-04-23 13:52     ` Andreas Enge
  2015-04-23 18:57     ` Ludovic Courtès
@ 2015-04-24  2:46     ` Christopher Allan Webber
  2015-04-25 21:30       ` Christopher Allan Webber
  2 siblings, 1 reply; 12+ messages in thread
From: Christopher Allan Webber @ 2015-04-24  2:46 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

Wow, a lot of feedback!  Okay, comments inline... I'm combining replies
into one email.

Andreas Enge writes:

>> +              ;; sha256 goes here
>
> Can be dropped.

Okay, dropping!

Thompson, David writes:

> On Thu, Apr 23, 2015 at 9:17 AM, Andreas Enge <andreas@enge.fr> wrote:
>> On Wed, Apr 22, 2015 at 10:15:27AM -0500, Christopher Allan Webber wrote:
>>
>>> I named it guile-minikanren which isn't really accurate.  I'm not sure
>>> how else I could name it though?  I'd be open to suggestions!
>>
>> There is a chapter in the documentation about this:
>>    https://www.gnu.org/software/guix/manual/guix.html#Package-Naming
>> The main idea is to not think too much, but to simply use the upstream
>> project name. Here this seems to be "minikanren" without "guile-".
>> We have special rules for perl and python; maybe we also need a special
>> rule for guile?
>
> The prefix "guile-" is important here because the build system
> installs the Scheme modules into a directory that is specifically for
> Guile, not other R6RS compliant Scheme implementations.

This, and that there's a more "official" minikanren implementation; this
one is the r6rs packaging of minikanren that Ian Price made in 2012.
I considered naming it r6rs-minikanren... but you're right, it ends up
in the guile directory anyway.

It might be nice to have a mainline version of minikanren.  I'm not
sure.  There is the additional problem that the mainline minikanren has
a bug so that it does not run unpatched in Guile:

  https://github.com/miniKanren/miniKanren/issues/2

(Also I'd love to see cKanren ported to Guile, to go a little bit
off topic!  Constraints seem like a nice feature...)

>>>> +    (native-inputs `(("guile" ,guile-2.0)))
>>>
>>> "native-inputs" are used during the build of the package, which is not
>>> the case here. Is guile needed at all as an input?
>>
>> It will be needed.  The build system should compile the Scheme files,
>> but it doesn't.
>
> Even when it does this won’t be needed: there’s implicitly a Guile
> running the build script already.  :-)

Working on it!  I ran into troubles getting guild to run with the
trivial-build-system but Mark Weaver has suggested that I use the
gnu-build-system and tear out the phases I don't need since that will
set up the environment variables and stuff.  So I'm working on that...

>> As a final note, I would like to add that the 'license' field can be
>> simply 'expat', instead of using the 'non-copyleft' procedure.
>
> +1
>

I thought of this.  It's true that Guix has a convenient mechanism, but
is this true from a licensing standpoint, however?  It's straight-up
expat licensing, but when I see stuff like this:

  Copyright (c) 2005 Daniel P. Friedman, William E. Byrd and Oleg Kiselyov
  Copyright (c) 2012 Ian Price

  [...]

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

... it makes me think that the license has effectively required eternal
one-off copies of itself since the copyright notice must be
preserved... is it possible to separate them from this file, and put it
somewhere else?

I suspect debian-legal has already answered this one...

> Eric Bavier <ericbavier@openmailbox.org> skribis:
>
>> On 2015-04-23 13:57, ludo@gnu.org wrote:
>>>>>> +    (source (origin
>>>>>> +              (method git-fetch)
>>>>>> +              (uri (git-reference
>>>>>> +                    (url "https://github.com/ijp/minikanren.git")
>>>>>> +                    (commit
>>>>>> "10d507785eab30b0f8b47bf8bb37d880731fc031")))
>>>>>
>>>>> Is there no tarball? If possiblem we would prefer this.
>>>>
>>>> No tarball.  I would recommend that the first 7 characters of the
>>>> commit SHA be used as the package version, and this string here could
>>>> just be replaced with 'version'.
>>>
>>> Maybe make the version (string-append "0-" commit) so we can eventually
>>> increment that zero to make upgrades work, as Andreas notes?
>>> (I think upstream minikanren is frozen anyway.)
>>
>> Why not use YYYYMMDD.<7-char-sha> so that the version is less
>> arbitrary? It would still sort for upgrades.
>
> Fine with me!

Okay, I'll use that format!

> Chris, could you post an updated patch taking into account alllll these
> comments?  :-)
>
> I hope the thorough review did not drive you away already.  ;-)
> At any rate, welcome, and thanks for helping out!
>
> Ludo’.

It's good to know the community is thorough.  I will admit that my first
impression was, "this is just copying a few files, how hard of an early
submission could it be?"  But in a sense it's nice because iteration 0
was not so hard, and refining to take this feedback into account has
been a nice learning process.

Anyway, I'm working on it.  Will respond with that soon!

 - Chris

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

* Re: Add guile-minikanren
  2015-04-24  2:46     ` Christopher Allan Webber
@ 2015-04-25 21:30       ` Christopher Allan Webber
  2015-04-27  1:46         ` David Thompson
  0 siblings, 1 reply; 12+ messages in thread
From: Christopher Allan Webber @ 2015-04-25 21:30 UTC (permalink / raw)
  To: Thompson, David; +Cc: guix-devel

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

Okay, I believe I've taken all feedback into account.  Everything seems
to work right now, and it even compiles the files to .go files.

I think that's everything (but let me know if not!)
 - Chris


[-- Attachment #2: 0001-gnu-Add-guile-minikanren.patch --]
[-- Type: text/x-diff, Size: 5509 bytes --]

From 85507e938f3ea95c33a490c716b6569384f47ade Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Tue, 21 Apr 2015 22:40:15 -0500
Subject: [PATCH] gnu: Add guile-minikanren.

* gnu/packages/guile.scm (guile-minikanren): New variable.
---
 AUTHORS                |  1 +
 gnu/packages/guile.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index fa1835b..e2dafe0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,5 +35,6 @@ alphabetical order):
           David Thompson <dthompson2@worcester.edu>
            Paul van der Walt <paul@denknerd.org>
         Mark H. Weaver <mhw@netris.org>
+ Christopher A. Webber <cwebber@dustycloud.org>
            Andy Wingo <wingo@pobox.com>
         Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index c605533..e2c8063 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +37,9 @@
   #:use-module (gnu packages base)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (ice-9 match))
 
@@ -358,4 +361,81 @@ http:://json.org specification.  These are the main features:
 - Allows JSON pretty printing.")
     (license lgpl3+)))
 
+(define-public guile-minikanren
+  (package
+    (name "guile-minikanren")
+    ;; YYYYMMDD.7-char-commit-id
+    (version "20150424.e844d85")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/ijp/minikanren.git")
+                    (commit "e844d85512f8c055d3f96143ee506007389a25e3")))
+              (sha256
+               (base32
+                "0r50jlpzi940jlmxyy3ddqqwmj5r12gb4bcv0ssini9v8km13xz6"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules
+       ((guix build utils))
+       #:builder
+       (begin
+         ;; Can we remove this?
+         (use-modules (guix build utils))
+         (let* ((out (assoc-ref %outputs "out"))
+                (package-libs-dir
+                 (string-append out "/share/guile/site/2.0/"))
+                (source (assoc-ref %build-inputs "source"))
+                (doc (string-append out "share/doc"))
+                ;; assume we're tacking ".scm" on the end of all of these
+                (scm-files '("/minikanren"  ;; .scm, not the directory
+                             "/minikanren/mkextraforms"
+                             "/minikanren/mkprelude"
+                             "/minikanren/mk")))
+           ;; make install/out location plus minikanren subdir
+           (mkdir-p (string-append package-libs-dir "/minikanren"))
+           (mkdir-p (string-append out "/minikanren"))
+
+           ;; compile .scm files and copy
+           (map (lambda (filename)
+                  (let ((from-scm-file (string-append source filename ".scm"))
+                        (to-scm-file (string-append package-libs-dir filename ".scm"))
+                        (to-compiled-file
+                         (string-append package-libs-dir filename ".go")))
+                    (copy-file from-scm-file to-scm-file)
+                    (if (not (zero?
+                              (system*
+                               (string-append (assoc-ref %build-inputs "guile")
+                                              "/bin/guild")
+                               "compile"
+                               ;; Set the load-path to be the source directory
+                               "-L" source
+                               "-o" to-compiled-file
+                               from-scm-file)))
+                        (error (format #f "Failed to compile ~s to ~s!"
+                                       from-scm-file
+                                       to-compiled-file)))))
+                scm-files)
+
+           ;; Also copy over the README
+           (mkdir-p doc)
+           (copy-file (string-append source "/README.org")
+                      (string-append doc "/README.org"))))))
+    (native-inputs `(("guile" ,guile-2.0)))
+    (home-page "https://github.com/ijp/minikanren")
+    (synopsis "miniKanren declarative logic system, packaged for Guile")
+    (description
+     "MiniKanren is a relational programming extension to the Scheme
+programming Language, written as a smaller version of Kanren suitable for
+pedagogical purposes.  It is featured in the book, The Reasoned Schemer,
+written by Dan Friedman, William Byrd, and Oleg Kiselyov.
+
+This is Ian Price's r6rs packaged version of miniKranen, which deviates
+slightly from miniKanren mainline.
+
+See http://minikanren.org/ for more on miniKanren generally.")
+    ;; We need to copy over this file explicitly though because it requires
+    ;; that the copyright notice be preserved
+    (license expat)))
+
 ;;; guile.scm ends here
-- 
2.1.4


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

* Re: Add guile-minikanren
  2015-04-25 21:30       ` Christopher Allan Webber
@ 2015-04-27  1:46         ` David Thompson
  0 siblings, 0 replies; 12+ messages in thread
From: David Thompson @ 2015-04-27  1:46 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

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

> Okay, I believe I've taken all feedback into account.  Everything seems
> to work right now, and it even compiles the files to .go files.
>
> I think that's everything (but let me know if not!)

I cleaned up the build script and pushed this as commit 6bc2406.

Congrats on your first upstream package! Thanks! :)

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

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

end of thread, other threads:[~2015-04-27  1:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-22 15:15 Add guile-minikanren Christopher Allan Webber
2015-04-23 13:17 ` Andreas Enge
2015-04-23 13:44   ` Taylan Ulrich Bayırlı/Kammer
2015-04-23 13:46   ` Thompson, David
2015-04-23 13:52     ` Andreas Enge
2015-04-23 18:57     ` Ludovic Courtès
2015-04-23 19:48       ` Eric Bavier
2015-04-23 19:51         ` Andreas Enge
2015-04-23 21:10         ` Ludovic Courtès
2015-04-24  2:46     ` Christopher Allan Webber
2015-04-25 21:30       ` Christopher Allan Webber
2015-04-27  1:46         ` David Thompson

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