From f5efde47f7d21f1f35f8b974af8d8f375114a6ea Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 4 Jul 2022 04:59:27 +0000 Subject: gnu: Use 'license:' prefix in (gnu packages gawk). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gawk.scm: Import (guix licenses) with 'license:' prefix. (gawk, mawk)[license]: Prefix with 'license:'. Signed-off-by: Ludovic Courtès --- gnu/packages/gawk.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 1935e73ab7..91252094b5 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -20,7 +20,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages gawk) - #:use-module (guix licenses) + #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) #:use-module (gnu packages bash) #:use-module (gnu packages libsigsegv) @@ -93,7 +93,7 @@ (define-public gawk language for the easy manipulation of formatted text, such as tables of data. Gawk features many extensions beyond the traditional implementation, including network access, sorting, and large libraries.") - (license gpl3+))) + (license license:gpl3+))) (define-public mawk (package @@ -120,4 +120,4 @@ (define-public mawk "@command{mawk} is an interpreter for the Awk programming language. This version aims to be smaller and faster than GNU Awk, at the expense of fewer features and extensions.") - (license gpl2))) ;version 2 only + (license license:gpl2))) ;version 2 only -- cgit v1.2.3 From 2e5c519b3f5d12b41132d535164fa04801f1bd4e Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 4 Jul 2022 04:59:30 +0000 Subject: gnu: Add gawk-mpfr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gawk.scm (gawk-mpfr): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/gawk.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 91252094b5..52ac66f9bb 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2021 Marius Bakke +;;; Copyright © 2022 Paul A. Patience ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,6 +25,7 @@ (define-module (gnu packages gawk) #:use-module (gnu packages) #:use-module (gnu packages bash) #:use-module (gnu packages libsigsegv) + #:use-module (gnu packages multiprecision) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu)) @@ -95,6 +97,14 @@ (define-public gawk including network access, sorting, and large libraries.") (license license:gpl3+))) +;; Separate from gawk to facilitate bootstrapping. +(define-public gawk-mpfr + (package/inherit gawk + (name "gawk-mpfr") + (inputs + (modify-inputs (package-inputs gawk) + (prepend mpfr))))) + (define-public mawk (package (name "mawk") -- cgit v1.2.3 From 1fed71ce1976db9edf95fc4b99cac75a281fb526 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 4 Jul 2022 04:59:33 +0000 Subject: gnu: Add egawk-next. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gawk.scm (egawk-next): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/gawk.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 52ac66f9bb..6b905f6654 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -28,6 +28,7 @@ (define-module (gnu packages gawk) #:use-module (gnu packages multiprecision) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix build-system gnu)) (define-public gawk @@ -105,6 +106,34 @@ (define-public gawk-mpfr (modify-inputs (package-inputs gawk) (prepend mpfr))))) +;; Suffixed with -next because, similarly to Emacs, development versions are +;; numbered x.y.60+z, and also there are no tagged versions of egawk yet. +;; (However, though egawk's --version lists 5.1.60, it is actually forked from +;; a development version of gawk 5.1.1.) +(define-public egawk-next + (let ((commit "f00e74ffc73f6ba6fe74fb7a26319770b8c3792c") + (revision "0")) + (package + (inherit gawk-mpfr) + (name "egawk-next") + (version (git-version "5.1.60" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://www.kylheku.com/git/egawk") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0bmfbw6k1aiyiardnk7ha5zlpkvavj013mm4n7wwj2vdcgrs6p1f")))) + (home-page "https://www.kylheku.com/cgit/egawk/") + (synopsis "Enhanced GNU Awk") + (description + "@command{egawk} is Enhanced GNU Awk. It is a fork of GNU Awk with +some enhancements designed and implemented by Kaz Kylheku. In particular, +Enhanced GNU Awk provides the @code{@@let} statement for declaring +block-scoped lexical variables.")))) + (define-public mawk (package (name "mawk") -- cgit v1.2.3 From e07fa9b04009f0b239931674e1a48536a52e3276 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Mon, 4 Jul 2022 04:59:36 +0000 Subject: gnu: Add cppawk and cppawk-egawk. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gawk.scm (cppawk, cppawk-egawk): New variables. Signed-off-by: Ludovic Courtès --- gnu/packages/gawk.scm | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'gnu/packages/gawk.scm') diff --git a/gnu/packages/gawk.scm b/gnu/packages/gawk.scm index 6b905f6654..9feaf059fb 100644 --- a/gnu/packages/gawk.scm +++ b/gnu/packages/gawk.scm @@ -23,12 +23,16 @@ (define-module (gnu packages gawk) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu packages) + #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages gcc) #:use-module (gnu packages libsigsegv) #:use-module (gnu packages multiprecision) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix utils) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu)) (define-public gawk @@ -160,3 +164,84 @@ (define-public mawk This version aims to be smaller and faster than GNU Awk, at the expense of fewer features and extensions.") (license license:gpl2))) ;version 2 only + +(define-public cppawk + (package + (name "cppawk") + (version "20220703") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://www.kylheku.com/git/cppawk") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0b09757q81sz4gn62k3mv5bgllyb2v5m64346s8fc99mqqif70cx")))) + (build-system copy-build-system) + (arguments + `(#:install-plan '(("bin/cppawk" "bin/cppawk") + ("share/cppawk/include" "share/cppawk/include") + ("./" "share/man/man1" #:include-regexp (".*\\.1$"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-paths + (lambda _ + (substitute* "bin/cppawk" + (("/bin/bash") (which "bash")) + (("dirname") (which "dirname")) + (("mktemp") (which "mktemp")) + ;; Extra space to prevent matching Awk's printf. + (("printf ") (string-append (which "printf") " ")) + (("rm -f") (string-append (which "rm") " -f")) + (("prepro=cpp") (string-append "prepro=" (which "cpp"))) + (("sed -e") (string-append (which "sed") " -e"))))) + (add-after 'fix-paths 'fix-awk-paths + (lambda _ + (substitute* "bin/cppawk" + (("awk=gawk") (string-append "awk=" (which "gawk"))) + (("awk '") (string-append (which "gawk") " '"))))) + (add-after 'build 'check + (lambda _ + (invoke "./runtests")))))) + (native-inputs + ;; For tests + (list mawk)) + (inputs + (list coreutils ; For dirname, mktemp, printf, rm + gawk-mpfr ; Default variant, but supports others + gcc ; For cpp + sed)) + (home-page "https://www.kylheku.com/cgit/cppawk/") + (synopsis "Wrapper script that adds C preprocessing to Awk") + (description + "@command{cppawk} is a shell script that invokes the C preprocessor +(@command{cpp}) on Awk code and calls Awk (by default GNU Awk) on the result. + +@command{cppawk} understands the basic Awk options like @option{-F} and +@option{-v}, and also understands common @command{cpp} options like +@option{-I} and @option{-Dmacro=value}. + +@command{cppawk} has no dependencies beyond Awk, @command{cpp}, @command{sed} +and some GNU core utilities (including @command{printf}). Preprocessed +programs can be captured and transferred to systems that have Awk but not +@command{cpp} or @command{cppawk}.") + (license license:bsd-2))) + +(define-public cppawk-egawk + (package/inherit cppawk + (name "cppawk-egawk") + (arguments + (substitute-keyword-arguments (package-arguments cppawk) + ((#:phases phases) + `(modify-phases ,phases + (replace 'fix-awk-paths + (lambda _ + (substitute* "bin/cppawk" + (("awk=gawk") (string-append "awk=" (which "egawk"))) + (("awk '") (string-append (which "egawk") " '"))))))))) + (inputs + (modify-inputs (package-inputs cppawk) + (delete "gawk-mpfr") + (prepend egawk-next))) + (synopsis "cppawk that calls Enhanced GNU Awk by default"))) -- cgit v1.2.3