1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
7 ;;; Copyright © 2014, 2015 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages base)
25 #:use-module ((guix licenses)
26 #:select (gpl3+ lgpl2.0+ public-domain))
27 #:use-module (gnu packages)
28 #:use-module (gnu packages acl)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages ed)
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages multiprecision)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages texinfo)
37 #:use-module (gnu packages hurd)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages gettext)
40 #:use-module (guix utils)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system trivial))
49 ;;; Base packages of the Guix-based GNU user-land software distribution.
59 (uri (string-append "mirror://gnu/hello/hello-" version
63 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
64 (build-system gnu-build-system)
65 (synopsis "Hello, GNU world: An example GNU package")
67 "GNU Hello prints the message \"Hello, world!\" and then exits. It
68 serves as an example of standard GNU coding practices. As such, it supports
69 command-line arguments, multiple languages, and so on.")
70 (home-page "http://www.gnu.org/software/hello/")
79 (uri (string-append "mirror://gnu/grep/grep-"
83 "1pp5n15qwxrw1pibwjhhgsibyv5cafhamf8lwzjygs6y00fa2i2j"))
84 (patches (list (search-patch "grep-CVE-2015-1345.patch")))))
85 (build-system gnu-build-system)
86 (synopsis "Print lines matching a pattern")
88 "grep is a tool for finding text inside files. Text is found by
89 matching a pattern provided by the user in one or many files. The pattern
90 may be provided as a basic or extended regular expression, or as fixed
91 strings. By default, the matching text is simply printed to the screen,
92 however the output can be greatly customized to include, for example, line
93 numbers. GNU grep offers many extensions over the standard utility,
94 including, for example, recursive directory searching.")
96 (home-page "http://www.gnu.org/software/grep/")))
104 (uri (string-append "mirror://gnu/sed/sed-" version
108 "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"))
109 (patches (list (search-patch "sed-hurd-path-max.patch")))))
110 (build-system gnu-build-system)
111 (synopsis "Stream editor")
113 (if (%current-target-system)
115 `(#:phases (alist-cons-before
116 'patch-source-shebangs 'patch-test-suite
117 (lambda* (#:key inputs #:allow-other-keys)
118 (let ((bash (assoc-ref inputs "bash")))
119 (patch-makefile-SHELL "testsuite/Makefile.tests")
120 (substitute* '("testsuite/bsd.sh"
121 "testsuite/bug-regex9.c")
123 (string-append bash "/bin/bash")))))
126 "Sed is a non-interactive, text stream editor. It receives a text
127 input from a file or from standard input and it then applies a series of text
128 editing commands to the stream and prints its output to standard output. It
129 is often used for substituting text patterns in a stream. The GNU
130 implementation offers several extensions over the standard utility.")
132 (home-page "http://www.gnu.org/software/sed/")))
140 (uri (string-append "mirror://gnu/tar/tar-"
144 "1wi2zwm4c9r3h3b8y4w0nm0qq897kn8kyj9k22ba0iqvxj48vvk4"))
145 (patches (map search-patch
146 '("tar-d_ino_in_dirent-fix.patch"
147 "tar-skip-unreliable-tests.patch")))))
148 (build-system gnu-build-system)
149 (synopsis "Managing tar archives")
151 "Tar provides the ability to create tar archives, as well as the
152 ability to extract, update or list files in an existing archive. It is
153 useful for combining many files into one larger file, while maintaining
154 directory structure and file information such as permissions and
155 creation/modification dates. GNU tar offers many extensions over the
158 (home-page "http://www.gnu.org/software/tar/")))
166 (uri (string-append "mirror://gnu/patch/patch-"
170 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
171 (patches (list (search-patch "patch-hurd-path-max.patch")))))
172 (build-system gnu-build-system)
173 (native-inputs `(("ed", ed)))
174 (synopsis "Apply differences to originals, with optional backups")
176 "Patch is a program that applies changes to files based on differences
177 laid out as by the program \"diff\". The changes may be applied to one or more
178 files depending on the contents of the diff file. It accepts several
179 different diff formats. It may also be used to revert previously applied
182 (home-page "http://savannah.gnu.org/projects/patch/")))
184 (define-public diffutils
190 (uri (string-append "mirror://gnu/diffutils/diffutils-"
194 "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2"))))
195 (build-system gnu-build-system)
196 (synopsis "Comparing and merging files")
198 "GNU Diffutils is a package containing tools for finding the
199 differences between files. The \"diff\" command is used to show how two files
200 differ, while \"cmp\" shows the offsets and line numbers where they differ.
201 \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
202 interactive means to merge two files.")
204 (home-page "http://www.gnu.org/software/diffutils/")))
206 (define-public findutils
212 (uri (string-append "mirror://gnu/findutils/findutils-"
216 "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3"))
217 (patches (map search-patch
218 '("findutils-absolute-paths.patch"
219 "findutils-localstatedir.patch")))))
220 (build-system gnu-build-system)
222 `(#:configure-flags (list
223 ;; Tell 'updatedb' to write to /var.
224 "--localstatedir=/var"
226 ;; Work around cross-compilation failure. See
227 ;; <http://savannah.gnu.org/bugs/?27299#comment1>.
228 ,@(if (%current-target-system)
229 '("gl_cv_func_wcwidth_works=yes")
231 (synopsis "Operating on files matching given criteria")
233 "Findutils supplies the basic file directory searching utilities of the
234 GNU system. It consists of two primary searching utilities: \"find\"
235 recursively searches for files in a directory according to given criteria and
236 \"locate\" lists files in a database that match a query. Two auxiliary tools
237 are included: \"updatedb\" updates the file name database and \"xargs\" may be
238 used to apply commands with arbitrarily long arguments.")
240 (home-page "http://www.gnu.org/software/findutils/")))
242 (define-public coreutils
248 (uri (string-append "mirror://gnu/coreutils/coreutils-"
252 "0w11jw3fb5sslf0f72kxy7llxgk1ia3a6bcw0c9kmvxrlj355mx2"))
254 (list (search-patch "coreutils-racy-tail-test.patch")))))
255 (build-system gnu-build-system)
256 (inputs `(("acl" ,acl) ; TODO: add SELinux
257 ("gmp" ,gmp) ;bignums in 'expr', yay!
259 ;; Drop the dependency on libcap when cross-compiling since it's
260 ;; not quite cross-compilable.
261 ,@(if (%current-target-system)
263 `(("libcap" ,libcap))))) ;capability support is 'ls', etc.
265 ;; Perl is needed to run tests in native builds, and to run the bundled
266 ;; copy of help2man. However, don't pass it when cross-compiling since
267 ;; that would lead it to try to run programs to get their '--help' output
269 (if (%current-target-system)
272 (outputs '("out" "debug"))
274 `(#:parallel-build? #f ; help2man may be called too early
275 #:phases (alist-cons-before
276 'build 'patch-shell-references
277 (lambda* (#:key inputs #:allow-other-keys)
278 (let ((bash (assoc-ref inputs "bash")))
279 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
280 ;; that tests pass, since /bin/sh isn't in the chroot.
281 (setenv "SHELL" (which "sh"))
283 (substitute* (find-files "gnulib-tests" "\\.c$")
285 (format #f "~a/bin/sh" bash)))
286 (substitute* (find-files "tests" "\\.sh$")
288 (format #f "#!~a/bin/sh" bash)))))
290 (synopsis "Core GNU utilities (file, text, shell)")
292 "GNU Coreutils includes all of the basic command-line tools that are
293 expected in a POSIX system. These provide the basic file, shell and text
294 manipulation functions of the GNU system. Most of these tools offer extended
295 functionality beyond that which is outlined in the POSIX standard.")
297 (home-page "http://www.gnu.org/software/coreutils/")))
299 (define-public coreutils-minimal
300 ;; Coreutils without its optional dependencies.
303 (name "coreutils-minimal")
307 (define-public gnu-make
313 (uri (string-append "mirror://gnu/make/make-" version
317 "19gwwhik3wdwn0r42b7xcihkbxvjl9r2bdal8nifc3k5i4rn3iqb"))
318 (patches (list (search-patch "make-impure-dirs.patch")))))
319 (build-system gnu-build-system)
320 (native-inputs `(("pkg-config", pkg-config))) ; to detect Guile
321 (inputs `(("guile" ,guile-2.0)))
322 (outputs '("out" "debug"))
324 '(#:phases (alist-cons-before
325 'build 'set-default-shell
326 (lambda* (#:key inputs #:allow-other-keys)
327 ;; Change the default shell from /bin/sh.
328 (let ((bash (assoc-ref inputs "bash")))
330 (("default_shell =.*$")
331 (format #f "default_shell = \"~a/bin/bash\";\n"
334 (synopsis "Remake files automatically")
336 "Make is a program that is used to control the production of
337 executables or other files from their source files. The process is
338 controlled from a Makefile, in which the developer specifies how each file is
339 generated from its source. It has powerful dependency resolution and the
340 ability to determine when files have to be regenerated after their sources
341 change. GNU make offers many powerful extensions over the standard utility.")
343 (home-page "http://www.gnu.org/software/make/")))
345 (define-public binutils
351 (uri (string-append "mirror://gnu/binutils/binutils-"
355 "08lzmhidzc16af1zbx34f8cy4z7mzrswpdbhrb8shy3xxpflmcdm"))
356 (patches (list (search-patch "binutils-ld-new-dtags.patch")
357 (search-patch "binutils-loongson-workaround.patch")))))
358 (build-system gnu-build-system)
360 ;; TODO: Add dependency on zlib + those for Gold.
362 `(#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
363 ;; on GCC when bootstrapping.
364 "LDFLAGS=-static-libgcc"
366 ;; Don't search under /usr/lib & co.
367 "--with-lib-path=/no-ld-lib-path"
369 ;; Glibc 2.17 has a "comparison of unsigned
370 ;; expression >= 0 is always true" in wchar.h.
373 ;; Install BFD. It ends up in a hidden directory,
375 "--enable-install-libbfd"
377 ;; Make sure 'ar' and 'ranlib' produce archives in a
378 ;; deterministic fashion.
379 "--enable-deterministic-archives")))
381 (synopsis "Binary utilities: bfd gas gprof ld")
383 "GNU Binutils is a collection of tools for working with binary files.
384 Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
385 Other tools include programs to display binary profiling information, list
386 the strings in a binary file, and utilities for working with archives. The
387 \"bfd\" library for working with executable and object formats is also
390 (home-page "http://www.gnu.org/software/binutils/")))
392 (define* (make-ld-wrapper name #:key binutils
393 (guile (canonical-package guile-2.0))
394 (bash (canonical-package bash)) target
395 (guile-for-build guile))
396 "Return a package called NAME that contains a wrapper for the 'ld' program
397 of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. When
398 TARGET is not #f, make a wrapper for the cross-linker for TARGET, called
399 'TARGET-ld'. The wrapper uses GUILE and BASH."
404 (build-system trivial-build-system)
405 (inputs `(("binutils" ,binutils)
408 ("wrapper" ,(search-path %load-path
409 "gnu/packages/ld-wrapper.in"))))
411 `(#:guile ,guile-for-build
412 #:modules ((guix build utils))
414 (use-modules (guix build utils)
415 (system base compile))
417 (let* ((out (assoc-ref %outputs "out"))
418 (bin (string-append out "/bin"))
420 `(string-append bin "/" ,target "-ld")
421 '(string-append bin "/ld")))
422 (go (string-append ld ".go")))
424 (setvbuf (current-output-port) _IOLBF)
425 (format #t "building ~s/bin/ld wrapper in ~s~%"
426 (assoc-ref %build-inputs "binutils")
430 (copy-file (assoc-ref %build-inputs "wrapper") ld)
435 (string-append (assoc-ref %build-inputs "guile")
438 (string-append (assoc-ref %build-inputs "bash")
441 (string-append (assoc-ref %build-inputs "binutils")
443 (string-append "/bin/"
447 (compile-file ld #:output-file go)))))
448 (synopsis "The linker wrapper")
450 "The linker wrapper (or 'ld-wrapper') wraps the linker to add any
451 missing '-rpath' flags, and to detect any misuse of libraries outside of the
453 (home-page "http://www.gnu.org/software/guix/")
456 (export make-ld-wrapper)
464 (uri (string-append "mirror://gnu/glibc/glibc-"
468 "0j49682pm2nh4qbdw35bas82p1pgfnz4d2l7iwfyzvrvj0318wzb"))
470 ;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
471 ;; required on LFS distros to avoid loading the distro's libc.so
473 '(substitute* "sysdeps/unix/sysv/linux/configure"
474 (("use_ldconfig=yes")
476 (modules '((guix build utils)))
477 (patches (map search-patch
478 '("glibc-ldd-x86_64.patch"
479 "glibc-o-largefile.patch")))))
480 (build-system gnu-build-system)
482 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
483 ;; users should automatically pull Linux headers as well.
484 (propagated-inputs `(("linux-headers" ,linux-libre-headers)))
486 (outputs '("out" "debug"))
489 `(#:out-of-source? #t
491 ;; In version 2.21, there a race in the 'elf' directory, see
492 ;; <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00709.html>.
495 ;; The libraries have an empty RUNPATH, but some, such as the versioned
496 ;; libraries (libdl-2.22.so, etc.) have ld.so marked as NEEDED. Since
497 ;; these libraries are always going to be found anyway, just skip
499 #:validate-runpath? #f
502 (list "--enable-add-ons"
505 ;; Installing a locale archive with all the locales is to
506 ;; expensive (~100 MiB), so we rely on users to install the
507 ;; locales they really want.
509 ;; Set the default locale path. In practice, $LOCPATH may be
510 ;; defined to point whatever locales users want. However, setuid
511 ;; binaries don't honor $LOCPATH, so they'll instead look into
512 ;; $libc_cv_localedir; we choose /run/current-system/locale, with
513 ;; the idea that it is going to be populated by the sysadmin.
515 ;; `--localedir' is not honored, so work around it.
516 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
517 (string-append "libc_cv_localedir=/run/current-system/locale")
519 (string-append "--with-headers="
520 (assoc-ref %build-inputs "linux-headers")
523 ;; This is the default for most architectures as of GNU libc 2.21,
524 ;; but we specify it explicitly for clarity and consistency. See
525 ;; "kernel-features.h" in the GNU libc for details.
526 "--enable-kernel=2.6.32"
528 ;; Use our Bash instead of /bin/sh.
529 (string-append "BASH_SHELL="
530 (assoc-ref %build-inputs "bash")
533 ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
537 #:phases (modify-phases %standard-phases
539 'configure 'pre-configure
540 (lambda* (#:key inputs native-inputs outputs
542 (let* ((out (assoc-ref outputs "out"))
543 (bin (string-append out "/bin"))
544 ;; FIXME: Normally we would look it up only in INPUTS
545 ;; but cross-base uses it as a native input.
546 (bash (or (assoc-ref inputs "static-bash")
547 (assoc-ref native-inputs "static-bash"))))
548 ;; Use `pwd', not `/bin/pwd'.
549 (substitute* "configure"
550 (("/bin/pwd") "pwd"))
552 ;; Install the rpc data base file under `$out/etc/rpc'.
553 ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
554 (substitute* "sunrpc/Makefile"
555 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
556 (string-append out "/etc/rpc" suffix "\n"))
557 (("^install-others =.*$")
558 (string-append "install-others = " out "/etc/rpc\n")))
560 (substitute* "Makeconfig"
562 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
563 ;; linking against libgcc_s is not needed with GCC
567 ;; Have `system' use that Bash.
568 (substitute* "sysdeps/posix/system.c"
569 (("#define[[:blank:]]+SHELL_PATH.*$")
570 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
574 (substitute* "libio/iopopen.c"
576 (string-append bash "/bin/bash")))
578 ;; Same for the shell used by the 'exec' functions for
579 ;; scripts that lack a shebang.
580 (substitute* (find-files "." "^paths\\.h$")
581 (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
582 (string-append "#define _PATH_BSHELL \""
583 bash "/bin/bash\"\n")))
585 ;; Make sure we don't retain a reference to the
587 (substitute* "malloc/mtrace.pl"
589 ;; The shebang can be omitted, because there's the
590 ;; "bilingual" eval/exec magic at the top of the file.
595 (inputs `(("static-bash" ,static-bash)))
597 ;; To build the manual, we need Texinfo and Perl. Gettext is needed to
598 ;; install the message catalogs, with 'msgfmt'.
599 (native-inputs `(("texinfo" ,texinfo)
601 ("gettext" ,gnu-gettext)))
604 ;; Search path for packages that provide locale data. This is useful
605 ;; primarily in build environments.
606 (list (search-path-specification
608 (files '("lib/locale")))))
610 (synopsis "The GNU C Library")
612 "Any Unix-like operating system needs a C library: the library which
613 defines the \"system calls\" and other basic facilities such as open, malloc,
616 The GNU C library is used as the C library in the GNU system and most systems
617 with the Linux kernel.")
619 (home-page "http://www.gnu.org/software/libc/")))
621 (define-public glibc-locales
624 (name "glibc-locales")
625 (source (origin (inherit (package-source glibc))
626 (patches (cons (search-patch "glibc-locales.patch")
627 (origin-patches (package-source glibc))))))
628 (synopsis "All the locales supported by the GNU C Library")
630 "This package provides all the locales supported by the GNU C Library,
631 more than 400 in total. To use them set the 'LOCPATH' environment variable to
632 the 'share/locale' sub-directory of this package.")
633 (outputs '("out")) ;110+ MiB
634 (native-search-paths '())
636 (let ((args `(#:tests? #f #:strip-binaries? #f
637 ,@(package-arguments glibc))))
638 (substitute-keyword-arguments args
642 (lambda* (#:key outputs #:allow-other-keys)
643 (zero? (system* "make" "localedata/install-locales"
644 "-j" (number->string (parallel-job-count)))))
645 (alist-delete 'install ,phases)))
646 ((#:configure-flags flags)
648 ;; Use $(libdir)/locale as is the case by default.
649 (list (string-append "libc_cv_localedir="
650 (assoc-ref %outputs "out")
651 "/lib/locale")))))))))
653 (define-public glibc-utf8-locales
655 (name "glibc-utf8-locales")
656 (version (package-version glibc))
658 (build-system trivial-build-system)
660 '(#:modules ((guix build utils))
662 (use-modules (srfi srfi-1)
665 (let* ((libc (assoc-ref %build-inputs "glibc"))
666 (gzip (assoc-ref %build-inputs "gzip"))
667 (out (assoc-ref %outputs "out"))
668 (localedir (string-append out "/lib/locale")))
669 ;; 'localedef' needs 'gzip'.
670 (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
673 (every (lambda (locale)
674 (zero? (system* "localedef" "--no-archive"
675 "--prefix" localedir "-i" locale
677 (string-append localedir "/"
681 ;; These are the locales commonly used for
682 ;; tests---e.g., in Guile's i18n tests.
683 '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))))))
684 (inputs `(("glibc" ,glibc)
686 (synopsis "Small sample of UTF-8 locales")
688 "This package provides a small sample of UTF-8 locales mostly useful in
690 (home-page (package-home-page glibc))
691 (license (package-license glibc))))
699 (uri (string-append "mirror://gnu/which/which-"
703 "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
704 (build-system gnu-build-system)
705 (home-page "https://gnu.org/software/which/")
706 (synopsis "Find full path of shell commands")
708 "The which program finds the location of executables in PATH, with a
709 variety of options. It is an alternative to the shell \"type\" built-in
711 (license gpl3+))) ; some files are under GPLv2+
713 (define-public glibc/hurd
714 ;; The Hurd's libc variant.
715 (package (inherit glibc)
721 (url "git://git.sv.gnu.org/hurd/glibc")
722 (commit "cc94b3cfe65523f980359e5f0e93a26196bda1d3")))
725 "17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
726 (file-name (string-append name "-" version))
727 (patches (map search-patch
728 '("glibc-hurd-extern-inline.patch")))))
730 ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
731 ;; so both should be propagated.
732 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
733 ("hurd-headers" ,hurd-headers)
734 ("hurd-minimal" ,hurd-minimal)))
736 `(,@(package-native-inputs glibc)
737 ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
740 ("libpthread" ,(origin
743 (url "git://git.sv.gnu.org/hurd/libpthread")
744 (commit "0ef7b75c4ba91b6660f0d3d8b51d14d25e3d5bfb")))
747 "031py18fls15z0wprni33mf762kg6fx8xqijppimhp83yp6ky3l3"))
748 (file-name "libpthread")))))
751 (substitute-keyword-arguments (package-arguments glibc)
752 ((#:configure-flags original-configure-flags)
753 `(append (list "--host=i686-pc-gnu"
755 ;; nscd fails to build for GNU/Hurd:
756 ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
759 (filter (lambda (flag)
760 (not (or (string-prefix? "--with-headers=" flag)
761 (string-prefix? "--enable-kernel=" flag))))
762 ;; Evaluate 'original-configure-flags' in a
763 ;; lexical environment that has a dummy
764 ;; "linux-headers" input, to prevent errors.
765 (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
767 ,original-configure-flags))))
770 'unpack 'prepare-libpthread
771 (lambda* (#:key inputs #:allow-other-keys)
772 (copy-recursively (assoc-ref inputs "libpthread") "libpthread")
774 (system* "patch" "--force" "-p1" "-i"
775 (assoc-ref inputs "patch/libpthread-patch"))
778 (synopsis "The GNU C Library (GNU Hurd variant)")
779 (supported-systems %hurd-systems)))
781 (define-public glibc/hurd-headers
782 (package (inherit glibc/hurd)
783 (name "glibc-hurd-headers")
785 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
786 ("hurd-headers" ,hurd-headers)))
788 (substitute-keyword-arguments (package-arguments glibc/hurd)
789 ;; We just pass the flags really needed to build the headers.
790 ((#:configure-flags _)
791 `(list "--enable-add-ons"
793 "--enable-obsolete-rpc"))
797 (lambda* (#:key outputs #:allow-other-keys)
798 (and (zero? (system* "make" "install-headers"))
800 ;; Make an empty stubs.h to work around not being able to
801 ;; produce a valid stubs.h and causing the build to fail. See
802 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
803 (let ((out (assoc-ref outputs "out")))
806 (string-append out "/include/gnu/stubs.h"))))))
813 'configure 'pre-configure
815 ;; Use the right 'pwd'.
816 (substitute* "configure"
817 (("/bin/pwd") "pwd")))
818 %standard-phases))))))))
820 (define-public tzdata
827 "http://www.iana.org/time-zones/repository/releases/tzdata"
831 "0nin48g5dmkfgckp25bngxchn3sw3yyjss5sq7gs5xspbxgsq3w6"))))
832 (build-system gnu-build-system)
835 #:make-flags (let ((out (assoc-ref %outputs "out"))
836 (tmp (getenv "TMPDIR")))
837 (list (string-append "TOPDIR=" out)
838 (string-append "TZDIR=" out "/share/zoneinfo")
840 ;; Discard zic, dump, and tzselect, already
841 ;; provided by glibc.
842 (string-append "ETCDIR=" tmp "/etc")
844 ;; Likewise for the C library routines.
845 (string-append "LIBDIR=" tmp "/lib")
846 (string-append "MANDIR=" tmp "/man")
850 #:modules ((guix build utils)
851 (guix build gnu-build-system)
856 (lambda* (#:key source inputs #:allow-other-keys)
857 (and (zero? (system* "tar" "xvf" source))
858 (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode")))))
860 'install 'post-install
861 (lambda* (#:key outputs #:allow-other-keys)
862 ;; Move data in the right place.
863 (let ((out (assoc-ref outputs "out")))
864 (copy-recursively (string-append out "/share/zoneinfo-posix")
865 (string-append out "/share/zoneinfo/posix"))
866 (copy-recursively (string-append out "/share/zoneinfo-leaps")
867 (string-append out "/share/zoneinfo/right"))
868 (delete-file-recursively (string-append out "/share/zoneinfo-posix"))
869 (delete-file-recursively (string-append out "/share/zoneinfo-leaps"))))
870 (alist-delete 'configure %standard-phases)))))
871 (inputs `(("tzcode" ,(origin
874 "http://www.iana.org/time-zones/repository/releases/tzcode"
878 "0bplibiy70dvlrhwqzkzxgmg81j6d2kklvjgi2f1g2zz1nkb3vkz"))))))
879 (home-page "http://www.iana.org/time-zones")
880 (synopsis "Database of current and historical time zones")
881 (description "The Time Zone Database (often called tz or zoneinfo)
882 contains code and data that represent the history of local time for many
883 representative locations around the globe. It is updated periodically to
884 reflect changes made by political bodies to time zone boundaries, UTC offsets,
885 and daylight-saving rules.")
886 (license public-domain)))
888 (define-public (canonical-package package)
889 ;; Avoid circular dependency by lazily resolving 'commencement'.
890 (let* ((iface (resolve-interface '(gnu packages commencement)))
891 (proc (module-ref iface 'canonical-package)))
894 ;;; base.scm ends here