aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2016, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2018, 2022-2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(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 bison)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages libsigsegv)
  #:use-module (gnu packages multiprecision)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #: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
  (package
   (name "gawk")
   (version "5.3.0")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/gawk/gawk-" version
                                ".tar.xz"))
            (sha256
             (base32 "02x97iyl9v84as4rkdrrkfk2j4vy4r3hpp3rkp3gh3qxs79id76a"))))
   (build-system gnu-build-system)
   (arguments
    (list #:phases
          #~(modify-phases %standard-phases
              (add-before 'configure 'set-shell-file-name
                (lambda* (#:key inputs #:allow-other-keys)
                  ;; Refer to the right shell.
                  (let ((/bin/sh (search-input-file inputs "bin/sh")))
                    (substitute* "io.c"
                      (("/bin/sh") /bin/sh))

                    ;; When cross-compiling, remove dependencies on the
                    ;; `check-for-shared-lib-support' target, which tries
                    ;; to run the cross-built `gawk'.
                    #$@(if (%current-target-system)
                           '((substitute* "extension/Makefile.in"
                                 (("^.*: check-for-shared-lib-support" match)
                                  (string-append "### " match))))
                           '()))))

              (add-before 'check 'adjust-test-infrastructure
                (lambda _
                  ;; Remove dependency on 'more' (from util-linux), which
                  ;; would needlessly complicate bootstrapping.
                  (substitute* "test/Makefile"
                    (("\\| more") ""))

                  ;; Adjust the shebang in that file since it is then diff'd
                  ;; against the actual test output.
                  (substitute* "test/watchpoint1.ok"
                    (("#! /usr/bin/gawk")
                     (string-append "#!" (which "gawk")))))))))

   ;; Tests explicitly require en_US.UTF-8, fr_FR.UTF-8, ru_RU.UTF-8 and
   ;; ja_JP.UTF-8.
   (native-inputs (list (libc-utf8-locales-for-target)))

   (inputs (list libsigsegv
                 ;; Use the full-fledged Bash package, otherwise the test suite
                 ;; sometimes fail non-deterministically.
                 bash))

   (search-paths
    (list (search-path-specification
           (variable "AWKPATH")
           (files (list "share/awk")))
          (search-path-specification
           (variable "AWKLIBPATH")
           (files (list "lib/gawk")))))
   (home-page "https://www.gnu.org/software/gawk/")
   (synopsis "Text scanning and processing language")
   (description
    "Gawk is the GNU implementation of Awk, a specialized programming
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 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)))))

;; 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")
    (version "1.3.4-20240905")
    (home-page "https://invisible-island.net/mawk/mawk.html")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://invisible-mirror.net/archives/mawk"
                                  "/mawk-" version ".tgz"))
              (sha256
               (base32
                "1q4rfcv7ppfw4fra8hp8z0s4qnsv1x598ny4xwb026zsgn96g6d3"))
              (modules '((guix build utils)))
              (snippet
               '(begin
                  ;; Delete file generated by bison.
                  (delete-file "parse.c")
                  ;; Prevent tests from hard coding PATH to a bogus value.
                  (substitute* '("test/mawktest" "test/fpe_test")
                    (("^PATH=.*")
                     ""))))))
    (build-system gnu-build-system)
    (arguments
     (list #:parallel-build? #f))   ; Prevent a race condition.
    (native-inputs
     (list bison))
    (synopsis "Text scanning and processing language")
    (description
     "@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 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/sh") (which "sh"))
               (("/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")))
             (substitute* '("runtests"
                            "testdir/testawk"
                            "testdir/testcpp"
                            "testdir/testdel")
               (("/bin/sh") (which "sh")))
             (substitute* "testsuite.awk"
               (("/usr/bin/awk") (which "awk")))))
         (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 'fix-awk-paths '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 "Wrapper script that adds C preprocessing to Enhanced GNU Awk")))
