From patchwork Tue May 28 09:00:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 14104 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2B35D17050; Tue, 28 May 2019 15:42:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id EF3951703F for ; Tue, 28 May 2019 15:42:05 +0100 (BST) Received: from localhost ([127.0.0.1]:36061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVdIj-0004je-Ab for patchwork@mira.cbaines.net; Tue, 28 May 2019 10:42:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVdI3-0004Bg-NB for guix-patches@gnu.org; Tue, 28 May 2019 10:41:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVdHt-00017k-20 for guix-patches@gnu.org; Tue, 28 May 2019 10:41:17 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVdHh-000107-V4 for guix-patches@gnu.org; Tue, 28 May 2019 10:41:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hVdHh-0001em-QK for guix-patches@gnu.org; Tue, 28 May 2019 10:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35946] [PATCH] gnu: Add txr Resent-From: Guillaume LE VAILLANT Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 May 2019 14:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35946@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15590544296301 (code B ref -1); Tue, 28 May 2019 14:41:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 May 2019 14:40:29 +0000 Received: from localhost ([127.0.0.1]:56747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVdH9-0001dY-I1 for submit@debbugs.gnu.org; Tue, 28 May 2019 10:40:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVXzr-0004Fl-E2 for submit@debbugs.gnu.org; Tue, 28 May 2019 05:02:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:41369) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVXzm-00083Z-AE for submit@debbugs.gnu.org; Tue, 28 May 2019 05:02:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVXzh-0003wF-00 for guix-patches@gnu.org; Tue, 28 May 2019 05:02:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVXzf-0007yR-LV for guix-patches@gnu.org; Tue, 28 May 2019 05:02:04 -0400 Received: from mout02.posteo.de ([185.67.36.66]:49145) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVXze-0007wj-Ow for guix-patches@gnu.org; Tue, 28 May 2019 05:02:03 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4A8612400FC for ; Tue, 28 May 2019 11:02:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1559034120; bh=6ZUCgo/rmc3lsepYp08H8MDDY/S78fwLAPB7GSfm0WI=; h=From:To:Cc:Subject:Date:From; b=dY85Wo8AgbsXrhRtFvCu8udEDvuevWi4oOa6LhV1sjdZncwSO7JjpOWcPdcpyoKJO 4fcGi615fxo6vHSIR4lt/rPEu937YqsbwbMffXik7AZWQGMFcdTBTnJTEt4yAxfaXr U6keTQ+xp/kJTSZ19zQjRcw4GmHiuyq2C1VjHHJg0ilKo3n/c3RXKmI1GexsclQtLV d7yX0bhnV+qdtS+spjQ3b3uxL3RtgLykBX/1eHqBMh302wVzvtR7ng9fvxgNrSziK4 FyKYLkzLg0JtED1bLw6w5UpwGOXjwSNSuBv9YBGVji5womX9m/nQ6qdPe3Slo/Ro1W TfAaRaBpmD8Ew== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 45CnsM4CqPz9rxL; Tue, 28 May 2019 11:01:59 +0200 (CEST) Received: from yamatai.local (unknown [IPv6:2a01:e34:ed03:c7d0:7572:a793:d0a7:20b3]) by vps530281.ovh.net (Postfix) with ESMTPSA id A36984004E; Tue, 28 May 2019 11:01:58 +0200 (CEST) From: Guillaume LE VAILLANT Date: Tue, 28 May 2019 11:00:58 +0200 Message-Id: <20190528090058.6044-1-glv@posteo.net> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Tue, 28 May 2019 10:40:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guillaume LE VAILLANT Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/lisp.scm (txr): New variable. * gnu/packages/patches/txr-shell.patch: New file. --- gnu/packages/lisp.scm | 48 ++++++++++++++++++++++ gnu/packages/patches/txr-shell.patch | 59 ++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 gnu/packages/patches/txr-shell.patch diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 167c4433b1..52b832f948 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2018 Pierre Langlois ;;; Copyright © 2019 Katherine Cox-Buday ;;; Copyright © 2019 Jesse Gildersleve +;;; Copyright © 2019 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,8 +46,10 @@ #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages bdw-gc) + #:use-module (gnu packages bison) #:use-module (gnu packages compression) #:use-module (gnu packages ed) + #:use-module (gnu packages flex) #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) @@ -5321,3 +5324,48 @@ port within a range.") (define-public ecl-find-port (sbcl-package->ecl-package sbcl-find-port)) + +(define-public txr + (package + (name "txr") + (version "216") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.kylheku.com/cgit/txr/snapshot/txr-" + version + ".tar.bz2")) + (patches (search-patches "txr-shell.patch")) + (sha256 + (base32 + "07cxdpc9zsqd0c2668g00dqjpd6zc4mfdn74aarr6d2hpzdhh937")))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("cc=gcc") + #:phases (modify-phases %standard-phases + (add-after 'configure 'fix-tests + (lambda _ + (substitute* "tests/017/realpath.tl" + (("/usr/bin") "/")) + (substitute* "tests/017/realpath.expected" + (("/usr/bin") "/")) + #t)) + (replace 'check + (lambda _ + (zero? (system* "make" "tests"))))))) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex))) + (inputs + `(("libffi" ,libffi))) + (synopsis "General-purpose, multi-paradigm programming language") + (description + "TXR is a general-purpose, multi-paradigm programming language. It +comprises two languages integrated into a single tool: a text scanning and +extraction language referred to as the TXR Pattern Language (sometimes just +\"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR can be +used for everything from \"one liner\" data transformation tasks at the +command line, to data scanning and extracting scripts, to full application +development in a wide-range of areas.") + (home-page "https://nongnu.org/txr") + (license bsd-2))) diff --git a/gnu/packages/patches/txr-shell.patch b/gnu/packages/patches/txr-shell.patch new file mode 100644 index 0000000000..a4abb73eac --- /dev/null +++ b/gnu/packages/patches/txr-shell.patch @@ -0,0 +1,59 @@ +Use the current shell instead of trying to find another one and +failing to do so. + +diff --git a/configure b/configure +index f1adb919..7891b4dc 100755 +--- a/configure ++++ b/configure +@@ -26,28 +26,6 @@ + # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-# +-# The #!/bin/sh might be some legacy piece of crap, +-# not even up to 1990 POSIX.2 spec. So the first step +-# is to look for a better shell in some known places +-# and re-execute ourselves with that interpreter. +-# +- +-if test x$txr_shell = x ; then +- for shell in /bin/bash /usr/bin/bash /usr/xpg4/bin/sh ; do +- if test -x $shell ; then +- txr_shell=$shell +- break +- fi +- done +- if test x$txr_shell = x ; then +- echo "No known POSIX shell found: falling back on /bin/sh, which may not work" +- txr_shell=/bin/sh +- fi +- export txr_shell +- exec $txr_shell $0 ${@+"$@"} +-fi +- + set -u + + # +@@ -190,13 +168,6 @@ while [ $# -gt 0 ] ; do + exit 1 + fi + +- eval "var_exists=\${$var+y}" +- +- if [ "$var_exists" != y ] ; then +- printf "$0: nonexistent option: '%s'\n" "$1" +- exit 1 +- fi +- + eval "$var='$val'" + + eval "var_given_exists=\${${var}_given+y}" +@@ -208,6 +179,8 @@ while [ $# -gt 0 ] ; do + shift + done + ++txr_shell=$CONFIG_SHELL ++ + # + # If --help was given (or --help= or help=) then + # print help and exit. The termination status is failed, to indicate