all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#35946] [PATCH] gnu: Add txr
@ 2019-05-28  9:00 Guillaume LE VAILLANT
  2019-06-01 13:03 ` bug#35946: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Guillaume LE VAILLANT @ 2019-05-28  9:00 UTC (permalink / raw)
  To: 35946; +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 © 2018 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019 Katherine Cox-Buday <cox.katherine.e@gmail.com>
 ;;; Copyright © 2019 Jesse Gildersleve <jessejohngildersleve@protonmail.com>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
 ;;;
 ;;; 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=<nonempty> or help=<nonempty>) then
+ # print help and exit. The termination status is failed, to indicate
-- 
2.21.0

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

* bug#35946: [PATCH] gnu: Add txr
  2019-05-28  9:00 [bug#35946] [PATCH] gnu: Add txr Guillaume LE VAILLANT
@ 2019-06-01 13:03 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-06-01 13:03 UTC (permalink / raw)
  To: Guillaume LE VAILLANT; +Cc: 35946-done

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

Hi Guillaume,

Guillaume LE VAILLANT <glv@posteo.net> skribis:

> * gnu/packages/lisp.scm (txr): New variable.
> * gnu/packages/patches/txr-shell.patch: New file.

Applied with the following minor changes.  Thank you!

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1137 bytes --]

diff --git a/gnu/local.mk b/gnu/local.mk
index 3a199f82f8..03a8818e78 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1317,6 +1317,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/totem-meson-easy-codec.patch		\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-include-qregexpvalidator.patch	\
+  %D%/packages/patches/txr-shell.patch				\
   %D%/packages/patches/u-boot-fix-mkimage-header-verification.patch	\
   %D%/packages/patches/unzip-CVE-2014-8139.patch		\
   %D%/packages/patches/unzip-CVE-2014-8140.patch		\
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 52b832f948..dfc58d469f 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -5367,5 +5367,5 @@ extraction language referred to as the TXR Pattern Language (sometimes just
 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)))
+    (home-page "https://nongnu.org/txr/")
+    (license license:bsd-2)))

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

end of thread, other threads:[~2019-06-01 13:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28  9:00 [bug#35946] [PATCH] gnu: Add txr Guillaume LE VAILLANT
2019-06-01 13:03 ` bug#35946: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.