u/packages/llvm.scm?id=a1eca979fb8da842e73c42f4f53be29b169810f2'>Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe 2021-10-09gnu: clang@11, clang@12: Do not refer to /lib on foreign distros....Partly fixes <https://issues.guix.gnu.org/51088>. * gnu/packages/patches/clang-11.0-libc-search-path.patch: Update. * gnu/packages/patches/clang-12.0-libc-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/llvm.scm (clang-12): Use it. Ludovic Courtès 2021-10-09gnu: clang@7, clang@8: Do not refer to /lib on foreign distros....Partly fixes <https://issues.guix.gnu.org/51088>. * gnu/packages/patches/clang-7.0-libc-search-path.patch: Update. * gnu/packages/patches/clang-8.0-libc-search-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/llvm.scm (clang-8): Use it. Ludovic Courtès 2021-10-07gnu: llvm-3.6: Fix build....* gnu/packages/patches/llvm-3.6-fix-build-with-gcc-10.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/llvm.scm (llvm-3.6)[source]: Use it. Guillaume Le Vaillant 2021-09-27gnu: llvm: Let it cross-compile....The derivation when compiling natively remains the same, so this doesn't cause any rebuilds. * gnu/packages/llvm.scm (llvm-12)[arguments]<#:configure-flags>: Set LLVM_TABLEGEN, LLVM_DEFAULT_TARGET_TRIPLE, LLVM_TARGET_ARCH and LLVM_TARGETS_TO_BUILD when cross-compiling. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Maxime Devos 2021-09-23gnu: lldb: Update to 12.0.1....* gnu/packages/llvm.scm (lldb): Update to 12.0.1. [inputs]: Change from LLVM-11 and CLANG-11 to LLVM-12 and CLANG-12. Marius Bakke 2021-09-23gnu: lld: Update to 12.0.1....* gnu/packages/llvm.scm (lld): Update to 12.0.1. [native-inputs]: Add LIBUNWIND-HEADERS. Marius Bakke 2021-09-23gnu: Add libunwind-headers....* gnu/packages/llvm.scm (libunwind-headers): New public variable. Marius Bakke 2021-09-23gnu: LLVM, Clang: Update to 12.0.1....* gnu/packages/patches/clang-12-tools-extra-directory.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/llvm.scm (llvm-12, clang-runtime-12): Update to 12.0.1. (clang-12): Likewise. Remove obsolete patch. Marius Bakke 2021-09-17Merge branch 'master' into core-updates-frozen... Conflicts: gnu/packages/bioinformatics.scm gnu/packages/chez.scm gnu/packages/docbook.scm gnu/packages/ebook.scm gnu/packages/gnome.scm gnu/packages/linux.scm gnu/packages/networking.scm gnu/packages/python-web.scm gnu/packages/python-xyz.scm gnu/packages/tex.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/dune.scm guix/build-system/go.scm guix/build-system/linux-module.scm guix/packages.scm Marius Bakke 2021-09-10gnu: llvm-for-rocm: Move to llvm.scm....This removes a cross-module top-level reference, which could lead to build errors when importing (gnu packages rocm) in another module. * gnu/packages/rocm.scm (llvm-for-rocm): Move to... * gnu/packages/llvm.scm (llvm-for-rocm): ... here. Ludovic Courtès 2021-08-12Merge branch 'master' into core-updates-frozen... Conflicts: gnu/packages/algebra.scm gnu/packages/games.scm gnu/packages/golang.scm gnu/packages/kerberos.scm gnu/packages/mail.scm gnu/packages/python.scm gnu/packages/ruby.scm gnu/packages/scheme.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm Marius Bakke 2021-08-04gnu: Add python-clang....* gnu/packages/llvm.scm (clang-python-bindings): New procedure. (python-clang-10, python-clang-11, python-clang-12): New variables. Ludovic Courtès 2021-07-24gnu: Use 'search-input-directory' and 'search-input-file' where appropriate....This changes some of the remaining uses of this idiom: (string-append (assoc-ref inputs "LABEL") "FILE") to one of: (search-input-file inputs "FILE") (search-input-directory inputs "FILE") * gnu/packages/axoloti.scm (axoloti-patcher): Use 'search-input-directory'. (axoloti-patcher-next): Likewise. * gnu/packages/bioinformatics.scm (java-picard): Likewise. * gnu/packages/bootloaders.scm (grub-hybrid): Likewise. (u-boot-puma-rk3399): Likewise. (u-boot-rock64-rk3328): Likewise. (u-boot-firefly-rk3399): Likewise. (u-boot-rockpro64-rk3399): Likewise. (u-boot-pinebook-pro-rk3399): Likewise. * gnu/packages/cran.scm (r-shiny): Likewise. (r-shinytree): Likewise. * gnu/packages/education.scm (anki): Likewise. * gnu/packages/emacs-xyz.scm (emacs-flycheck-grammalecte): Likewise. (emacs-rime): Likewise. * gnu/packages/emulators.scm (dolphin-emu): Likewise. * gnu/packages/games.scm (bsd-games): Likewise. (seahorse-adventures): Likewise. (einstein): Likewise. * gnu/packages/gimp.scm (gimp-fourier): Likewise. * gnu/packages/gnome.scm (gspell): Likewise. * gnu/packages/guile-xyz.scm (guile-libyaml): Likewise. * gnu/packages/java.scm (icedtea-7): Likewise. * gnu/packages/language.scm (nimf): Likewise. * gnu/packages/lxde.scm (spacefm): Likewise. * gnu/packages/mail.scm (claws-mail): Likewise. * gnu/packages/netpbm.scm (netpbm): Likewise. * gnu/packages/networking.scm (blueman): Likewise. * gnu/packages/scheme.scm (scm): Likewise. * gnu/packages/security-token.scm (python-fido2): Likewise. * gnu/packages/syndication.scm (rtv): Likewise. * gnu/packages/tls.scm (acme-client): Likewise. * gnu/packages/web.scm (netsurf): Likewise. * gnu/packages/wine.scm (wine-staging): Likewise. * gnu/packages/wxwidgets.scm (wxwidgets): Likewise. Ludovic Courtès 2021-07-24gnu: Use 'search-input-directory' when looking for C/C++ library headers....* gnu/packages/arcan.scm (arcan)[arguments]: Use 'search-input-directory' for "include/libdrm" and "include/apr-1". * gnu/packages/bioinformatics.scm (sailfish): Likewise for jellyfish. * gnu/packages/boost.scm (boost-for-irods): Likewise for libcxx headers. * gnu/packages/cedille.scm (cedille): Likewise for IAL headers. * gnu/packages/compression.scm (snappy-with-clang6): Likewise for libcxx headers. * gnu/packages/cups.scm (hplip): Likewise for libusb headers. * gnu/packages/emulators.scm (pcsxr): Likewise for libcdio headers. * gnu/packages/game-development.scm (python2-renpy): Likewise for fribidi headers. * gnu/packages/games.scm (pokerth): Likewise for libircclient. * gnu/packages/guile-xyz.scm (guile-persist): Likewise for Guile. * gnu/packages/hurd.scm (hurd): Likewise for libtirpc. * gnu/packages/irods.scm (irods, irods-client-icommands): Likewise for libcxx, catch2, and nlohmann-json-cpp. * gnu/packages/julia.scm (julia): Use 'search-input-file' for libuv's errno.h. * gnu/packages/kde-pim.scm (kdepim-runtime): Use 'search-input-directory' for "include/KF5". (kmessagelib): Likewise. * gnu/packages/kde.scm (kdeconnect): Likewise. * gnu/packages/llvm.scm (clang-runtime-3.5): Likewise for libtirpc. * gnu/packages/mpi.scm (openmpi): Likewise for "include/infiniband". * gnu/packages/pumpio.scm (pumpa): Use 'search-input-file' for "tidy.h" and "aspell.h". * gnu/packages/radio.scm (dream): Use 'search-input-file' and 'search-input-directory' for pulseaudio, sndfile, etc. * gnu/packages/selinux.scm (policycoreutils): Likewise for PAM and libaudit. * gnu/packages/serialization.scm (avro-cpp-1.9-for-irods): Likewise for libcxx. * gnu/packages/sync.scm (nextcloud-client): Likewise for "include/KF5". * gnu/packages/video.scm (mkvtoolnix): Likewise for "include/gtest". (libopenshot): Likewise for "include/UnitTest++". * gnu/packages/virtualization.scm (criu): Likewise for libnl3 and for protobuf file. Ludovic Courtès 2021-06-06Merge branch 'master' into core-updates... Conflicts: gnu/local.mk gnu/packages/algebra.scm gnu/packages/bioinformatics.scm gnu/packages/curl.scm gnu/packages/docbook.scm gnu/packages/emacs-xyz.scm gnu/packages/maths.scm gnu/packages/plotutils.scm gnu/packages/python-web.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/readline.scm gnu/packages/tls.scm gnu/packages/xml.scm gnu/packages/xorg.scm Marius Bakke 2021-06-01gnu: llvm-7: Update to 7.1.0....* gnu/packages/llvm.scm (llvm-7): Update to 7.1.0. Efraim Flashner 2021-05-09Merge branch 'master' into core-updates... Conflicts: gnu/local.mk gnu/packages/bioinformatics.scm gnu/packages/django.scm gnu/packages/gtk.scm gnu/packages/llvm.scm gnu/packages/python-web.scm gnu/packages/python.scm gnu/packages/tex.scm guix/build-system/asdf.scm guix/build/emacs-build-system.scm guix/profiles.scm Marius Bakke 2021-04-28gnu: LLVM, Clang: Add 12.0.0....* gnu/packages/patches/clang-12-tools-extra-directory.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/llvm.scm (llvm-12, clang-runtime-12, clang-12, clang-toolchain-12): New variables. (llvm-11): Inherit from LLVM-12. Marius Bakke 2021-04-21gnu: Add libcxx+libcxxabi-6....* gnu/packages/llvm.scm (libcxx+libcxxabi-6): New variable. Ricardo Wurmus 2021-04-21gnu: Add libcxxabi-6....* gnu/packages/llvm.scm (libcxxabi-6): New variable. Ricardo Wurmus 2021-04-16Merge remote-tracking branch 'origin/master' into core-updates... Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm Efraim Flashner 2021-04-10gnu: Remove clang-runtime-3.6 and clang-3.6....* gnu/packages/llvm.scm (clang-runtime-3.6, clang-3.6): Remove variables. Signed-off-by: Leo Famulari <leo@famulari.name> zimoun