From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Allan Webber Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] gnu: guile: Add guile-irregex. Date: Thu, 05 Nov 2015 12:46:57 -0600 Message-ID: <87io5ge0ws.fsf@dustycloud.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1446750238 441 80.91.229.3 (5 Nov 2015 19:03:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Nov 2015 19:03:58 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Nov 05 20:03:51 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZuPp2-0004p4-5m for guile-devel@m.gmane.org; Thu, 05 Nov 2015 20:03:44 +0100 Original-Received: from localhost ([::1]:34633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuPp1-0008MJ-Kz for guile-devel@m.gmane.org; Thu, 05 Nov 2015 14:03:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuPc3-0000W6-2s for guile-devel@gnu.org; Thu, 05 Nov 2015 13:50:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuPby-0000K8-T4 for guile-devel@gnu.org; Thu, 05 Nov 2015 13:50:18 -0500 Original-Received: from dustycloud.org ([50.116.34.160]:55715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuPby-0000Jn-Oe for guile-devel@gnu.org; Thu, 05 Nov 2015 13:50:14 -0500 Original-Received: from earlgrey (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id A64CC267A6 for ; Thu, 5 Nov 2015 13:50:13 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 50.116.34.160 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17986 Archived-At: --=-=-= Content-Type: text/plain Irregex, packaged for Guile! Horray! On a side note, it would really be nice to have a r6rs-build-system... starting to result in a lot of similar spaghetti in a few of these packages. I don't know how that works though, so consider that a research project for another day. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-guile-Add-guile-irregex.patch >From 38edbac8ab42e1518424fd2da4d53ece2c96094c Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Thu, 5 Nov 2015 12:20:03 -0600 Subject: [PATCH] gnu: guile: Add guile-irregex. * gnu/packages/guile.scm (guile-irregex): New variable. --- gnu/packages/guile.scm | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index da75add..5f8ad73 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -478,6 +478,85 @@ slightly from miniKanren mainline. See http://minikanren.org/ for more on miniKanren generally.") (license expat))) +(define-public guile-irregex + (package + (name "guile-irregex") + (version "0.9.3") + (source (origin + (method url-fetch) + (uri (string-append + "http://synthcode.com/scheme/irregex/irregex-" + version + ".tar.gz")) + (sha256 + (base32 + "1b8jl7bycyl2ssp6sb1j24pp9hvqyxm85ki9bmwd50glyyjs5zay")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build utils) + (ice-9 match) + ,@%gnu-build-system-modules) + #:phases + (modify-phases %standard-phases + (delete 'check) + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (begin + (use-modules (guix build utils) + (ice-9 match)) + (let* ((out (assoc-ref outputs "out")) + (module-dir (string-append out "/share/guile/site/2.0")) + (source (assoc-ref inputs "source")) + (doc (string-append out "/share/doc/guile-irregex/")) + (guild (string-append (assoc-ref %build-inputs "guile") + "/bin/guild"))) + ;; Make installation directories. + (mkdir-p (string-append module-dir "/rx/source")) + (mkdir-p doc) + + ;; Compile .scm files and install. + (setenv "GUILE_AUTO_COMPILE" "0") + + (for-each (lambda (copy-info) + (match copy-info + ((src-file dest-file-basis) + (let* ((dest-file (string-append + module-dir dest-file-basis + ".scm")) + (go-file (string-append + module-dir dest-file-basis + ".go"))) + ;; Install source module. + (copy-file src-file + dest-file) + ;; Install compiled module. + (unless (zero? (system* guild "compile" + "-L" (getcwd) + "-o" go-file + src-file)) + (error (format #f "Failed to compile ~s to ~s!" + src-file dest-file))))))) + '(("irregex-guile.scm" "/rx/irregex") + ("irregex.scm" "/rx/source/irregex") + ;; Not really reachable via guile's packaging system, + ;; but nice to have around + ("irregex-utils.scm" "/rx/source/irregex-utils"))) + + ;; Also copy over the README. + (install-file "irregex.html" doc) + #t))))))) + (inputs + `(("guile" ,guile-2.0))) + (home-page "http://synthcode.com/scheme/irregex") + (synopsis "S-expression based regular expressions, packaged for Guile") + (description + "Irregex is an s-expression based alternative to your classic +string-based regular expressions. It implements SRFI 115 and is deeply +inspired by the SCSH regular expression system.") + (license bsd-3))) ;; There are two guile-gdbm packages, one using the FFI and one with ;; direct C bindings, hence the verbose name. -- 2.1.4 --=-=-=--