1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016 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, 2016 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 Efraim Flashner <efraim@flashner.co.il>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages base)
26 #:use-module ((guix licenses)
27 #:select (gpl3+ lgpl2.0+ public-domain))
28 #:use-module (gnu packages)
29 #:use-module (gnu packages acl)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages ed)
32 #:use-module (gnu packages guile)
33 #:use-module (gnu packages multiprecision)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages hurd)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages gettext)
41 #:use-module (guix utils)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system trivial))
50 ;;; Base packages of the Guix-based GNU user-land software distribution.
60 (uri (string-append "mirror://gnu/hello/hello-" version
64 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
65 (build-system gnu-build-system)
66 (synopsis "Hello, GNU world: An example GNU package")
68 "GNU Hello prints the message \"Hello, world!\" and then exits. It
69 serves as an example of standard GNU coding practices. As such, it supports
70 command-line arguments, multiple languages, and so on.")
71 (home-page "http://www.gnu.org/software/hello/")
80 (uri (string-append "mirror://gnu/grep/grep-"
84 "1srn321x7whlhs5ks36zlcrrmj4iahll8fxwsh1vbz3v04px54fa"))
85 (patches (search-patches "grep-timing-sensitive-test.patch"))))
86 (build-system gnu-build-system)
87 (native-inputs `(("perl" ,perl))) ;some of the tests require it
88 (synopsis "Print lines matching a pattern")
90 "grep is a tool for finding text inside files. Text is found by
91 matching a pattern provided by the user in one or many files. The pattern
92 may be provided as a basic or extended regular expression, or as fixed
93 strings. By default, the matching text is simply printed to the screen,
94 however the output can be greatly customized to include, for example, line
95 numbers. GNU grep offers many extensions over the standard utility,
96 including, for example, recursive directory searching.")
98 (home-page "http://www.gnu.org/software/grep/")))
106 (uri (string-append "mirror://gnu/sed/sed-" version
110 "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"))
111 (patches (search-patches "sed-hurd-path-max.patch"))))
112 (build-system gnu-build-system)
113 (synopsis "Stream editor")
115 (if (%current-target-system)
117 `(#:phases (alist-cons-before
118 'patch-source-shebangs 'patch-test-suite
119 (lambda* (#:key inputs #:allow-other-keys)
120 (let ((bash (assoc-ref inputs "bash")))
121 (patch-makefile-SHELL "testsuite/Makefile.tests")
122 (substitute* '("testsuite/bsd.sh"
123 "testsuite/bug-regex9.c")
125 (string-append bash "/bin/bash")))))
128 "Sed is a non-interactive, text stream editor. It receives a text
129 input from a file or from standard input and it then applies a series of text
130 editing commands to the stream and prints its output to standard output. It
131 is often used for substituting text patterns in a stream. The GNU
132 implementation offers several extensions over the standard utility.")
134 (home-page "http://www.gnu.org/software/sed/")))
142 (uri (string-append "mirror://gnu/tar/tar-"
146 "1wi2zwm4c9r3h3b8y4w0nm0qq897kn8kyj9k22ba0iqvxj48vvk4"))
147 (patches (search-patches "tar-d_ino_in_dirent-fix.patch"
148 "tar-skip-unreliable-tests.patch"))))
149 (build-system gnu-build-system)
150 (synopsis "Managing tar archives")
152 "Tar provides the ability to create tar archives, as well as the
153 ability to extract, update or list files in an existing archive. It is
154 useful for combining many files into one larger file, while maintaining
155 directory structure and file information such as permissions and
156 creation/modification dates. GNU tar offers many extensions over the
159 (home-page "http://www.gnu.org/software/tar/")))
167 (uri (string-append "mirror://gnu/patch/patch-"
171 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
172 (patches (search-patches "patch-hurd-path-max.patch"))))
173 (build-system gnu-build-system)
174 (native-inputs `(("ed" ,ed)))
175 (synopsis "Apply differences to originals, with optional backups")
177 "Patch is a program that applies changes to files based on differences
178 laid out as by the program \"diff\". The changes may be applied to one or more
179 files depending on the contents of the diff file. It accepts several
180 different diff formats. It may also be used to revert previously applied
183 (home-page "http://savannah.gnu.org/projects/patch/")))
185 (define-public diffutils
191 (uri (string-append "mirror://gnu/diffutils/diffutils-"
195 "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2"))))
196 (build-system gnu-build-system)
197 (synopsis "Comparing and merging files")
199 "GNU Diffutils is a package containing tools for finding the
200 differences between files. The \"diff\" command is used to show how two files
201 differ, while \"cmp\" shows the offsets and line numbers where they differ.
202 \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
203 interactive means to merge two files.")
205 (home-page "http://www.gnu.org/software/diffutils/")))
207 (define-public findutils
213 (uri (string-append "mirror://gnu/findutils/findutils-"
217 "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y"))
218 (patches (search-patches "findutils-localstatedir.patch"
219 "findutils-test-xargs.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"))
256 (uri "http://git.savannah.gnu.org/cgit/coreutils.git/\
257 patch/?id=3ba68f9e64fa2eb8af22d510437a0c6441feb5e0")
260 "1dnlszhc8lihhg801i9sz896mlrgfsjfcz62636prb27k5hmixqz"))
261 (file-name "coreutils-tail-inotify-race.patch"))))))
262 (build-system gnu-build-system)
263 (inputs `(("acl" ,acl) ; TODO: add SELinux
264 ("gmp" ,gmp) ;bignums in 'expr', yay!
266 ;; Drop the dependency on libcap when cross-compiling since it's
267 ;; not quite cross-compilable.
268 ,@(if (%current-target-system)
270 `(("libcap" ,libcap))))) ;capability support is 'ls', etc.
272 ;; Perl is needed to run tests in native builds, and to run the bundled
273 ;; copy of help2man. However, don't pass it when cross-compiling since
274 ;; that would lead it to try to run programs to get their '--help' output
276 (if (%current-target-system)
279 (outputs '("out" "debug"))
281 `(#:parallel-build? #f ; help2man may be called too early
282 #:phases (alist-cons-before
283 'build 'patch-shell-references
284 (lambda* (#:key inputs #:allow-other-keys)
285 (let ((bash (assoc-ref inputs "bash")))
286 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
287 ;; that tests pass, since /bin/sh isn't in the chroot.
288 (setenv "SHELL" (which "sh"))
290 (substitute* (find-files "gnulib-tests" "\\.c$")
292 (format #f "~a/bin/sh" bash)))
293 (substitute* (find-files "tests" "\\.sh$")
295 (format #f "#!~a/bin/sh" bash)))))
297 (synopsis "Core GNU utilities (file, text, shell)")
299 "GNU Coreutils includes all of the basic command-line tools that are
300 expected in a POSIX system. These provide the basic file, shell and text
301 manipulation functions of the GNU system. Most of these tools offer extended
302 functionality beyond that which is outlined in the POSIX standard.")
304 (home-page "http://www.gnu.org/software/coreutils/")))
306 (define-public coreutils-minimal
307 ;; Coreutils without its optional dependencies.
310 (name "coreutils-minimal")
314 (define-public gnu-make
320 (uri (string-append "mirror://gnu/make/make-" version
324 "19gwwhik3wdwn0r42b7xcihkbxvjl9r2bdal8nifc3k5i4rn3iqb"))
325 (patches (search-patches "make-impure-dirs.patch"))))
326 (build-system gnu-build-system)
327 (native-inputs `(("pkg-config" ,pkg-config))) ; to detect Guile
328 (inputs `(("guile" ,guile-2.0)))
329 (outputs '("out" "debug"))
331 '(#:phases (alist-cons-before
332 'build 'set-default-shell
333 (lambda* (#:key inputs #:allow-other-keys)
334 ;; Change the default shell from /bin/sh.
335 (let ((bash (assoc-ref inputs "bash")))
337 (("default_shell =.*$")
338 (format #f "default_shell = \"~a/bin/bash\";\n"
341 (synopsis "Remake files automatically")
343 "Make is a program that is used to control the production of
344 executables or other files from their source files. The process is
345 controlled from a Makefile, in which the developer specifies how each file is
346 generated from its source. It has powerful dependency resolution and the
347 ability to determine when files have to be regenerated after their sources
348 change. GNU make offers many powerful extensions over the standard utility.")
350 (home-page "http://www.gnu.org/software/make/")))
352 (define-public binutils
358 (uri (string-append "mirror://gnu/binutils/binutils-"
362 "08lzmhidzc16af1zbx34f8cy4z7mzrswpdbhrb8shy3xxpflmcdm"))
363 (patches (search-patches "binutils-ld-new-dtags.patch"
364 "binutils-loongson-workaround.patch"))))
365 (build-system gnu-build-system)
367 ;; TODO: Add dependency on zlib + those for Gold.
369 `(#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
370 ;; on GCC when bootstrapping.
371 "LDFLAGS=-static-libgcc"
373 ;; Don't search under /usr/lib & co.
374 "--with-lib-path=/no-ld-lib-path"
376 ;; Glibc 2.17 has a "comparison of unsigned
377 ;; expression >= 0 is always true" in wchar.h.
380 ;; Install BFD. It ends up in a hidden directory,
382 "--enable-install-libbfd"
384 ;; Make sure 'ar' and 'ranlib' produce archives in a
385 ;; deterministic fashion.
386 "--enable-deterministic-archives")))
388 (synopsis "Binary utilities: bfd gas gprof ld")
390 "GNU Binutils is a collection of tools for working with binary files.
391 Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
392 Other tools include programs to display binary profiling information, list
393 the strings in a binary file, and utilities for working with archives. The
394 \"bfd\" library for working with executable and object formats is also
397 (home-page "http://www.gnu.org/software/binutils/")))
399 (define* (make-ld-wrapper name #:key binutils
400 (guile (canonical-package guile-2.0))
401 (bash (canonical-package bash)) target
402 (guile-for-build guile))
403 "Return a package called NAME that contains a wrapper for the 'ld' program
404 of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. When
405 TARGET is not #f, make a wrapper for the cross-linker for TARGET, called
406 'TARGET-ld'. The wrapper uses GUILE and BASH."
411 (build-system trivial-build-system)
412 (inputs `(("binutils" ,binutils)
415 ("wrapper" ,(search-path %load-path
416 "gnu/packages/ld-wrapper.in"))))
418 `(#:guile ,guile-for-build
419 #:modules ((guix build utils))
421 (use-modules (guix build utils)
422 (system base compile))
424 (let* ((out (assoc-ref %outputs "out"))
425 (bin (string-append out "/bin"))
427 `(string-append bin "/" ,target "-ld")
428 '(string-append bin "/ld")))
429 (go (string-append ld ".go")))
431 (setvbuf (current-output-port) _IOLBF)
432 (format #t "building ~s/bin/ld wrapper in ~s~%"
433 (assoc-ref %build-inputs "binutils")
437 (copy-file (assoc-ref %build-inputs "wrapper") ld)
442 (string-append (assoc-ref %build-inputs "guile")
445 (string-append (assoc-ref %build-inputs "bash")
448 (string-append (assoc-ref %build-inputs "binutils")
450 (string-append "/bin/"
454 (compile-file ld #:output-file go)))))
455 (synopsis "The linker wrapper")
457 "The linker wrapper (or 'ld-wrapper') wraps the linker to add any
458 missing '-rpath' flags, and to detect any misuse of libraries outside of the
460 (home-page "http://www.gnu.org/software/guix/")
463 (export make-ld-wrapper)
471 (uri (string-append "mirror://gnu/glibc/glibc-"
475 "0j49682pm2nh4qbdw35bas82p1pgfnz4d2l7iwfyzvrvj0318wzb"))
477 ;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
478 ;; required on LFS distros to avoid loading the distro's libc.so
480 '(substitute* "sysdeps/unix/sysv/linux/configure"
481 (("use_ldconfig=yes")
483 (modules '((guix build utils)))
485 (search-patches "glibc-ldd-x86_64.patch"
486 "glibc-locale-incompatibility.patch"
487 "glibc-versioned-locpath.patch"
488 "glibc-o-largefile.patch"
489 "glibc-CVE-2015-7547.patch"))))
490 (build-system gnu-build-system)
492 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
493 ;; users should automatically pull Linux headers as well.
494 (propagated-inputs `(("linux-headers" ,linux-libre-headers)))
496 (outputs '("out" "debug"))
499 `(#:out-of-source? #t
501 ;; In version 2.21, there a race in the 'elf' directory, see
502 ;; <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00709.html>.
505 ;; The libraries have an empty RUNPATH, but some, such as the versioned
506 ;; libraries (libdl-2.22.so, etc.) have ld.so marked as NEEDED. Since
507 ;; these libraries are always going to be found anyway, just skip
509 #:validate-runpath? #f
512 (list "--enable-add-ons"
515 ;; Installing a locale archive with all the locales is to
516 ;; expensive (~100 MiB), so we rely on users to install the
517 ;; locales they really want.
519 ;; Set the default locale path. In practice, $LOCPATH may be
520 ;; defined to point whatever locales users want. However, setuid
521 ;; binaries don't honor $LOCPATH, so they'll instead look into
522 ;; $libc_cv_localedir; we choose /run/current-system/locale/X.Y,
523 ;; with the idea that it is going to be populated by the sysadmin.
524 ;; The "X.Y" sub-directory is because locale data formats are
525 ;; incompatible across libc versions; see
526 ;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
528 ;; `--localedir' is not honored, so work around it.
529 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
530 (string-append "libc_cv_localedir=/run/current-system/locale/"
533 (string-append "--with-headers="
534 (assoc-ref %build-inputs "linux-headers")
537 ;; This is the default for most architectures as of GNU libc 2.21,
538 ;; but we specify it explicitly for clarity and consistency. See
539 ;; "kernel-features.h" in the GNU libc for details.
540 "--enable-kernel=2.6.32"
542 ;; Use our Bash instead of /bin/sh.
543 (string-append "BASH_SHELL="
544 (assoc-ref %build-inputs "bash")
547 ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
551 #:phases (modify-phases %standard-phases
553 'configure 'pre-configure
554 (lambda* (#:key inputs native-inputs outputs
556 (let* ((out (assoc-ref outputs "out"))
557 (bin (string-append out "/bin"))
558 ;; FIXME: Normally we would look it up only in INPUTS
559 ;; but cross-base uses it as a native input.
560 (bash (or (assoc-ref inputs "static-bash")
561 (assoc-ref native-inputs "static-bash"))))
562 ;; Use `pwd', not `/bin/pwd'.
563 (substitute* "configure"
564 (("/bin/pwd") "pwd"))
566 ;; Install the rpc data base file under `$out/etc/rpc'.
567 ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
568 (substitute* "sunrpc/Makefile"
569 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
570 (string-append out "/etc/rpc" suffix "\n"))
571 (("^install-others =.*$")
572 (string-append "install-others = " out "/etc/rpc\n")))
574 (substitute* "Makeconfig"
576 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
577 ;; linking against libgcc_s is not needed with GCC
581 ;; Have `system' use that Bash.
582 (substitute* "sysdeps/posix/system.c"
583 (("#define[[:blank:]]+SHELL_PATH.*$")
584 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
588 (substitute* "libio/iopopen.c"
590 (string-append bash "/bin/bash")))
592 ;; Same for the shell used by the 'exec' functions for
593 ;; scripts that lack a shebang.
594 (substitute* (find-files "." "^paths\\.h$")
595 (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
596 (string-append "#define _PATH_BSHELL \""
597 bash "/bin/bash\"\n")))
599 ;; Nscd uses __DATE__ and __TIME__ to create a string to
600 ;; make sure the client and server come from the same
601 ;; libc. Use something deterministic instead.
602 (substitute* "nscd/nscd_stat.c"
603 (("static const char compilation\\[21\\] =.*$")
605 "static const char compilation[21] = \""
606 (string-take (basename out) 20) "\";\n")))
608 ;; Make sure we don't retain a reference to the
610 (substitute* "malloc/mtrace.pl"
612 ;; The shebang can be omitted, because there's the
613 ;; "bilingual" eval/exec magic at the top of the file.
618 (inputs `(("static-bash" ,static-bash)))
620 ;; To build the manual, we need Texinfo and Perl. Gettext is needed to
621 ;; install the message catalogs, with 'msgfmt'.
622 (native-inputs `(("texinfo" ,texinfo)
624 ("gettext" ,gnu-gettext)))
627 ;; Search path for packages that provide locale data. This is useful
628 ;; primarily in build environments. Use 'GUIX_LOCPATH' rather than
629 ;; 'LOCPATH' to avoid interference with the host system's libc on foreign
631 (list (search-path-specification
632 (variable "GUIX_LOCPATH")
633 (files '("lib/locale")))))
635 (synopsis "The GNU C Library")
637 "Any Unix-like operating system needs a C library: the library which
638 defines the \"system calls\" and other basic facilities such as open, malloc,
641 The GNU C library is used as the C library in the GNU system and most systems
642 with the Linux kernel.")
644 (home-page "http://www.gnu.org/software/libc/")))
646 (define-public glibc-2.21
647 ;; The old libc, which we use mostly to build locale data in the old format
648 ;; (which the new libc can cope with.)
653 (inherit (package-source glibc))
654 (uri (string-append "mirror://gnu/glibc/glibc-"
658 "1f135546j34s9bfkydmx2nhh9vwxlx60jldi80zmsnln6wj3dsxf"))
659 (patches (search-patches "glibc-ldd-x86_64.patch"))))))
661 (define-public glibc-locales
664 (name "glibc-locales")
665 (source (origin (inherit (package-source glibc))
666 (patches (cons (search-patch "glibc-locales.patch")
667 (origin-patches (package-source glibc))))))
668 (synopsis "All the locales supported by the GNU C Library")
670 "This package provides all the locales supported by the GNU C Library,
671 more than 400 in total. To use them set the 'LOCPATH' environment variable to
672 the 'share/locale' sub-directory of this package.")
673 (outputs '("out")) ;110+ MiB
674 (native-search-paths '())
676 (let ((args `(#:tests? #f #:strip-binaries? #f
677 ,@(package-arguments glibc))))
678 (substitute-keyword-arguments args
682 (lambda* (#:key outputs #:allow-other-keys)
683 (zero? (system* "make" "localedata/install-locales"
684 "-j" (number->string (parallel-job-count)))))
685 (alist-delete 'install ,phases)))
686 ((#:configure-flags flags)
688 ;; Use $(libdir)/locale/X.Y as is the case by default.
689 (list (string-append "libc_cv_localedir="
690 (assoc-ref %outputs "out")
692 ,(package-version glibc))))))))))
694 (define-public glibc-utf8-locales
696 (name "glibc-utf8-locales")
697 (version (package-version glibc))
699 (build-system trivial-build-system)
701 `(#:modules ((guix build utils))
703 (use-modules (srfi srfi-1)
706 (let* ((libc (assoc-ref %build-inputs "glibc"))
707 (gzip (assoc-ref %build-inputs "gzip"))
708 (out (assoc-ref %outputs "out"))
709 (localedir (string-append out "/lib/locale/"
711 ;; 'localedef' needs 'gzip'.
712 (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
715 (every (lambda (locale)
717 ;; Use the "normalized codeset" by
718 ;; default--e.g., "en_US.utf8".
719 (string-append localedir "/" locale ".utf8"))
721 (and (zero? (system* "localedef" "--no-archive"
726 ;; For backward compatibility with Guix
727 ;; <= 0.8.3, add "xx_YY.UTF-8".
728 (symlink (string-append locale ".utf8")
729 (string-append localedir "/"
733 ;; These are the locales commonly used for
734 ;; tests---e.g., in Guile's i18n tests.
735 '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))))))
736 (inputs `(("glibc" ,glibc)
738 (synopsis "Small sample of UTF-8 locales")
740 "This package provides a small sample of UTF-8 locales mostly useful in
742 (home-page (package-home-page glibc))
743 (license (package-license glibc))))
751 (uri (string-append "mirror://gnu/which/which-"
755 "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
756 (build-system gnu-build-system)
757 (home-page "https://gnu.org/software/which/")
758 (synopsis "Find full path of shell commands")
760 "The which program finds the location of executables in PATH, with a
761 variety of options. It is an alternative to the shell \"type\" built-in
763 (license gpl3+))) ; some files are under GPLv2+
765 (define-public glibc/hurd
766 ;; The Hurd's libc variant.
767 (package (inherit glibc)
773 (url "git://git.sv.gnu.org/hurd/glibc")
774 (commit "cc94b3cfe65523f980359e5f0e93a26196bda1d3")))
777 "17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
778 (file-name (string-append name "-" version))
779 (patches (search-patches "glibc-hurd-extern-inline.patch"))))
781 ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
782 ;; so both should be propagated.
783 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
784 ("hurd-headers" ,hurd-headers)
785 ("hurd-minimal" ,hurd-minimal)))
787 `(,@(package-native-inputs glibc)
788 ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
791 ("libpthread" ,(origin
794 (url "git://git.sv.gnu.org/hurd/libpthread")
795 (commit "0ef7b75c4ba91b6660f0d3d8b51d14d25e3d5bfb")))
798 "031py18fls15z0wprni33mf762kg6fx8xqijppimhp83yp6ky3l3"))
799 (file-name "libpthread")))))
802 (substitute-keyword-arguments (package-arguments glibc)
803 ((#:configure-flags original-configure-flags)
804 `(append (list "--host=i686-pc-gnu"
806 ;; nscd fails to build for GNU/Hurd:
807 ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
810 (filter (lambda (flag)
811 (not (or (string-prefix? "--with-headers=" flag)
812 (string-prefix? "--enable-kernel=" flag))))
813 ;; Evaluate 'original-configure-flags' in a
814 ;; lexical environment that has a dummy
815 ;; "linux-headers" input, to prevent errors.
816 (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
818 ,original-configure-flags))))
821 'unpack 'prepare-libpthread
822 (lambda* (#:key inputs #:allow-other-keys)
823 (copy-recursively (assoc-ref inputs "libpthread") "libpthread")
825 (system* "patch" "--force" "-p1" "-i"
826 (assoc-ref inputs "patch/libpthread-patch"))
829 (synopsis "The GNU C Library (GNU Hurd variant)")
830 (supported-systems %hurd-systems)))
832 (define-public glibc/hurd-headers
833 (package (inherit glibc/hurd)
834 (name "glibc-hurd-headers")
836 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
837 ("hurd-headers" ,hurd-headers)))
839 (substitute-keyword-arguments (package-arguments glibc/hurd)
840 ;; We just pass the flags really needed to build the headers.
841 ((#:configure-flags _)
842 `(list "--enable-add-ons"
844 "--enable-obsolete-rpc"))
848 (lambda* (#:key outputs #:allow-other-keys)
849 (and (zero? (system* "make" "install-headers"))
851 ;; Make an empty stubs.h to work around not being able to
852 ;; produce a valid stubs.h and causing the build to fail. See
853 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
854 (let ((out (assoc-ref outputs "out")))
857 (string-append out "/include/gnu/stubs.h"))))))
864 'configure 'pre-configure
866 ;; Use the right 'pwd'.
867 (substitute* "configure"
868 (("/bin/pwd") "pwd")))
869 %standard-phases))))))))
871 (define-public tzdata
878 "http://www.iana.org/time-zones/repository/releases/tzdata"
882 "0qb1awqrn3215zd2jikpqnmkzrxwfjf0d3dw2xmnk4c40yzws8xr"))))
883 (build-system gnu-build-system)
886 #:make-flags (let ((out (assoc-ref %outputs "out"))
887 (tmp (getenv "TMPDIR")))
888 (list (string-append "TOPDIR=" out)
889 (string-append "TZDIR=" out "/share/zoneinfo")
891 ;; Discard zic, dump, and tzselect, already
892 ;; provided by glibc.
893 (string-append "ETCDIR=" tmp "/etc")
895 ;; Likewise for the C library routines.
896 (string-append "LIBDIR=" tmp "/lib")
897 (string-append "MANDIR=" tmp "/man")
901 #:modules ((guix build utils)
902 (guix build gnu-build-system)
907 (lambda* (#:key source inputs #:allow-other-keys)
908 (and (zero? (system* "tar" "xvf" source))
909 (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode")))))
911 'install 'post-install
912 (lambda* (#:key outputs #:allow-other-keys)
913 ;; Move data in the right place.
914 (let ((out (assoc-ref outputs "out")))
915 (copy-recursively (string-append out "/share/zoneinfo-posix")
916 (string-append out "/share/zoneinfo/posix"))
917 (copy-recursively (string-append out "/share/zoneinfo-leaps")
918 (string-append out "/share/zoneinfo/right"))
919 (delete-file-recursively (string-append out "/share/zoneinfo-posix"))
920 (delete-file-recursively (string-append out "/share/zoneinfo-leaps"))))
921 (alist-delete 'configure %standard-phases)))))
922 (inputs `(("tzcode" ,(origin
925 "http://www.iana.org/time-zones/repository/releases/tzcode"
929 "1i3y1kzjiz2j62c7vd4wf85983sqk9x9lg3473njvbdz4kph5r0q"))))))
930 (home-page "http://www.iana.org/time-zones")
931 (synopsis "Database of current and historical time zones")
932 (description "The Time Zone Database (often called tz or zoneinfo)
933 contains code and data that represent the history of local time for many
934 representative locations around the globe. It is updated periodically to
935 reflect changes made by political bodies to time zone boundaries, UTC offsets,
936 and daylight-saving rules.")
937 (license public-domain)))
939 (define-public (canonical-package package)
940 ;; Avoid circular dependency by lazily resolving 'commencement'.
941 (let* ((iface (resolve-interface '(gnu packages commencement)))
942 (proc (module-ref iface 'canonical-package)))
945 ;;; base.scm ends here