gnu: Add vtk-6.
[jackhill/guix/guix.git] / gnu / packages / base.scm
index 0fed144..d984ebe 100644 (file)
@@ -1,11 +1,11 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2019 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
-;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2016, 2018 Alex Vong <alexvong1995@gmail.com>
 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
@@ -13,7 +13,7 @@
 ;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
                 #:select (gpl3+ lgpl2.0+ lgpl3+ public-domain))
   #:use-module (gnu packages)
   #:use-module (gnu packages acl)
+  #:use-module (gnu packages algebra)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages ed)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages compression)
@@ -55,6 +57,8 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
   #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
   #:export (glibc
             libiconv-if-needed))
 
@@ -501,6 +505,33 @@ included.")
    (license gpl3+)
    (home-page "https://www.gnu.org/software/binutils/")))
 
+(define-public binutils-gold
+  (package
+    (inherit binutils)
+    (name "binutils-gold")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'patch-source-shebangs 'patch-more-shebangs
+           (lambda _
+             (substitute* "gold/Makefile.in"
+               (("/bin/sh") (which "sh")))
+             #t)))
+       ,@(substitute-keyword-arguments (package-arguments binutils)
+         ; Upstream is aware of unrelocatable test failures on arm*.
+         ((#:tests? _ #f)
+          (if (any (cute string-prefix? <> (or (%current-target-system)
+                                               (%current-system)))
+                   '("i686" "x86_64"))
+              '#t '#f))
+         ((#:configure-flags flags)
+          `(cons* "--enable-gold=default"
+                 (delete "LDFLAGS=-static-libgcc" ,flags))))))
+     (native-inputs
+     `(("bc" ,bc)))
+     (inputs
+     `(("gcc:lib" ,gcc "lib")))))
+
 (define* (make-ld-wrapper name #:key
                           (target (const #f))
                           binutils
@@ -569,9 +600,9 @@ wrapper for the cross-linker for that target, called 'TARGET-ld'."
                        #t)))))
     (synopsis "The linker wrapper")
     (description
-     "The linker wrapper (or 'ld-wrapper') wraps the linker to add any
-missing '-rpath' flags, and to detect any misuse of libraries outside of the
-store.")
+     "The linker wrapper (or @code{ld-wrapper}) wraps the linker to add any
+missing @code{-rpath} flags, and to detect any misuse of libraries outside of
+the store.")
     (home-page "https://www.gnu.org/software/guix//")
     (license gpl3+)))
 
@@ -861,7 +892,10 @@ with the Linux kernel.")
                                        "glibc-hidden-visibility-ldconfig.patch"
                                        "glibc-versioned-locpath.patch"
                                        "glibc-allow-kernel-2.6.32.patch"
-                                       "glibc-reinstate-prlimit64-fallback.patch"))))))
+                                       "glibc-reinstate-prlimit64-fallback.patch"
+                                       "glibc-CVE-2018-11236.patch"
+                                       "glibc-CVE-2018-11237.patch"))))
+    (properties `((lint-hidden-cve . ("CVE-2017-18269")))))) ; glibc-2.27-git-fixes
 
 (define-public glibc-2.26
   (package
@@ -975,7 +1009,30 @@ with the Linux kernel.")
                   (("/bin/pwd") "pwd"))
                 #t))))))))
 
-(define-public glibc-locales
+(define-public (make-gcc-libc base-gcc libc)
+  "Return a GCC that targets LIBC."
+  (package (inherit base-gcc)
+           (name (string-append (package-name base-gcc) "-"
+                                (package-name libc) "-"
+                                (package-version libc)))
+           (arguments
+            (substitute-keyword-arguments
+             (ensure-keyword-arguments (package-arguments base-gcc)
+                                       '(#:implicit-inputs? #f))
+             ((#:make-flags flags)
+              `(let ((libc (assoc-ref %build-inputs "libc")))
+                 ;; FLAGS_FOR_TARGET are needed for the target libraries to receive
+                 ;; the -Bxxx for the startfiles.
+                 (cons (string-append "FLAGS_FOR_TARGET=-B" libc "/lib")
+                       ,flags)))))
+           (native-inputs
+            `(("libc" ,libc)
+              ("libc:static" ,libc "static")
+              ,@(append (package-inputs base-gcc)
+                        (fold alist-delete (%final-inputs) '("libc" "libc:static")))))
+           (inputs '())))
+
+(define-public (make-glibc-locales glibc)
   (package
     (inherit glibc)
     (name "glibc-locales")
@@ -985,20 +1042,55 @@ with the Linux kernel.")
     (synopsis "All the locales supported by the GNU C Library")
     (description
      "This package provides all the locales supported by the GNU C Library,
-more than 400 in total.  To use them set the 'LOCPATH' environment variable to
-the 'share/locale' sub-directory of this package.")
+more than 400 in total.  To use them set the @code{LOCPATH} environment variable
+to the @code{share/locale} sub-directory of this package.")
     (outputs '("out"))                            ;110+ MiB
     (native-search-paths '())
     (arguments
      (let ((args `(#:tests? #f #:strip-binaries? #f
                    ,@(package-arguments glibc))))
        (substitute-keyword-arguments args
+         ((#:modules modules '((guix build utils)
+                               (guix build gnu-build-system)))
+          `((srfi srfi-11)
+            (gnu build locale)
+            ,@modules))
+         ((#:imported-modules modules '())
+          `((gnu build locale)
+            ,@%gnu-build-system-modules))
          ((#:phases phases)
           `(modify-phases ,phases
              (replace 'build
                (lambda _
                  (invoke "make" "localedata/install-locales"
                          "-j" (number->string (parallel-job-count)))))
+             (add-after 'build 'symlink-normalized-codesets
+               (lambda* (#:key outputs #:allow-other-keys)
+                 ;; The above phase does not install locales with names using
+                 ;; the "normalized codeset."  Thus, create symlinks like:
+                 ;;   en_US.utf8 -> en_US.UTF-8
+                 (define (locale-directory? file stat)
+                   (and (file-is-directory? file)
+                        (string-index (basename file) #\_)
+                        (string-rindex (basename file) #\.)))
+
+                 (let* ((out (assoc-ref outputs "out"))
+                        (locales (find-files out locale-directory?
+                                             #:directories? #t)))
+                   (for-each (lambda (directory)
+                               (let*-values (((base)
+                                              (basename directory))
+                                             ((name codeset)
+                                              (locale->name+codeset base))
+                                             ((normalized)
+                                              (normalize-codeset codeset)))
+                                 (unless (string=? codeset normalized)
+                                   (symlink base
+                                            (string-append (dirname directory)
+                                                           "/" name "."
+                                                           normalized)))))
+                             locales)
+                   #t)))
              (delete 'install)
              (delete 'move-static-libs)))
          ((#:configure-flags flags)
@@ -1010,7 +1102,7 @@ the 'share/locale' sub-directory of this package.")
                                         ,(version-major+minor
                                           (package-version glibc)))))))))))
 
-(define-public glibc-utf8-locales
+(define-public (make-glibc-utf8-locales glibc)
   (package
     (name "glibc-utf8-locales")
     (version (package-version glibc))
@@ -1060,6 +1152,18 @@ test environments.")
     (home-page (package-home-page glibc))
     (license (package-license glibc))))
 
+(define-public glibc-locales
+  (make-glibc-locales glibc))
+(define-public glibc-utf8-locales
+  (make-glibc-utf8-locales glibc))
+
+(define-public glibc-locales-2.27
+  (package (inherit (make-glibc-locales glibc-2.27))
+           (name "glibc-locales-2.27")))
+(define-public glibc-utf8-locales-2.27
+  (package (inherit (make-glibc-utf8-locales glibc-2.27))
+           (name "glibc-utf8-locales-2.27")))
+
 (define-public which
   (package
     (name "which")
@@ -1111,15 +1215,15 @@ command.")
 (define-public tzdata
   (package
     (name "tzdata")
-    (version "2018g")
+    (version "2019b")
     (source (origin
              (method url-fetch)
              (uri (string-append
-                   "https://www.iana.org/time-zones/repository/releases/tzdata"
+                   "https://data.iana.org/time-zones/releases/tzdata"
                    version ".tar.gz"))
              (sha256
               (base32
-               "05kayi3w9pvhj6ljx1hvwd0r8mxfzn436fjmwhx53xkj919xxpq2"))))
+               "0r0clnlslwm15m1c61dinf1fi9ffgl6aipng7i7yryfwj0n0kn85"))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f
@@ -1165,11 +1269,11 @@ command.")
     (inputs `(("tzcode" ,(origin
                           (method url-fetch)
                           (uri (string-append
-                                "http://www.iana.org/time-zones/repository/releases/tzcode"
+                                "https://data.iana.org/time-zones/releases/tzcode"
                                 version ".tar.gz"))
                           (sha256
                            (base32
-                            "09y44fzcdq3c06saa8iqqa0a59cyw6ni3p31ps0j1w3hcpxz8lxa"))))))
+                            "0vbmswvv3li25s31shyllq5v24449lxnrki9hr043nipjd09sirf"))))))
     (home-page "https://www.iana.org/time-zones")
     (synopsis "Database of current and historical time zones")
     (description "The Time Zone Database (often called tz or zoneinfo)
@@ -1187,7 +1291,25 @@ and daylight-saving rules.")
 (define-public tzdata-for-tests
   (hidden-package
    (package
-     (inherit tzdata))))
+     (inherit tzdata)
+     (version "2018g")
+     (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://data.iana.org/time-zones/releases/tzdata"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "05kayi3w9pvhj6ljx1hvwd0r8mxfzn436fjmwhx53xkj919xxpq2"))))
+     (inputs
+       `(("tzcode" ,(origin
+                     (method url-fetch)
+                     (uri (string-append
+                           "http://data.iana.org/time-zones/releases/tzcode"
+                           version ".tar.gz"))
+                     (sha256
+                      (base32
+                       "09y44fzcdq3c06saa8iqqa0a59cyw6ni3p31ps0j1w3hcpxz8lxa")))))))))
 
 (define-public libiconv
   (package