From mboxrd@z Thu Jan 1 00:00:00 1970 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 Subject: [bug#35946] [PATCH] gnu: Add txr Resent-Message-ID: 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) From: Guillaume LE VAILLANT Date: Tue, 28 May 2019 11:00:58 +0200 Message-Id: <20190528090058.6044-1-glv@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35946@debbugs.gnu.org Cc: Guillaume LE VAILLANT * 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 =C2=A9 2018 Pierre Langlois ;;; Copyright =C2=A9 2019 Katherine Cox-Buday ;;; Copyright =C2=A9 2019 Jesse Gildersleve +;;; Copyright =C2=A9 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.") =20 (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=3Dgcc") + #: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 a= nd +extraction language referred to as the TXR Pattern Language (sometimes j= ust +\"TXR\"), and a general-purpose dialect of Lisp called TXR Lisp. TXR ca= n be +used for everything from \"one liner\" data transformation tasks at the +command line, to data scanning and extracting scripts, to full applicati= on +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. +=20 +-# +-# 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 =3D x ; then +- for shell in /bin/bash /usr/bin/bash /usr/xpg4/bin/sh ; do +- if test -x $shell ; then +- txr_shell=3D$shell +- break +- fi +- done +- if test x$txr_shell =3D x ; then +- echo "No known POSIX shell found: falling back on /bin/sh, which ma= y not work" +- txr_shell=3D/bin/sh +- fi +- export txr_shell +- exec $txr_shell $0 ${@+"$@"} +-fi +- + set -u +=20 + # +@@ -190,13 +168,6 @@ while [ $# -gt 0 ] ; do + exit 1 + fi +=20 +- eval "var_exists=3D\${$var+y}" +- +- if [ "$var_exists" !=3D y ] ; then +- printf "$0: nonexistent option: '%s'\n" "$1" +- exit 1 +- fi +- + eval "$var=3D'$val'" +=20 + eval "var_given_exists=3D\${${var}_given+y}" +@@ -208,6 +179,8 @@ while [ $# -gt 0 ] ; do + shift + done +=20 ++txr_shell=3D$CONFIG_SHELL ++ + # + # If --help was given (or --help=3D or help=3D) the= n + # print help and exit. The termination status is failed, to indicate --=20 2.21.0