From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Allan Webber Subject: Re: Add guile-minikanren Date: Sat, 25 Apr 2015 16:30:00 -0500 Message-ID: <87y4lfj3ir.fsf@earlgrey.lan> References: <87wq14dwd9.fsf@earlgrey.lan> <20150423131751.GA12941@debian.math.u-bordeaux1.fr> <87383qjk8y.fsf@earlgrey.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym7i9-0000cq-6e for guix-devel@gnu.org; Sat, 25 Apr 2015 17:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym7i5-0003Q0-Jm for guix-devel@gnu.org; Sat, 25 Apr 2015 17:34:05 -0400 Received: from dustycloud.org ([50.116.34.160]:36065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym7i5-0003P4-FO for guix-devel@gnu.org; Sat, 25 Apr 2015 17:34:01 -0400 In-reply-to: <87383qjk8y.fsf@earlgrey.lan> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: "Thompson, David" Cc: guix-devel --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-guile-minikanren.patch Content-Transfer-Encoding: quoted-printable >From 85507e938f3ea95c33a490c716b6569384f47ade Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber 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 Paul van der Walt Mark H. Weaver + Christopher A. Webber Andy Wingo Ricardo Wurmus 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 =C2=A9 2012, 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2014, 2015 Mark H Weaver +;;; Copyright =C2=A9 2015 Christopher Allan Webber ;;; ;;; 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)) =20 @@ -358,4 +361,81 @@ http:://json.org specification. These are the main = features: - Allows JSON pretty printing.") (license lgpl3+))) =20 +(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 thes= e + (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 fil= ename ".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 dir= ectory + "-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 fo= r +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 requi= res + ;; that the copyright notice be preserved + (license expat))) + ;;; guile.scm ends here --=20 2.1.4 --=-=-=--