1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2019 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
7 ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
8 ;;; Copyright © 2016, 2017, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
10 ;;; Copyright © 2016, 2018 Alex Vong <alexvong1995@gmail.com>
11 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
12 ;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
13 ;;; Copyright © 2017, 2018, 2020 Marius Bakke <mbakke@fastmail.com>
14 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
15 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
16 ;;; Copyright © 2018, 2019, 2022 Ricardo Wurmus <rekado@elephly.net>
17 ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0@protonmail.com>
18 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
19 ;;; Copyright © 2021 Leo Le Bouter <lle-bout@zaclys.net>
20 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
21 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
22 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
23 ;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
25 ;;; This file is part of GNU Guix.
27 ;;; GNU Guix is free software; you can redistribute it and/or modify it
28 ;;; under the terms of the GNU General Public License as published by
29 ;;; the Free Software Foundation; either version 3 of the License, or (at
30 ;;; your option) any later version.
32 ;;; GNU Guix is distributed in the hope that it will be useful, but
33 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 ;;; GNU General Public License for more details.
37 ;;; You should have received a copy of the GNU General Public License
38 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40 (define-module (gnu packages base)
41 #:use-module ((guix licenses)
42 #:select (gpl3+ lgpl2.0+ lgpl3+ public-domain))
43 #:use-module (gnu packages)
44 #:use-module (gnu packages acl)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages attr)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages ed)
50 #:use-module (gnu packages gawk)
51 #:use-module (gnu packages gcc)
52 #:use-module (gnu packages guile)
53 #:use-module (gnu packages multiprecision)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages linux)
57 #:use-module (gnu packages pcre)
58 #:use-module (gnu packages texinfo)
59 #:use-module (gnu packages hurd)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages python)
62 #:use-module (gnu packages gettext)
63 #:use-module (guix i18n)
64 #:use-module (guix utils)
65 #:use-module (guix gexp)
66 #:use-module (guix packages)
67 #:use-module (guix download)
68 #:use-module (guix git-download)
69 #:use-module (guix build-system gnu)
70 #:use-module (guix build-system trivial)
71 #:use-module (ice-9 format)
72 #:use-module (ice-9 match)
73 #:use-module (ice-9 optargs)
74 #:use-module (srfi srfi-1)
75 #:use-module (srfi srfi-26)
82 ;;; Base packages of the Guix-based GNU user-land software distribution.
92 (uri (string-append "mirror://gnu/hello/hello-" version
96 "086vqwk2wl8zfs47sq2xpjc9k066ilmb8z6dn0q6ymwjzlm196cd"))))
97 (build-system gnu-build-system)
98 (synopsis "Hello, GNU world: An example GNU package")
100 "GNU Hello prints the message \"Hello, world!\" and then exits. It
101 serves as an example of standard GNU coding practices. As such, it supports
102 command-line arguments, multiple languages, and so on.")
103 (home-page "https://www.gnu.org/software/hello/")
112 (uri (string-append "mirror://gnu/grep/grep-"
116 "0gipv6bzkm1aihj0ncqpyh164xrzgcxcv9r1kwzyk2g1mzl1azk6"))
117 (patches (search-patches "grep-timing-sensitive-test.patch"))))
118 (build-system gnu-build-system)
119 (native-inputs (list perl)) ;some of the tests require it
123 (modify-phases %standard-phases
124 (add-after 'install 'fix-egrep-and-fgrep
125 ;; Patch 'egrep' and 'fgrep' to execute 'grep' via its
126 ;; absolute file name instead of searching for it in $PATH.
127 (lambda* (#:key outputs #:allow-other-keys)
128 (let* ((out (assoc-ref outputs "out"))
129 (bin (string-append out "/bin")))
130 (substitute* (list (string-append bin "/egrep")
131 (string-append bin "/fgrep"))
133 (string-append "exec " bin "/grep")))))))
134 #:make-flags ,(if (hurd-target?)
135 ''("XFAIL_TESTS=test-perror2 equiv-classes") ;XXX
137 (synopsis "Print lines matching a pattern")
139 "grep is a tool for finding text inside files. Text is found by
140 matching a pattern provided by the user in one or many files. The pattern
141 may be provided as a basic or extended regular expression, or as fixed
142 strings. By default, the matching text is simply printed to the screen,
143 however the output can be greatly customized to include, for example, line
144 numbers. GNU grep offers many extensions over the standard utility,
145 including, for example, recursive directory searching.")
147 (home-page "https://www.gnu.org/software/grep/")))
155 (uri (string-append "mirror://gnu/sed/sed-" version
159 "0alqagh0nliymz23kfjg6g9w3cr086k0sfni56gi8fhzqwa3xksk"))
160 (patches (search-patches "coreutils-gnulib-tests.patch"))
162 ;; Remove this snippet once upstream releases a fixed version.
163 ;; This snippet changes Makefile.in, even though the upstream
164 ;; patch changes testsuite/local.mk, since we build sed from a
165 ;; release tarball. See: https://bugs.gnu.org/36150
168 (substitute* "Makefile.in"
169 (("^ abs_srcdir='\\$\\(abs_srcdir\\)'.*" previous-line)
172 " CONFIG_HEADER='$(CONFIG_HEADER)'\t\t\\\n")))))
173 (modules '((guix build utils)))))
174 (build-system gnu-build-system)
175 (synopsis "Stream editor")
176 (native-inputs (list perl)) ;for tests
178 "Sed is a non-interactive, text stream editor. It receives a text
179 input from a file or from standard input and it then applies a series of text
180 editing commands to the stream and prints its output to standard output. It
181 is often used for substituting text patterns in a stream. The GNU
182 implementation offers several extensions over the standard utility.")
184 (home-page "https://www.gnu.org/software/sed/")))
192 (uri (string-append "mirror://gnu/tar/tar-"
196 "0a0x87anh9chbi2cgcyy7pmnm5hzk4yd1w2j8gm1wplwhwkbvgk3"))
197 (patches (search-patches "tar-skip-unreliable-tests.patch"
198 "tar-remove-wholesparse-check.patch"))))
199 (build-system gnu-build-system)
200 ;; Note: test suite requires ~1GiB of disk space.
202 `(,@(if (hurd-target?)
205 "TESTSUITEFLAGS= -k '"
207 ",!renamed dirs in incrementals"
208 ",!--exclude-tag option in incremental pass"
209 ",!incremental dumps with -C"
210 ",!incremental dumps of nested directories"
211 ",!incremental restores with -C"
212 ",!concatenated incremental archives (renames)"
213 ",!renamed directory containing subdirectories"
214 ",!renamed subdirectories"
217 #:phases (modify-phases %standard-phases
218 (add-before 'build 'set-shell-file-name
219 (lambda* (#:key inputs #:allow-other-keys)
220 ;; Do not use "/bin/sh" to run programs.
221 (let ((bash (assoc-ref inputs "bash")))
222 (substitute* "src/system.c"
224 (string-append bash "/bin/sh")))))))))
226 ;; When cross-compiling, the 'set-shell-file-name' phase needs to be able
227 ;; to refer to the target Bash.
228 (inputs (if (%current-target-system)
232 (synopsis "Managing tar archives")
234 "Tar provides the ability to create tar archives, as well as the
235 ability to extract, update or list files in an existing archive. It is
236 useful for combining many files into one larger file, while maintaining
237 directory structure and file information such as permissions and
238 creation/modification dates. GNU tar offers many extensions over the
241 (home-page "https://www.gnu.org/software/tar/")))
249 (uri (string-append "mirror://gnu/patch/patch-"
253 "1zfqy4rdcy279vwn2z1kbv19dcfw25d2aqy9nzvdkq5bjzd0nqdc"))
254 (patches (search-patches "patch-hurd-path-max.patch"))))
255 (build-system gnu-build-system)
257 ;; Work around a cross-compilation bug whereby libpatch.a would provide
258 ;; '__mktime_internal', which conflicts with the one in libc.a.
259 (if (%current-target-system)
260 `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
262 (native-inputs (list ed))
263 (synopsis "Apply differences to originals, with optional backups")
265 "Patch is a program that applies changes to files based on differences
266 laid out as by the program \"diff\". The changes may be applied to one or more
267 files depending on the contents of the diff file. It accepts several
268 different diff formats. It may also be used to revert previously applied
271 (home-page "https://savannah.gnu.org/projects/patch/")))
273 (define-public diffutils
279 (uri (string-append "mirror://gnu/diffutils/diffutils-"
283 "1v4g8gi0lgakqa7iix8s4fq7lq6l92vw3rjd9wfd2rhjng8xggd6"))
284 (patches (search-patches "diffutils-fix-signal-processing.patch"))))
285 (build-system gnu-build-system)
286 (native-inputs (list perl))
287 (synopsis "Comparing and merging files")
289 "GNU Diffutils is a package containing tools for finding the
290 differences between files. The \"diff\" command is used to show how two files
291 differ, while \"cmp\" shows the offsets and line numbers where they differ.
292 \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
293 interactive means to merge two files.")
295 (home-page "https://www.gnu.org/software/diffutils/")))
297 (define-public findutils
303 (uri (string-append "mirror://gnu/findutils/findutils-"
307 "0r3i72hnw0a30khlczi9k2c51aamaj6kfmp5mk3844nrjxz7n4jp"))
308 (patches (search-patches "findutils-localstatedir.patch"))))
309 (build-system gnu-build-system)
311 `(#:configure-flags (list
312 ;; Tell 'updatedb' to write to /var.
313 "--localstatedir=/var")
314 #:phases (modify-phases %standard-phases
315 (add-before 'check 'adjust-test-shebangs
317 (substitute* '("tests/xargs/verbose-quote.sh"
318 "tests/find/exec-plus-last-file.sh")
320 (string-append "#!" (which "sh")))))))
321 #:make-flags ,(if (hurd-target?)
322 ''("XFAIL_TESTS=test-perror2")
324 (synopsis "Operating on files matching given criteria")
326 "Findutils supplies the basic file directory searching utilities of the
327 GNU system. It consists of two primary searching utilities: \"find\"
328 recursively searches for files in a directory according to given criteria and
329 \"locate\" lists files in a database that match a query. Two auxiliary tools
330 are included: \"updatedb\" updates the file name database and \"xargs\" may be
331 used to apply commands with arbitrarily long arguments.")
333 (home-page "https://www.gnu.org/software/findutils/")))
335 (define-public coreutils
341 (uri (string-append "mirror://gnu/coreutils/coreutils-"
345 "1yjcrh5hw70c0yn8zw55pd6j51dj90anpq8mmg649ps9g3gdhn24"))
346 (patches (search-patches "coreutils-ls.patch"
347 "coreutils-gnulib-tests.patch"))))
348 (build-system gnu-build-system)
349 (inputs `(,acl ;TODO: add SELinux
350 ,attr ;for xattrs in ls, mv, etc
351 ,gmp ;bignums in 'expr', yay!
353 ;; Do not use libcap when cross-compiling since it's not quite
354 ;; cross-compilable; and use it only for supported systems.
355 ,@(if (and (not (%current-target-system))
356 (member (%current-system)
357 (package-supported-systems libcap)))
358 `(,libcap) ;capability support in 'ls', etc.
361 ;; Perl is needed to run tests in native builds, and to run the bundled
362 ;; copy of help2man. However, don't pass it when cross-compiling since
363 ;; that would lead it to try to run programs to get their '--help' output
365 (if (%current-target-system)
368 (outputs '("out" "debug"))
370 `(#:parallel-build? #f ; help2man may be called too early
372 '(#:make-flags ; these tests fail deterministically
373 (list (string-append "XFAIL_TESTS=tests/misc/env-S.pl"
374 " tests/misc/kill.sh"
375 " tests/misc/nice.sh"
376 " tests/misc/pwd-long.sh"
377 " tests/split/fail.sh"
380 ;; <https://issues.guix.gnu.org/58803>.
381 " tests/df/unreadable.sh"
393 #:phases (modify-phases %standard-phases
394 (add-before 'build 'patch-shell-references
396 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
397 ;; that tests pass, since /bin/sh isn't in the chroot.
398 (setenv "SHELL" (which "sh"))
400 (substitute* (find-files "gnulib-tests" "\\.c$")
401 (("/bin/sh") (which "sh")))
402 (substitute* (find-files "tests" "\\.sh$")
403 (("#!/bin/sh") (string-append "#!" (which "sh"))))))
404 (add-after 'unpack 'remove-tests
407 '((substitute* "Makefile.in"
409 (("^ *tests/misc/timeout-group.sh.*") "")))
411 (substitute* "Makefile.in"
412 ;; fails on filesystems where inotify cannot be used,
413 ;; more info in #47935
414 (("^ *tests/tail-2/inotify-dir-recreate.sh.*") "")))))))
415 (synopsis "Core GNU utilities (file, text, shell)")
417 "GNU Coreutils package includes all of the basic command-line tools that
418 are expected in a POSIX system, excluding shell. This package is the union of
419 the GNU fileutils, sh-utils, and textutils packages. Most of these tools
420 offer extended functionality beyond that which is outlined in the POSIX
423 (home-page "https://www.gnu.org/software/coreutils/")))
425 (define-public coreutils-minimal
426 ;; Coreutils without its optional dependencies.
429 (name "coreutils-minimal")
434 (define-public coreutils-8.30
435 ;; XXX: This version is kept just so we can run PRoot tests.
438 (inherit coreutils-minimal)
442 (uri (string-append "mirror://gnu/coreutils/coreutils-"
446 "0mxhw43d4wpqmvg0l4znk1vm10fy92biyh90lzdnqjcic2lb6cg8"))))
448 (substitute-keyword-arguments (package-arguments coreutils-minimal)
449 ((#:phases phases '%standard-phases)
450 `(modify-phases ,phases
451 (add-before 'check 'disable-broken-test
453 ;; This test hits the 127 character shebang limit in the build
454 ;; environment due to the way "env -S" splits arguments into
455 ;; shebangs. Note that "env-S-script.sh" works around this
456 ;; specific issue, but "env-S.pl" is not adjusted for build
457 ;; environments with long prefixes (/tmp/guix-build-...).
458 (substitute* "Makefile"
459 (("^.*tests/misc/env-S.pl.*$") "")))))))))))
461 (define-public gnu-make
467 (uri (string-append "mirror://gnu/make/make-" version
471 "06cfqzpqsvdnsxbysl5p2fgdgxgl9y4p7scpnrfa8z2zgkjdspz0"))
472 (patches (search-patches "make-impure-dirs.patch"))))
473 (build-system gnu-build-system)
474 (native-inputs (list pkg-config)) ;to detect Guile
475 (inputs (list guile-3.0))
476 (outputs '("out" "debug"))
478 `(,@(if (hurd-target?)
479 '(#:configure-flags '("CFLAGS=-D__alloca=alloca"
480 "ac_cv_func_posix_spawn=no"))
483 (modify-phases %standard-phases
484 (add-before 'build 'set-default-shell
485 (lambda* (#:key inputs #:allow-other-keys)
486 ;; Change the default shell from /bin/sh.
487 (let ((bash (assoc-ref inputs "bash")))
488 (substitute* "src/job.c"
489 (("default_shell =.*$")
490 (format #f "default_shell = \"~a/bin/sh\";\n"
492 (synopsis "Remake files automatically")
494 "Make is a program that is used to control the production of
495 executables or other files from their source files. The process is
496 controlled from a Makefile, in which the developer specifies how each file is
497 generated from its source. It has powerful dependency resolution and the
498 ability to determine when files have to be regenerated after their sources
499 change. GNU make offers many powerful extensions over the standard utility.")
501 (home-page "https://www.gnu.org/software/make/")))
503 (define-public gnu-make-4.2
509 (uri (string-append "mirror://gnu/make/make-" version
513 "12f5zzyq2w56g95nni65hc0g5p7154033y2f3qmjvd016szn5qnn"))))
515 `(#:configure-flags '("CFLAGS=-D__alloca=alloca -D__stat=stat")
517 (modify-phases %standard-phases
518 (add-before 'build 'set-default-shell
519 (lambda* (#:key inputs #:allow-other-keys)
520 ;; Change the default shell from /bin/sh.
521 (let ((bash (assoc-ref inputs "bash")))
523 (("default_shell =.*$")
524 (format #f "default_shell = \"~a/bin/sh\";\n"
527 (define-public binutils
534 (uri (string-append "mirror://gnu/binutils/binutils-"
537 (base32 "1m3b2rdfv1dmdpd0bzg1hy7i8a2qng53szc6livyi3nh6101mz37"))
538 (patches (search-patches "binutils-loongson-workaround.patch"
539 "binutils-2.37-file-descriptor-leak.patch"
540 "binutils-CVE-2021-45078.patch"))))
541 (build-system gnu-build-system)
543 `(#:out-of-source? #t ;recommended in the README
544 #:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
545 ;; on GCC when bootstrapping.
546 "LDFLAGS=-static-libgcc"
548 ;; Turn on --enable-new-dtags by default to make the
549 ;; linker set RUNPATH instead of RPATH on binaries.
550 ;; This is important because RUNPATH can be overriden
551 ;; using LD_LIBRARY_PATH at runtime.
554 ;; Don't search under /usr/lib & co.
555 "--with-lib-path=/no-ld-lib-path"
557 ;; Install BFD. It ends up in a hidden directory,
559 "--enable-install-libbfd"
561 ;; Make sure 'ar' and 'ranlib' produce archives in a
562 ;; deterministic fashion.
563 "--enable-deterministic-archives"
565 "--enable-64-bit-bfd"
566 "--enable-compressed-debug-sections=all"
568 "--enable-separate-code"
569 "--enable-threads")))
571 (synopsis "Binary utilities: bfd gas gprof ld")
573 "GNU Binutils is a collection of tools for working with binary files.
574 Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
575 Other tools include programs to display binary profiling information, list
576 the strings in a binary file, and utilities for working with archives. The
577 \"bfd\" library for working with executable and object formats is also
580 (home-page "https://www.gnu.org/software/binutils/")))
582 ;; FIXME: ath9k-firmware-htc-binutils.patch do not apply on 2.34 because of a
583 ;; big refactoring of xtensa-modules.c (commit 567607c11fbf7105 upstream).
584 ;; Keep this version around until the patch is updated.
585 (define-public binutils-2.33
590 (inherit (package-source binutils))
591 (uri (string-append "mirror://gnu/binutils/binutils-"
595 "1cmd0riv37bqy9mwbg6n3523qgr8b3bbm5kwj19sjrasl4yq9d0c"))
598 (substitute-keyword-arguments (package-arguments binutils)
599 ((#:make-flags _ ''()) ''())))
602 (define-public binutils-gold
603 (package/inherit binutils
604 (name "binutils-gold")
606 (substitute-keyword-arguments (package-arguments binutils)
607 ((#:configure-flags flags)
608 `(cons* "--enable-gold=default"
609 (delete "LDFLAGS=-static-libgcc" ,flags)))
610 ((#:phases phases '%standard-phases)
611 `(modify-phases ,phases
612 (add-after 'patch-source-shebangs 'patch-more-shebangs
614 (substitute* "gold/Makefile.in"
615 (("/bin/sh") (which "sh")))))
616 ;; Multiple failing tests on some architectures in the gold testsuite.
617 ,@(if (or (target-arm?)
619 '((add-after 'unpack 'skip-gold-testsuite
621 (substitute* "gold/Makefile.in"
622 ((" testsuite") " ")))))
627 (define* (make-ld-wrapper name #:key
631 (guile (canonical-package guile-3.0))
632 (bash (canonical-package bash))
633 (guile-for-build guile))
634 "Return a package called NAME that contains a wrapper for the 'ld' program
635 of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. The
636 wrapper uses GUILE and BASH.
638 TARGET must be a one-argument procedure that, given a system type, returns a
639 cross-compilation target triplet or #f. When the result is not #f, make a
640 wrapper for the cross-linker for that target, called 'TARGET-ld'. To use a
641 different linker than the default \"ld\", such as \"ld.gold\" the linker name
642 can be provided via the LINKER argument."
643 ;; Note: #:system->target-triplet is a procedure so that the evaluation of
644 ;; its result can be delayed until the 'arguments' field is evaluated, thus
645 ;; in a context where '%current-system' is accurate.
650 (build-system trivial-build-system)
651 (inputs `(("binutils" ,binutils)
654 ("wrapper" ,(search-path %load-path
655 "gnu/packages/ld-wrapper.in"))))
657 (let ((target (target (%current-system))))
658 `(#:guile ,guile-for-build
659 #:modules ((guix build utils))
661 (use-modules (guix build utils)
662 (system base compile))
664 (let* ((out (assoc-ref %outputs "out"))
665 (bin (string-append out "/bin"))
667 `(string-append bin "/" ,target "-"
669 `(string-append bin "/" ,linker)))
670 (go (string-append ld ".go")))
672 (setvbuf (current-output-port)
673 (cond-expand (guile-2.0 _IOLBF)
675 (format #t "building ~s/bin/ld wrapper in ~s~%"
676 (assoc-ref %build-inputs "binutils")
680 (copy-file (assoc-ref %build-inputs "wrapper") ld)
685 (string-append (assoc-ref %build-inputs "guile")
688 (string-append (assoc-ref %build-inputs "bash")
691 (string-append (assoc-ref %build-inputs "binutils")
693 (string-append "/bin/"
695 (string-append "/bin/" linker)))))
697 (compile-file ld #:output-file go))))))
698 (synopsis "The linker wrapper")
700 "The linker wrapper (or @code{ld-wrapper}) wraps the linker to add any
701 missing @code{-rpath} flags, and to detect any misuse of libraries outside of
703 (home-page "https://www.gnu.org/software/guix//")
707 ;; This is the GNU C Library, used on GNU/Linux and GNU/Hurd. Prior to
708 ;; version 2.28, GNU/Hurd used a different glibc branch.
714 (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
717 "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f"))
718 (patches (search-patches "glibc-ldd-powerpc.patch"
719 "glibc-ldd-x86_64.patch"
720 "glibc-dl-cache.patch"
721 "glibc-versioned-locpath.patch"
722 "glibc-allow-kernel-2.6.32.patch"
723 "glibc-reinstate-prlimit64-fallback.patch"
724 "glibc-supported-locales.patch"
725 "glibc-cross-objdump.patch"
726 "glibc-cross-objcopy.patch" ;must come 2nd
727 "glibc-hurd-clock_t_centiseconds.patch"
728 "glibc-hurd-clock_gettime_monotonic.patch"
729 "glibc-hurd-mach-print.patch"
730 "glibc-hurd-gettyent.patch"))))
731 (build-system gnu-build-system)
733 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
734 ;; users should automatically pull Linux headers as well. On GNU/Hurd,
735 ;; libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
736 ;; so both should be propagated.
739 `(("hurd-core-headers" ,hurd-core-headers))
740 `(("kernel-headers" ,linux-libre-headers))))
742 (outputs '("out" "debug"
743 "static")) ;9 MiB of .a files
746 `(#:out-of-source? #t
748 ;; The libraries have an empty RUNPATH, but some, such as the versioned
749 ;; libraries (libdl-2.24.so, etc.) have ld.so marked as NEEDED. Since
750 ;; these libraries are always going to be found anyway, just skip
752 #:validate-runpath? #f
754 #:modules ((ice-9 ftw)
757 (guix build gnu-build-system))
760 (list "--sysconfdir=/etc"
762 ;; Installing a locale archive with all the locales is to
763 ;; expensive (~100 MiB), so we rely on users to install the
764 ;; locales they really want.
766 ;; Set the default locale path. In practice, $LOCPATH may be
767 ;; defined to point whatever locales users want. However, setuid
768 ;; binaries don't honor $LOCPATH, so they'll instead look into
769 ;; $libc_cv_complocaledir; we choose /run/current-system/locale/X.Y,
770 ;; with the idea that it is going to be populated by the sysadmin.
771 ;; The "X.Y" sub-directory is because locale data formats are
772 ;; incompatible across libc versions; see
773 ;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
775 ;; `--localedir' is not honored, so work around it.
776 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
777 (string-append "libc_cv_complocaledir=/run/current-system/locale/"
778 ,(version-major+minor version))
780 (string-append "--with-headers="
781 (assoc-ref ,(if (%current-target-system)
782 '%build-target-inputs
787 ;; This is the default for most architectures as of GNU libc 2.26,
788 ;; but we specify it explicitly for clarity and consistency. See
789 ;; "kernel-features.h" in the GNU libc for details.
790 "--enable-kernel=3.2.0"
792 ;; Use our Bash instead of /bin/sh.
793 (string-append "BASH_SHELL="
794 (assoc-ref %build-inputs "bash")
797 ;; On GNU/Hurd we get discarded-qualifiers warnings for
798 ;; 'device_write_inband' among other things. Ignore them.
800 '("--disable-werror")
804 #:phases (modify-phases %standard-phases
806 'configure 'pre-configure
807 (lambda* (#:key inputs native-inputs outputs
809 (let* ((out (assoc-ref outputs "out"))
810 (bin (string-append out "/bin"))
811 ;; FIXME: Normally we would look it up only in INPUTS
812 ;; but cross-base uses it as a native input.
813 (bash (or (assoc-ref inputs "static-bash")
814 (assoc-ref native-inputs "static-bash"))))
815 ;; Install the rpc data base file under `$out/etc/rpc'.
816 (substitute* "inet/Makefile"
817 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
818 (string-append out "/etc/rpc" suffix "\n"))
819 (("^install-others =.*$")
820 (string-append "install-others = " out "/etc/rpc\n")))
822 (substitute* "Makeconfig"
824 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
825 ;; linking against libgcc_s is not needed with GCC
829 ;; Tell the ld.so cache code where the store is.
830 (substitute* "elf/dl-cache.c"
831 (("@STORE_DIRECTORY@")
832 (string-append "\"" (%store-directory) "\"")))
834 ;; Have `system' use that Bash.
835 (substitute* "sysdeps/posix/system.c"
836 (("#define[[:blank:]]+SHELL_PATH.*$")
837 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
841 (substitute* "libio/iopopen.c"
843 (string-append bash "/bin/sh")))
845 ;; Same for the shell used by the 'exec' functions for
846 ;; scripts that lack a shebang.
847 (substitute* (find-files "." "^paths\\.h$")
848 (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
849 (string-append "#define _PATH_BSHELL \""
850 bash "/bin/sh\"\n")))
852 ;; Make sure we don't retain a reference to the
854 (substitute* "malloc/mtrace.pl"
856 ;; The shebang can be omitted, because there's the
857 ;; "bilingual" eval/exec magic at the top of the file.
862 (add-after 'install 'move-static-libs
863 (lambda* (#:key outputs #:allow-other-keys)
864 ;; Move static libraries to the "static" output.
865 (define (static-library? file)
866 ;; Return true if FILE is a static library. The
867 ;; "_nonshared.a" files are referred to by libc.so,
868 ;; libpthread.so, etc., which are in fact linker
870 (and (string-suffix? ".a" file)
871 (not (string-contains file "_nonshared"))))
873 (define (linker-script? file)
874 ;; Guess whether FILE, a ".a" file, is actually a
876 (and (not (ar-file? file))
877 (not (elf-file? file))))
879 (let* ((out (assoc-ref outputs "out"))
880 (lib (string-append out "/lib"))
881 (files (scandir lib static-library?))
882 (static (assoc-ref outputs "static"))
883 (slib (string-append static "/lib")))
885 (for-each (lambda (base)
886 (rename-file (string-append lib "/" base)
887 (string-append slib "/" base)))
890 ;; Usually libm.a is a linker script so we need to
891 ;; change the file names in there to refer to STATIC
893 (for-each (lambda (ld-script)
894 (substitute* ld-script
896 (filter linker-script?
897 (map (cut string-append slib "/" <>)
901 '((add-after 'install 'augment-libc.so
902 (lambda* (#:key outputs #:allow-other-keys)
903 (let* ((out (assoc-ref outputs "out")))
904 (substitute* (string-append out "/lib/libc.so")
905 (("/[^ ]+/lib/libc.so.0.3")
906 (string-append out "/lib/libc.so.0.3"
907 " libmachuser.so libhurduser.so")))))))
910 (inputs `(("static-bash" ,static-bash)))
912 ;; To build the manual, we need Texinfo and Perl. Gettext is needed to
913 ;; install the message catalogs, with 'msgfmt'.
914 (native-inputs `(("texinfo" ,texinfo)
917 ("gettext" ,gettext-minimal)
918 ("python" ,python-minimal)
926 ;; Search path for packages that provide locale data. This is useful
927 ;; primarily in build environments. Use 'GUIX_LOCPATH' rather than
928 ;; 'LOCPATH' to avoid interference with the host system's libc on foreign
930 (list (search-path-specification
931 (variable "GUIX_LOCPATH")
932 (files '("lib/locale")))))
934 (synopsis "The GNU C Library")
936 "Any Unix-like operating system needs a C library: the library which
937 defines the \"system calls\" and other basic facilities such as open, malloc,
940 The GNU C library is used as the C library in the GNU system and most systems
941 with the Linux kernel.")
943 (home-page "https://www.gnu.org/software/libc/")))
945 ;; Define a variation of glibc which uses the default /etc/ld.so.cache, useful
946 ;; in FHS containers.
947 (define-public glibc-for-fhs
949 (package/inherit glibc
950 (name "glibc-for-fhs")
951 (source (origin (inherit (package-source glibc))
952 ;; Remove Guix's patch to read ld.so.cache from /gnu/store
953 ;; directories, re-enabling the default /etc/ld.so.cache
956 (delete (search-patch "glibc-dl-cache.patch")
957 (origin-patches (package-source glibc)))))))))
959 ;; Below are old libc versions, which we use mostly to build locale data in
960 ;; the old format (which the new libc cannot cope with.)
961 (define-public glibc-2.32
966 (inherit (package-source glibc))
967 (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
970 "0di848ibffrnwq7g2dvgqrnn4xqhj3h96csn69q4da51ymafl9qn"))
971 (patches (search-patches
972 "glibc-skip-c++.patch"
973 "glibc-ldd-powerpc.patch"
974 "glibc-ldd-x86_64.patch"
975 "glibc-dl-cache.patch"
976 "glibc-hidden-visibility-ldconfig.patch"
977 "glibc-versioned-locpath.patch"
978 "glibc-allow-kernel-2.6.32.patch"
979 "glibc-reinstate-prlimit64-fallback.patch"
980 "glibc-supported-locales.patch"
981 "glibc-hurd-clock_t_centiseconds.patch"
982 "glibc-2.31-hurd-clock_gettime_monotonic.patch"
983 "glibc-hurd-signal-sa-siginfo.patch"
984 "glibc-hurd-mach-print.patch"
985 "glibc-hurd-gettyent.patch"))
987 (patches (search-patches "glibc-ldd-x86_64.patch"
988 "glibc-hidden-visibility-ldconfig.patch"
989 "glibc-versioned-locpath.patch"
990 "glibc-allow-kernel-2.6.32.patch"
991 "glibc-reinstate-prlimit64-fallback.patch"
992 "glibc-supported-locales.patch"
993 "glibc-hurd-clock_t_centiseconds.patch"
994 "glibc-hurd-clock_gettime_monotonic.patch"
995 "glibc-hurd-signal-sa-siginfo.patch"))))
998 (substitute-keyword-arguments (package-arguments glibc)
999 ((#:make-flags flags '())
1000 ;; Arrange so that /etc/rpc & co. go to $out/etc.
1001 `(list (string-append "sysconfdir="
1002 (assoc-ref %outputs "out")
1005 `(modify-phases ,phases
1006 (add-before 'configure 'set-etc-rpc-installation-directory
1007 (lambda* (#:key outputs #:allow-other-keys)
1008 ;; Install the rpc data base file under `$out/etc/rpc'.
1009 (let ((out (assoc-ref outputs "out")))
1010 (substitute* "sunrpc/Makefile"
1011 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
1012 (string-append out "/etc/rpc" suffix "\n"))
1013 (("^install-others =.*$")
1014 (string-append "install-others = " out "/etc/rpc\n"))))))))))))
1016 (define-public glibc-2.31
1021 (inherit (package-source glibc))
1022 (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
1025 "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj"))
1026 (patches (search-patches
1027 "glibc-skip-c++.patch"
1028 "glibc-ldd-powerpc.patch"
1029 "glibc-ldd-x86_64.patch"
1030 "glibc-dl-cache.patch"
1031 "glibc-hidden-visibility-ldconfig.patch"
1032 "glibc-versioned-locpath.patch"
1033 "glibc-allow-kernel-2.6.32.patch"
1034 "glibc-reinstate-prlimit64-fallback.patch"
1035 "glibc-supported-locales.patch"
1036 "glibc-hurd-clock_t_centiseconds.patch"
1037 "glibc-2.31-hurd-clock_gettime_monotonic.patch"
1038 "glibc-hurd-signal-sa-siginfo.patch"
1039 "glibc-hurd-mach-print.patch"
1040 "glibc-hurd-gettyent.patch"))))
1042 (substitute-keyword-arguments (package-arguments glibc)
1044 `(modify-phases ,phases
1045 (add-before 'configure 'set-etc-rpc-installation-directory
1046 (lambda* (#:key outputs #:allow-other-keys)
1047 ;; Install the rpc data base file under `$out/etc/rpc'.
1048 (let ((out (assoc-ref outputs "out")))
1049 (substitute* "sunrpc/Makefile"
1050 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
1051 (string-append out "/etc/rpc" suffix "\n"))
1052 (("^install-others =.*$")
1053 (string-append "install-others = " out "/etc/rpc\n"))))))))))))
1055 (define-public glibc-2.30
1057 (inherit glibc-2.31)
1060 ;; This fails with a build error in libc-tls.c when using GCC 10. Use an
1062 (modify-inputs (package-native-inputs glibc)
1065 (inherit (package-source glibc))
1066 (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
1069 "1bxqpg91d02qnaz837a5kamm0f43pr1il4r9pknygywsar713i72"))
1070 (patches (search-patches "glibc-skip-c++.patch"
1071 "glibc-ldd-x86_64.patch"
1072 "glibc-CVE-2019-19126.patch"
1073 "glibc-hidden-visibility-ldconfig.patch"
1074 "glibc-versioned-locpath.patch"
1075 "glibc-allow-kernel-2.6.32.patch"
1076 "glibc-reinstate-prlimit64-fallback.patch"
1077 "glibc-2.29-supported-locales.patch"))))))
1079 (define-public glibc-2.29
1081 (inherit glibc-2.30)
1084 (inherit (package-source glibc))
1085 (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
1088 "0jzh58728flfh939a8k9pi1zdyalfzlxmwra7k0rzji5gvavivpk"))
1089 (patches (search-patches "glibc-skip-c++.patch"
1090 "glibc-ldd-x86_64.patch"
1091 "glibc-CVE-2019-7309.patch"
1092 "glibc-CVE-2019-9169.patch"
1093 "glibc-2.29-git-updates.patch"
1094 "glibc-hidden-visibility-ldconfig.patch"
1095 "glibc-versioned-locpath.patch"
1096 "glibc-allow-kernel-2.6.32.patch"
1097 "glibc-reinstate-prlimit64-fallback.patch"
1098 "glibc-2.29-supported-locales.patch"))))))
1100 (define-public (make-gcc-libc base-gcc libc)
1101 "Return a GCC that targets LIBC."
1102 (package (inherit base-gcc)
1103 (name (string-append (package-name base-gcc) "-"
1104 (package-name libc) "-"
1105 (package-version libc)))
1107 (ensure-keyword-arguments (package-arguments base-gcc)
1108 '(#:implicit-inputs? #f)))
1110 `(,@(package-native-inputs base-gcc)
1111 ,@(append (fold alist-delete (%final-inputs) '("libc" "libc:static")))
1113 ("libc:static" ,libc "static")))))
1115 (define-public (make-glibc-locales glibc)
1118 (name "glibc-locales")
1119 (source (origin (inherit (package-source glibc))
1120 ;; The patch for glibc 2.28 and earlier replaces the same
1121 ;; content, but the context in the patch is different
1122 ;; enough to fail to merge.
1123 (patches (cons (search-patch
1124 (if (version>=? (package-version glibc)
1126 "glibc-locales.patch"
1127 "glibc-locales-2.28.patch"))
1128 (origin-patches (package-source glibc))))))
1129 (synopsis "All the locales supported by the GNU C Library")
1131 "This package provides all the locales supported by the GNU C Library,
1132 more than 400 in total. To use them set the @code{LOCPATH} environment variable
1133 to the @code{share/locale} sub-directory of this package.")
1134 (outputs '("out")) ;110+ MiB
1135 (native-search-paths '())
1137 (let ((args `(#:tests? #f #:strip-binaries? #f
1138 ,@(package-arguments glibc))))
1139 (substitute-keyword-arguments args
1140 ((#:modules modules '((guix build utils)
1141 (guix build gnu-build-system)))
1145 ((#:imported-modules modules '())
1146 `((gnu build locale)
1147 ,@%gnu-build-system-modules))
1149 `(modify-phases ,phases
1152 (invoke "make" "localedata/install-locales"
1153 "-j" (number->string (parallel-job-count)))))
1154 (add-after 'build 'symlink-normalized-codesets
1155 (lambda* (#:key outputs #:allow-other-keys)
1156 ;; The above phase does not install locales with names using
1157 ;; the "normalized codeset." Thus, create symlinks like:
1158 ;; en_US.utf8 -> en_US.UTF-8
1159 (define (locale-directory? file stat)
1160 (and (file-is-directory? file)
1161 (string-index (basename file) #\_)
1162 (string-rindex (basename file) #\.)))
1164 (let* ((out (assoc-ref outputs "out"))
1165 (locales (find-files out locale-directory?
1166 #:directories? #t)))
1167 (for-each (lambda (directory)
1168 (let*-values (((base)
1169 (basename directory))
1171 (locale->name+codeset base))
1173 (normalize-codeset codeset)))
1174 (unless (string=? codeset normalized)
1176 (string-append (dirname directory)
1181 (delete 'move-static-libs)))
1182 ((#:configure-flags flags)
1184 ;; Use $(libdir)/locale/X.Y as is the case by default.
1185 (list (string-append "libc_cv_complocaledir="
1186 (assoc-ref %outputs "out")
1188 ,(version-major+minor
1189 (package-version glibc)))))))))
1190 (properties `((upstream-name . "glibc")))))
1192 (define %default-utf8-locales
1193 ;; These are the locales commonly used for tests---e.g., in Guile's i18n
1195 '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
1196 (define*-public (make-glibc-utf8-locales glibc #:key
1197 (locales %default-utf8-locales)
1198 (name "glibc-utf8-locales"))
1199 (define default-locales? (equal? locales %default-utf8-locales))
1202 (version (package-version glibc))
1204 (build-system trivial-build-system)
1206 `(#:modules ((guix build utils))
1208 (use-modules (guix build utils))
1210 (let* ((libc (assoc-ref %build-inputs "glibc"))
1211 (gzip (assoc-ref %build-inputs "gzip"))
1212 (out (assoc-ref %outputs "out"))
1213 (localedir (string-append out "/lib/locale/"
1214 ,(version-major+minor version))))
1215 ;; 'localedef' needs 'gzip'.
1216 (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
1219 (for-each (lambda (locale)
1221 ;; Use the "normalized codeset" by
1222 ;; default--e.g., "en_US.utf8".
1223 (string-append localedir "/" locale ".utf8"))
1225 (invoke "localedef" "--no-archive"
1226 "--prefix" localedir
1230 ;; For backward compatibility with Guix
1231 ;; <= 0.8.3, add "xx_YY.UTF-8".
1232 (symlink (string-append locale ".utf8")
1233 (string-append localedir "/"
1237 (native-inputs (list glibc gzip))
1238 (synopsis (if default-locales?
1239 (P_ "Small sample of UTF-8 locales")
1240 (P_ "Customized sample of UTF-8 locales")))
1242 (if default-locales?
1243 (P_ "This package provides a small sample of UTF-8 locales mostly useful in
1244 test environments.")
1245 (format #f (P_ "This package provides the following UTF-8 locales:
1250 (home-page (package-home-page glibc))
1251 (license (package-license glibc))))
1253 (define-public glibc-locales
1254 (make-glibc-locales glibc))
1255 (define-public glibc-utf8-locales
1257 (make-glibc-utf8-locales glibc)))
1259 ;; Packages provided to ease use of binaries linked against the previous libc.
1260 (define-public glibc-locales-2.32
1261 (package (inherit (make-glibc-locales glibc-2.32))
1262 (name "glibc-locales-2.32")))
1263 (define-public glibc-locales-2.31
1264 (package (inherit (make-glibc-locales glibc-2.31))
1265 (name "glibc-locales-2.31")))
1266 (define-public glibc-locales-2.30
1267 (package (inherit (make-glibc-locales glibc-2.30))
1268 (name "glibc-locales-2.30")))
1269 (define-public glibc-locales-2.29
1270 (package (inherit (make-glibc-locales glibc-2.29))
1271 (name "glibc-locales-2.29")))
1272 (define-public glibc-utf8-locales-2.29
1273 (package (inherit (make-glibc-utf8-locales glibc-2.29))
1274 (name "glibc-utf8-locales-2.29")))
1276 (define-public which
1282 (uri (string-append "mirror://gnu/which/which-"
1286 "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
1287 (build-system gnu-build-system)
1288 (home-page "https://gnu.org/software/which/")
1289 (synopsis "Find full path of shell commands")
1291 "The which program finds the location of executables in PATH, with a
1292 variety of options. It is an alternative to the shell \"type\" built-in
1294 (license gpl3+))) ; some files are under GPLv2+
1296 (define-public glibc/hurd-headers
1297 (package (inherit glibc)
1298 (name "glibc-hurd-headers")
1300 (propagated-inputs (list gnumach-headers hurd-headers))
1302 (modify-inputs (package-native-inputs glibc)
1303 (prepend (if (%current-target-system)
1304 ;; XXX: When targeting i586-pc-gnu, we need a 32-bit MiG,
1306 (package (inherit mig)
1307 (arguments `(#:system "i686-linux")))
1310 (substitute-keyword-arguments (package-arguments glibc)
1311 ;; We just pass the flags really needed to build the headers.
1312 ((#:configure-flags _)
1313 `(list "--enable-add-ons"
1314 "--host=i586-pc-gnu"))
1316 '(modify-phases %standard-phases
1318 (lambda* (#:key outputs #:allow-other-keys)
1319 (invoke "make" "install-headers")
1321 ;; Make an empty stubs.h to work around not being able to
1322 ;; produce a valid stubs.h and causing the build to fail. See
1323 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
1324 (let ((out (assoc-ref outputs "out")))
1327 (string-append out "/include/gnu/stubs.h"))))))
1328 (delete 'build))))))) ; nothing to build
1330 (define-public tzdata
1333 ;; This package should be kept in sync with python-pytz in (gnu packages
1339 "https://data.iana.org/time-zones/releases/tzdata"
1343 "0r0nhwpk9nyxj5kkvjy58nr5d85568m04dcb69c4y3zmykczyzzg"))))
1344 (build-system gnu-build-system)
1348 ;; This consists purely of (architecture-independent) data, so
1349 ;; ‘cross-compilation’ is pointless here! (The binaries zic,
1350 ;; dump, and tzselect are deleted in the post-install phase.)
1354 #~(let ((out #$output)
1355 (tmp (getenv "TMPDIR")))
1356 (list (string-append "TOPDIR=" out)
1357 (string-append "TZDIR=" out "/share/zoneinfo")
1358 (string-append "TZDEFAULT=" out
1359 "/share/zoneinfo/localtime")
1361 ;; Likewise for the C library routines.
1362 (string-append "LIBDIR=" tmp "/lib")
1363 (string-append "MANDIR=" tmp "/man")
1365 ;; XXX: tzdata 2020b changed the on-disk format
1366 ;; of the time zone files from 'fat' to 'slim'.
1367 ;; Many packages (particularly evolution-data-server)
1368 ;; can not yet handle the latter, so we stick with
1370 #$@(if (version>=? (package-version this-package)
1372 '("CPPFLAGS=-DZIC_BLOAT_DEFAULT='\"fat\"'")
1377 #:modules '((guix build utils)
1378 (guix build gnu-build-system)
1381 #~(modify-phases %standard-phases
1383 (lambda* (#:key source inputs #:allow-other-keys)
1384 (invoke "tar" "xvf" source)
1386 #$(match (package-inputs this-package)
1387 (((_ tzcode)) tzcode)))))
1388 (add-after 'install 'post-install
1389 (lambda* (#:key outputs #:allow-other-keys)
1390 ;; Move data in the right place.
1391 (let ((out (assoc-ref outputs "out")))
1392 ;; Discard zic, dump, and tzselect, already
1393 ;; provided by glibc.
1394 (delete-file-recursively (string-append out "/usr"))
1395 (symlink (string-append out "/share/zoneinfo")
1396 (string-append out "/share/zoneinfo/posix"))
1397 (delete-file-recursively
1398 (string-append out "/share/zoneinfo-posix"))
1399 (copy-recursively (string-append out "/share/zoneinfo-leaps")
1400 (string-append out "/share/zoneinfo/right"))
1401 (delete-file-recursively
1402 (string-append out "/share/zoneinfo-leaps")))))
1403 (delete 'configure))))
1404 (inputs (list (origin
1407 "https://data.iana.org/time-zones/releases/tzcode"
1411 "1iysv8fdkm79k8wh8jizmjmq075q4qjhk090vxjy57my6dz5wmzq")))))
1412 (home-page "https://www.iana.org/time-zones")
1413 (synopsis "Database of current and historical time zones")
1414 (description "The Time Zone Database (often called tz or zoneinfo)
1415 contains code and data that represent the history of local time for many
1416 representative locations around the globe. It is updated periodically to
1417 reflect changes made by political bodies to time zone boundaries, UTC offsets,
1418 and daylight-saving rules.")
1419 (license public-domain)))
1421 ;;; A "fixed" version of tzdata, which is used in the test suites of glib and R
1422 ;;; and a few other places. We can update this whenever we are able to rebuild
1423 ;;; thousands of packages (for example, in a core-updates rebuild). This package
1424 ;;; will typically be obsolete and should never be referred to by a built
1427 ;;; Please make this a hidden-package if it is different from the primary tzdata
1429 (define-public tzdata-for-tests tzdata)
1431 (define-public libiconv
1437 (uri (string-append "mirror://gnu/libiconv/libiconv-"
1441 "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc"))
1442 (modules '((guix build utils)))
1444 ;; Work around "declared gets" error on glibc systems (fixed by
1445 ;; Gnulib commit 66712c23388e93e5c518ebc8515140fa0c807348.)
1446 '(substitute* "srclib/stdio.in.h"
1447 (("^#undef gets") "")
1448 (("^_GL_WARN_ON_USE \\(gets.*") "")))))
1449 (build-system gnu-build-system)
1450 (synopsis "Character set conversion library")
1452 "libiconv provides an implementation of the iconv function for systems
1453 that lack it. iconv is used to convert between character encodings in a
1454 program. It supports a wide variety of different encodings.")
1455 (home-page "https://www.gnu.org/software/libiconv/")
1458 (define* (libiconv-if-needed #:optional (target (%current-target-system)))
1459 "Return either a libiconv package specification to include in a dependency
1460 list for platforms that have an incomplete libc, or the empty list. If a
1461 package needs iconv ,@(libiconv-if-needed) should be added."
1462 ;; POSIX C libraries provide iconv. Platforms with an incomplete libc
1463 ;; without iconv, such as MinGW, must return the then clause.
1464 (if (target-mingw? target)
1465 `(("libiconv" ,libiconv))
1468 (define-public (canonical-package package)
1469 ;; Avoid circular dependency by lazily resolving 'commencement'.
1470 (let* ((iface (resolve-interface '(gnu packages commencement)))
1471 (proc (module-ref iface 'canonical-package)))
1474 (define-public (%final-inputs)
1475 "Return the list of \"final inputs\"."
1476 ;; Avoid circular dependency by lazily resolving 'commencement'.
1477 (let ((iface (resolve-interface '(gnu packages commencement))))
1478 (module-ref iface '%final-inputs)))
1480 ;;; base.scm ends here