aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2019 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019, 2020, 2022 Marius Bakke <marius@gnu.org>
;;;
;;; 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 readline)
  #:use-module (guix licenses)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages perl)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix utils)
  #:use-module (ice-9 format))

(define (patch-url version seqno)
  (format #f "mirror://gnu/readline/readline-~a-patches/readline~a-~3,'0d"
          version (string-join (string-split version #\.) "") seqno))

(define (readline-patch version seqno sha256-bv)
  "Return the origin of Readline patch SEQNO, with expected hash SHA256-BV"
  (origin
    (method url-fetch)
    (uri (patch-url version seqno))
    (sha256 sha256-bv)))

(define-syntax-rule (patch-series version (seqno hash) ...)
  (list (readline-patch version seqno (base32 hash))
        ...))

(define %patch-series-8.1
  (patch-series
   "8.1"
   (1 "0i4ikdqgcjnb40y2ss3lm09rq56zih5rzma3bib50dk3d1d4cak8")
   (2 "1p15sfx5xg5k4lam12lyd0givk7dfjddqpnb1jdp3c4clray0nz5")))

(define %patch-series-7.0
  (patch-series
   "7.0"
   (1 "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs")
   (2 "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7")
   (3 "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy")
   (4 "0r3bbaf12iz8m02z6p3fzww2m365fhn71xmzab2p62gj54s6h9gr")
   (5 "0lxpa4f72y2nsgj6fgrhjk2nmmxvccys6aciwfxwchb5f21rq5fa")))

(define-public readline
  (package
    (name "readline")
    (version (string-append "8.1."
                            (number->string (length %patch-series-8.1))))
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/readline/readline-"
                                  (version-major+minor version) ".tar.gz"))
              (sha256
               (base32
                "00ibp0n9crbwx15k9vvckq5wsipw98b1px8pd8i34chy2gpb9kpq"))
              (patches (append %patch-series-8.1
                               (search-patches "readline-link-ncurses.patch")))
              (patch-flags '("-p0"))))
    (build-system gnu-build-system)
    (propagated-inputs (list ncurses))
    (arguments
     (list #:configure-flags
           #~(list (string-append
                    "LDFLAGS=-Wl,-rpath -Wl,"
                    (dirname (search-input-file %build-inputs
                                                "lib/libncurses.so")))

                   ;; This test does an 'AC_TRY_RUN', which aborts when
                   ;; cross-compiling, so provide the correct answer.
                   #$@(if (%current-target-system)
                          '("bash_cv_wcwidth_broken=no")
                          '())
                   ;; MinGW: ncurses provides the termcap api.
                   #$@(if (target-mingw?)
                          '("bash_cv_termcap_lib=ncurses")
                          '()))

           #:make-flags
           (if (target-mingw?)
               ;; MinGW: termcap in ncurses
               ;; some SIG_* #defined in _POSIX
               #~'("TERMCAP_LIB=-lncurses"
                   "CPPFLAGS=-D_POSIX -D'chown(f,o,g)=0'")
               #~'())))
    (synopsis "Edit command lines while typing, with history support")
    (description
     "The GNU readline library allows users to edit command lines as they
are typed in.  It can maintain a searchable history of previously entered
commands, letting you easily recall, edit and re-enter past commands.  It
features both Emacs-like and vi-like keybindings, making its usage
comfortable for anyone.")
    (license gpl3+)
    (home-page "https://savannah.gnu.org/projects/readline/")))

(define-public readline-7
  (package (inherit readline)
    (name "readline")
    (version (string-append "7.0."
                            (number->string (length %patch-series-7.0))))
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/readline/readline-"
                                  (version-major+minor version) ".tar.gz"))
              (sha256
               (base32
                "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm"))
              (patches (append
                        %patch-series-7.0
                        (search-patches "readline-link-ncurses.patch")))
              (patch-flags '("-p0"))))))

(define-public readline-6.2
  (package (inherit readline)
    (version "6.2")
    (source (origin (inherit (package-source readline))
              (method url-fetch)
              (uri (string-append "mirror://gnu/readline/readline-"
                                  version ".tar.gz"))
              (patches (search-patches "readline-6.2-CVE-2014-2524.patch"))
              (patch-flags '("-p0"))
              (sha256
               (base32
                "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))))

(define-public rlwrap
  (package
    (name "rlwrap")
    (version "0.46.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/hanslub42/rlwrap")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0shck0hb3jssk5l2pfylxgwrhlkwydj2ld6j7qk2ns2zviymg8n8"))))
    (build-system gnu-build-system)
    (native-inputs
     (list autoconf automake perl))
    (inputs
     (list readline))
    (synopsis "Wrapper to allow the editing of keyboard commands")
    (description
     "Rlwrap is a 'readline wrapper', a small utility that uses the GNU
readline library to allow the editing of keyboard input for any command.  You
should consider rlwrap especially when you need user-defined completion (by way
of completion word lists) and persistent history, or if you want to program
`special effects' using the filter mechanism.")
    (home-page "https://github.com/hanslub42/rlwrap")
    (license gpl2+)))
eproducible-geniso.patch: New file … * gnu/local.mk (dist_patch_DATA): … add it. Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr> Co-authored-by: Brice Waegeneire <brice@waegenei.re> Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Vincent Legoll 2020-12-29gnu: u-boot-rockpro64-rk3399: Fix freeze on boot....* gnu/packages/bootloaders.scm (u-boot-rockpro64-rk3399)[arguments]<#:phases> [patch-rockpro64-config]: Build with modified config to prevent freeze on boot due to usb being enabled. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Caliph Nomble 2020-12-29Revert "gnu: u-boot: Fix freeze on boot with u-boot-rockpro64-rk3399."...because it was applied to the wrong u-boot. This reverts commit d980e6e275aed80e65ad3b7e17c5a5118661e2c2. Danny Milosavljevic 2020-12-28gnu: u-boot: Fix freeze on boot with u-boot-rockpro64-rk3399....* gnu/packages/bootloaders.scm (u-boot-rockpro64-rk3399)[arguments]<#:phases> [patch-rockpro64-config]: Build with modified config to prevent freeze on boot due to usb being enabled. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Caliph Nomble via Guix-patches via 2020-12-20gnu: dtc: Update to 1.6.0....* gnu/packages/bootloaders.scm (dtc): Update to 1.6.0. Marius Bakke 2020-11-24gnu: grub-minimal: Fix cross-compilation....Fixes a regression introduced in 34a6f123514b5677d442ed7cd609ff01534904b8 that would break cross-compilation of 'grub-minimal' because it would enable Freetype support as a side effect but the 'set-freetype-variables' phase was not inherited in 'grub-minimal'. * gnu/packages/bootloaders.scm (grub-minimal)[arguments]: Use 'substitute-keyword-arguments' so that the 'set-freetype-variables' phase is inherited. Ludovic Courtès 2020-11-23gnu: grub: Fix cross-compiling for other architectures....Reported by cbaines and xelxebar on IRC. * gnu/packages/bootloaders.scm (grub)[arguments]: In custom 'set-freetype-variables phase only use the native-inputs version of freetype. Efraim Flashner 2020-11-16gnu: grub: Cross-compile for mips64el-linux....* gnu/packages/bootloaders.scm (grub)[arguments]: Add custom phase to set BUILD_FREETYPE_* flags. [native-inputs]: Add freetype. Efraim Flashner 2020-11-16gnu: grub: Don't run tests when cross compiling....* gnu/packages/bootloaders.scm (grub)[arguments]: Skip tests when cross-compiling. Efraim Flashner 2020-11-16gnu: dtc: Cross compile....* gnu/packages/bootloaders.scm (dtc)[arguments]: Use cc-for-target in make-flags. Add custom phase to use correct pkg-config for target. Efraim Flashner 2020-11-08gnu: grub: Only do code substitution when input is available....* gnu/packages/bootloaders.scm (grub)[arguments]: In custom 'patch-stuff phase only substitute the absolute location of the mdadm binary when it is an input. Efraim Flashner 2020-10-24gnu: u-boot-tools: Update tests....* gnu/packages/bootloaders (u-boot-tools): Call tcheck target instead of all tests. Drop adjustment to test coverage percentage. Update substitution of python coverage binary. Re-enable coverage tests of dtoc and fdt. Disable additional configuration options that require OpenSSL. Vagrant Cascadian 2020-10-24gnu: u-boot: Update to 2020.10....* gnu/packages/bootloaders (u-boot): Update to 2020.10. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: Refresh patch. Vagrant Cascadian 2020-10-23Revert "gnu: u-boot: Update to 2020.10."...This reverts commit fe6067fc248673d6509b557ff010778f7762382f. This commit broke u-boot-tools. Maxim Cournoyer 2020-10-18gnu: u-boot: Update to 2020.10....* gnu/packages/bootloaders (u-boot): Update to 2020.10. * gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch: Refresh patch. Vagrant Cascadian 2020-09-19gnu: u-boot: Reomve sdl2 dependency on non-GUI builds....* gnu/packages/bootloaders.scm (u-boot)[native-inputs]: Remove sdl2. (u-boot-tools)[native-inputs]: Add sdl2. Danny Milosavljevic 2020-07-09gnu: u-boot: Update to 2020.07....* gnu/packages/bootloaders (u-boot): Update to 2020.07. (u-boot-pinebook-pro-rk3399): Remove patches. * gnu/packages/patches: u-boot-DT-for-Pinebook-Pro.patch, u-boot-add-boe-nv140fhmn49-display.patch, u-boot-gpio-keys-binding-cons.patch, u-boot-leds-common-binding-con.patch, u-boot-support-Pinebook-Pro-laptop.patch, u-boot-video-rockchip-fix-build.patch: Remove patches. u-boot-riscv64-fix-extlinux.patch: Refresh patch. * gnu/local.mk (dist_patch_DATA): Update accordingly. Vagrant Cascadian