;;; 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>
;;; 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)
#: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))
(arguments
`(#:phases
(modify-phases %standard-phases
+ (add-before 'check 'disable-failing-tests
+ (lambda _
+ ;; These tests are expected to fail due to a glibc bug which has
+ ;; been fixed in 2.28, so they are unexpectedly passing. They
+ ;; should be fixed for grep versions > 3.1.
+ (substitute* "tests/Makefile.in"
+ (("^[[:blank:]]+backref-alt[[:blank:]]+\\\\") "\\")
+ (("^[[:blank:]]+triple-backref[[:blank:]]+\\\\") "\\"))
+ #t))
(add-after 'install 'fix-egrep-and-fgrep
;; Patch 'egrep' and 'fgrep' to execute 'grep' via its
;; absolute file name instead of searching for it in $PATH.
(base32
"178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y"))
(patches (search-patches
+ "findutils-gnulib-libio.patch"
"findutils-localstatedir.patch"
+ "findutils-makedev.patch"
"findutils-test-xargs.patch"))
(modules '((guix build utils)))
(snippet
(define-public coreutils
(package
(name "coreutils")
- (version "8.29")
+ (version "8.30")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/coreutils/coreutils-"
version ".tar.xz"))
(sha256
(base32
- "0plm1zs9il6bb5mk881qvbghq4glc8ybbgakk2lfzb0w64fgml4j"))))
+ "0mxhw43d4wpqmvg0l4znk1vm10fy92biyh90lzdnqjcic2lb6cg8"))))
(build-system gnu-build-system)
(inputs `(("acl" ,acl) ; TODO: add SELinux
("gmp" ,gmp) ;bignums in 'expr', yay!
(substitute* (find-files "gnulib-tests" "\\.c$")
(("/bin/sh") (which "sh")))
(substitute* (find-files "tests" "\\.sh$")
- (("#!/bin/sh") (which "sh")))
+ (("#!/bin/sh") (string-append "#!" (which "sh"))))
+ #t))
+ (add-before 'check 'disable-broken-test
+ (lambda _
+ ;; This test hits the 127 character shebang limit in the build
+ ;; environment due to the way "env -S" splits arguments into
+ ;; shebangs. Note that "env-S-script.sh" works around this
+ ;; specific issue, but "env-S.pl" is not adjusted for build
+ ;; environments with long prefixes (/tmp/guix-build-...).
+ (substitute* "Makefile"
+ (("^.*tests/misc/env-S.pl.*$") ""))
#t)))
;; Work around a cross-compilation bug whereby libcoreutils.a would
(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
#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+)))
(export make-ld-wrapper)
-(define-public glibc/linux
+(define-public glibc
+ ;; This is the GNU C Library, used on GNU/Linux and GNU/Hurd. Prior to
+ ;; version 2.28, GNU/Hurd used a different glibc branch.
(package
(name "glibc")
;; Note: Always use a dot after the minor version since various places rely
;; on "version-major+minor" to determine where locales are found.
- (version "2.27")
+ (version "2.28")
(source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
(sha256
(base32
- "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji"))
+ "10iha5ynvdj5m62vgpgqbq4cwvc2yhyl2w9yyyjgfxmdmx8h145i"))
(snippet
;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
;; required on LFS distros to avoid loading the distro's libc.so
#t))
(modules '((guix build utils)))
(patches (search-patches "glibc-ldd-x86_64.patch"
- "glibc-2.27-git-fixes.patch"
+ "glibc-2.28-git-fixes.patch"
"glibc-hidden-visibility-ldconfig.patch"
"glibc-versioned-locpath.patch"
"glibc-allow-kernel-2.6.32.patch"
(build-system gnu-build-system)
;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
- ;; users should automatically pull Linux headers as well.
- (propagated-inputs `(("kernel-headers" ,linux-libre-headers)))
+ ;; users should automatically pull Linux headers as well. On GNU/Hurd,
+ ;; libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
+ ;; so both should be propagated.
+ (propagated-inputs
+ (if (hurd-target?)
+ `(("hurd-core-headers" ,hurd-core-headers))
+ `(("kernel-headers" ,linux-libre-headers))))
(outputs '("out" "debug"
"static")) ;9 MiB of .a files
;; Use our Bash instead of /bin/sh.
(string-append "BASH_SHELL="
(assoc-ref %build-inputs "bash")
- "/bin/bash"))
+ "/bin/bash")
+
+ ;; On GNU/Hurd we get discarded-qualifiers warnings for
+ ;; 'device_write_inband' among other things. Ignore them.
+ ,@(if (hurd-target?)
+ '("--disable-werror")
+ '()))
#:tests? #f ; XXX
#:phases (modify-phases %standard-phases
+ ,@(if (hurd-target?)
+ `((add-after 'unpack 'apply-hurd-patch
+ (lambda* (#:key inputs native-inputs
+ #:allow-other-keys)
+ ;; TODO: Move this to 'patches' field.
+ (let ((patch (or (assoc-ref native-inputs
+ "hurd-magic-pid-patch")
+ (assoc-ref inputs
+ "hurd-magic-pid-patch"))))
+ (invoke "patch" "-p1" "--force" "--input"
+ patch)))))
+ '())
(add-before
'configure 'pre-configure
(lambda* (#:key inputs native-inputs outputs
(filter linker-script?
(map (cut string-append slib "/" <>)
files)))
- #t))))))
+ #t)))
+
+ ,@(if (hurd-target?)
+ '((add-after 'install 'augment-libc.so
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (substitute* (string-append out "/lib/libc.so")
+ (("/[^ ]+/lib/libc.so.0.3")
+ (string-append out "/lib/libc.so.0.3"
+ " libmachuser.so libhurduser.so"))))
+ #t)))
+ '()))))
(inputs `(("static-bash" ,static-bash)))
(native-inputs `(("texinfo" ,texinfo)
("perl" ,perl)
("bison" ,bison)
- ("gettext" ,gettext-minimal)))
+ ("gettext" ,gettext-minimal)
+
+ ,@(if (hurd-target?)
+ `(("mig" ,mig)
+ ("perl" ,perl)
+ ("hurd-magic-pid-patch"
+ ,(search-patch "glibc-hurd-magic-pid.patch")))
+ '())))
(native-search-paths
;; Search path for packages that provide locale data. This is useful
(license lgpl2.0+)
(home-page "https://www.gnu.org/software/libc/")))
-(define-public glibc/hurd
- ;; The Hurd's libc variant.
- (package (inherit glibc/linux)
- (name "glibc-hurd")
- (version "2.23")
+;; Below are old libc versions, which we use mostly to build locale data in
+;; the old format (which the new libc cannot cope with.)
+
+(define-public glibc-2.27
+ (package
+ (inherit glibc)
+ (version "2.27")
(source (origin
- (method url-fetch)
- (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-"
- version "-hurd+libpthread-20161218" ".tar.gz"))
+ (inherit (package-source glibc))
+ (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
(sha256
(base32
- "0vpdv05j6j3ria5bw8gp468i64gij94cslxkxj9xkfgi6p615b8p"))))
-
- ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
- ;; so both should be propagated.
- (propagated-inputs `(("hurd-core-headers" ,hurd-core-headers)))
- (native-inputs
- `(,@(package-native-inputs glibc/linux)
- ("mig" ,mig)
- ("perl" ,perl)))
-
- (arguments
- (substitute-keyword-arguments (package-arguments glibc/linux)
- ((#:phases original-phases)
- ;; Add libmachuser.so and libhurduser.so to libc.so's search path.
- ;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-07/msg00051.html>.
- `(modify-phases ,original-phases
- (add-after 'install 'augment-libc.so
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out")))
- (substitute* (string-append out "/lib/libc.so")
- (("/[^ ]+/lib/libc.so.0.3")
- (string-append out "/lib/libc.so.0.3" " libmachuser.so" " libhurduser.so"))))
- #t))
- (add-after 'pre-configure 'pre-configure-set-pwd
- (lambda _
- ;; Use the right 'pwd'.
- (substitute* "configure"
- (("/bin/pwd") "pwd"))
- #t))
- (replace 'build
- (lambda _
- ;; Force mach/hurd/libpthread subdirs to build first in order to avoid
- ;; linking errors.
- ;; See <https://lists.gnu.org/archive/html/bug-hurd/2016-11/msg00045.html>
- (let ((flags (list "-j" (number->string (parallel-job-count)))))
- (define (make target)
- (apply invoke "make" target flags))
- (make "mach/subdir_lib")
- (make "hurd/subdir_lib")
- (make "libpthread/subdir_lib")
- (apply invoke "make" flags))))))
- ((#:configure-flags original-configure-flags)
- `(append (list "--host=i586-pc-gnu"
-
- ;; We need this to get a working openpty() function.
- "--enable-pt_chown"
-
- ;; <https://lists.gnu.org/archive/html/bug-hurd/2016-10/msg00033.html>
- "--disable-werror"
-
- ;; nscd fails to build for GNU/Hurd:
- ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
- ;; Disable it.
- "--disable-nscd")
- (filter (lambda (flag)
- (not (string-prefix? "--enable-kernel=" flag)))
- ,original-configure-flags)))))
- (synopsis "The GNU C Library (GNU Hurd variant)")
- (supported-systems %hurd-systems)))
-
-(define* (glibc-for-target #:optional
- (target (or (%current-target-system)
- (%current-system))))
- "Return the glibc for TARGET, GLIBC/LINUX for a Linux host or
-GLIBC/HURD for a Hurd host"
- (match target
- ((or "i586-pc-gnu" "i586-gnu") glibc/hurd)
- (_ glibc/linux)))
-
-(define-syntax glibc
- (identifier-syntax (glibc-for-target)))
-
-;; Below are old libc versions, which we use mostly to build locale data in
-;; the old format (which the new libc cannot cope with.)
+ "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji"))
+ (patches (search-patches "glibc-ldd-x86_64.patch"
+ "glibc-2.27-git-fixes.patch"
+ "glibc-hidden-visibility-ldconfig.patch"
+ "glibc-versioned-locpath.patch"
+ "glibc-allow-kernel-2.6.32.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
(("/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")
(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)
,(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))
(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")
(license gpl3+))) ; some files are under GPLv2+
(define-public glibc/hurd-headers
- (package (inherit glibc/hurd)
+ (package (inherit glibc)
(name "glibc-hurd-headers")
(outputs '("out"))
(propagated-inputs `(("gnumach-headers" ,gnumach-headers)
("hurd-headers" ,hurd-headers)))
(arguments
- (substitute-keyword-arguments (package-arguments glibc/hurd)
+ (substitute-keyword-arguments (package-arguments glibc)
;; We just pass the flags really needed to build the headers.
((#:configure-flags _)
`(list "--enable-add-ons"
- "--host=i586-pc-gnu"
- "--enable-obsolete-rpc"))
+ "--host=i586-pc-gnu"))
((#:phases _)
'(modify-phases %standard-phases
(replace 'install
(open-output-file
(string-append out "/include/gnu/stubs.h"))))
#t))
- (delete 'build) ; nothing to build
- (add-before 'configure 'patch-configure-script
- (lambda _
- ;; Use the right 'pwd'.
- (substitute* "configure"
- (("/bin/pwd") "pwd"))
- #t))))))))
+ (delete 'build))))))) ; nothing to build
(define-public tzdata
(package
(name "tzdata")
- (version "2018e")
+ (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
- "0bk97fv2i5ns42prpmlaadsswdjwv0ifi7whj2s4q6l44rcqwa3b"))))
+ "0r0clnlslwm15m1c61dinf1fi9ffgl6aipng7i7yryfwj0n0kn85"))))
(build-system gnu-build-system)
(arguments
'(#:tests? #f
(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
- "1kpb02631s58i068mwq63xlamcv1ffj4p6y4wpb9kdl01vr0qd6a"))))))
+ "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)
(hidden-package
(package
(inherit tzdata)
- (version "2018d")
+ (version "2018g")
(source (origin
- (method url-fetch)
- (uri (string-append "https://www.iana.org/time-zones/repository"
- "/releases/tzdata" version ".tar.gz"))
- (sha256
- (base32
- "0m6020dnk9r40z7k36jp13fa06xip3hn0fdx3nly66jzxgffs1ji"))))
- (inputs `(("tzcode" ,(origin
- (method url-fetch)
- (uri (string-append
- "http://www.iana.org/time-zones/repository/releases/tzcode"
- version ".tar.gz"))
- (sha256
- (base32
- "1nd882yhsazmcfqmcqyfig3axycryl30gmizgqhqsx5dpa2lxr3x")))))))))
+ (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