gnu: mumi: Update to 0.0.0-12.bb2fe92.
[jackhill/guix/guix.git] / gnu / packages / ncurses.scm
index 3d01fe6..a969f3f 100644 (file)
@@ -1,11 +1,13 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 ng0 <ng0@n0.is>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 (define-public ncurses
   (package
     (name "ncurses")
-    (version "6.0")
+    (version "6.1-20190609")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://gnu/ncurses/ncurses-"
-                                  version ".tar.gz"))
-              (patches (search-patches "ncurses-CVE-2017-10684-10685.patch"))
+                                  (car (string-split version #\-))
+                                  ".tar.gz"))
               (sha256
                (base32
-                "0q3jck7lna77z5r42f13c4xglc7azd19pxfrjrpgp2yf615w4lgm"))))
+                "05qdmbmrrn88ii9f66rkcmcyzp1kb1ymkx7g040lfkd1nkp7w1da"))))
     (build-system gnu-build-system)
     (outputs '("out"
                "doc"))                ;1 MiB of man pages
@@ -55,7 +57,8 @@
      (let ((patch-makefile-phase
             '(lambda _
                (for-each patch-makefile-SHELL
-                         (find-files "." "Makefile.in"))))
+                         (find-files "." "Makefile.in"))
+               #t))
            (configure-phase
             ;; The 'configure' script does not understand '--docdir', so we must
             ;; override that and use '--mandir' instead.
                        #:allow-other-keys)
                (let ((out (assoc-ref outputs "out"))
                      (doc (assoc-ref outputs "doc")))
-                 (zero? (apply system* "./configure"
-                               (string-append "SHELL=" (which "sh"))
-                               (string-append "--build=" build)
-                               (string-append "--prefix=" out)
-                               (string-append "--mandir=" doc "/share/man")
-                               (if target
-                                   (cons (string-append "--host=" target)
-                                         configure-flags)
-                                   configure-flags))))))
+                 (apply invoke "./configure"
+                        (string-append "SHELL=" (which "sh"))
+                        (string-append "--build=" build)
+                        (string-append "--prefix=" out)
+                        (string-append "--mandir=" doc "/share/man")
+                        (if target
+                            (cons (string-append "--host=" target)
+                                  configure-flags)
+                            configure-flags))
+                 #t)))
+           (apply-rollup-patch-phase
+            ;; Ncurses distributes "stable" patchsets to be applied on top
+            ;; of the release tarball.  These are only available as shell
+            ;; scripts(!) so we decompress and apply them in a phase.
+            ;; See <https://invisible-mirror.net/archives/ncurses/6.1/README>.
+            '(lambda* (#:key inputs native-inputs #:allow-other-keys)
+               (copy-file (assoc-ref (or native-inputs inputs) "rollup-patch")
+                          (string-append (getcwd) "/rollup-patch.sh.bz2"))
+               (invoke "bzip2" "-d" "rollup-patch.sh.bz2")
+               (invoke "sh" "rollup-patch.sh")))
            (remove-shebang-phase
             '(lambda _
                ;; To avoid retaining a reference to the bootstrap Bash via the
                                            (when (file-exists? packagew.pc)
                                              (symlink packagew.pc package.pc))))
                                        '())))
-                             '("curses" "ncurses" "form" "panel" "menu")))))))
+                             '("curses" "ncurses" "form" "panel" "menu")))
+                 #t))))
        `(#:configure-flags
          ,(cons*
            'quasiquote
               ;; correct RUNPATH.
               ,(list 'unquote '(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out")
                                               "/lib"))
+
+              ;; Starting from ncurses 6.1, "make install" runs "install -s"
+              ;; by default, which doesn't work for cross-compiled binaries
+              ;; because it invokes 'strip' instead of 'TRIPLET-strip'.  Work
+              ;; around this.
+              ,@(if (%current-target-system) '("--disable-stripping") '())
+
               ;; MinGW: Use term-driver created for the MinGW port.
               ,@(if (target-mingw?) '("--enable-term-driver") '()))))
          #:tests? #f                  ; no "check" target
          #:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'apply-rollup-patch
+                      ,apply-rollup-patch-phase)
                     (replace 'configure ,configure-phase)
                     (add-after 'install 'post-install
                       ,post-install-phase)
                     (add-before 'configure 'patch-makefile-SHELL
                       ,patch-makefile-phase)
-                    (add-after 'unpack 'remove-unneeded-shebang
+                    (add-before 'patch-source-shebangs 'remove-unneeded-shebang
                       ,remove-shebang-phase)))))
-    (self-native-input? #t)           ; for `tic'
-     (native-inputs
-      `(("pkg-config" ,pkg-config)))
+    (native-inputs
+     `(,@(if (%current-target-system)
+             `(("self" ,this-package))            ;for `tic'
+             '())
+
+       ("rollup-patch"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append
+                 "https://invisible-mirror.net/archives/ncurses/"
+                 (car (string-split version #\-))
+                 "/ncurses-" version "-patch.sh.bz2"))
+           (sha256
+            (base32
+             "0hqlqdqmh7lfs6dwj763qksb4j9nk0pv6crzx5gnp6n4caz3i46g"))))
+
+       ("pkg-config" ,pkg-config)))
     (native-search-paths
      (list (search-path-specification
             (variable "TERMINFO_DIRS")
@@ -207,18 +245,18 @@ ncursesw library provides wide character support.")
 (define-public dialog
   (package
     (name "dialog")
-    (version "1.3-20171209")
+    (version "1.3-20200228")
     (source (origin
               (method url-fetch)
               (uri (string-append
-                    "http://invisible-mirror.net/archives/dialog/dialog-"
+                    "https://invisible-mirror.net/archives/dialog/dialog-"
                     version ".tgz"))
               (sha256
                (base32
-                "1rk72as52f5br3wcr74d00wib41w65g8wvi36mfgybly251984r0"))))
+                "1n8zbkigbzxw8gkw7qhzwzdyc7rbc7a0jcfy9z8ib7pf3qfw9y4z"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f)) ; no test suite
+     `(#:tests? #f))                    ; no test suite
     (inputs
      `(("ncurses" ,ncurses)))
     (synopsis "Curses widgets")
@@ -263,7 +301,7 @@ curses widgets, such as dialog boxes.")
                (setenv "CURSES_MENU_LDFLAGS" (string-append "-L" lib " -lmenu"))
                (setenv "CURSES_FORM_LDFLAGS" (string-append "-L" lib " -lform"))
                #t))))))
-    (home-page "http://search.cpan.org/dist/Curses")
+    (home-page "https://metacpan.org/release/Curses")
     (synopsis "Terminal screen handling and optimization")
     (description
      "@code{Curses} is the interface between Perl and the curses library