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 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"))
86 (list (search-patch "grep-timing-sensitive-test.patch")))))
87 (build-system gnu-build-system)
88 (native-inputs `(("perl" ,perl))) ;some of the tests require it
89 (synopsis "Print lines matching a pattern")
91 "grep is a tool for finding text inside files. Text is found by
92 matching a pattern provided by the user in one or many files. The pattern
93 may be provided as a basic or extended regular expression, or as fixed
94 strings. By default, the matching text is simply printed to the screen,
95 however the output can be greatly customized to include, for example, line
96 numbers. GNU grep offers many extensions over the standard utility,
97 including, for example, recursive directory searching.")
99 (home-page "http://www.gnu.org/software/grep/")))
107 (uri (string-append "mirror://gnu/sed/sed-" version
111 "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"))
112 (patches (list (search-patch "sed-hurd-path-max.patch")))))
113 (build-system gnu-build-system)
114 (synopsis "Stream editor")
116 (if (%current-target-system)
118 `(#:phases (alist-cons-before
119 'patch-source-shebangs 'patch-test-suite
120 (lambda* (#:key inputs #:allow-other-keys)
121 (let ((bash (assoc-ref inputs "bash")))
122 (patch-makefile-SHELL "testsuite/Makefile.tests")
123 (substitute* '("testsuite/bsd.sh"
124 "testsuite/bug-regex9.c")
126 (string-append bash "/bin/bash")))))
129 "Sed is a non-interactive, text stream editor. It receives a text
130 input from a file or from standard input and it then applies a series of text
131 editing commands to the stream and prints its output to standard output. It
132 is often used for substituting text patterns in a stream. The GNU
133 implementation offers several extensions over the standard utility.")
135 (home-page "http://www.gnu.org/software/sed/")))
143 (uri (string-append "mirror://gnu/tar/tar-"
147 "1wi2zwm4c9r3h3b8y4w0nm0qq897kn8kyj9k22ba0iqvxj48vvk4"))
148 (patches (map search-patch
149 '("tar-d_ino_in_dirent-fix.patch"
150 "tar-skip-unreliable-tests.patch")))))
151 (build-system gnu-build-system)
152 (synopsis "Managing tar archives")
154 "Tar provides the ability to create tar archives, as well as the
155 ability to extract, update or list files in an existing archive. It is
156 useful for combining many files into one larger file, while maintaining
157 directory structure and file information such as permissions and
158 creation/modification dates. GNU tar offers many extensions over the
161 (home-page "http://www.gnu.org/software/tar/")))
169 (uri (string-append "mirror://gnu/patch/patch-"
173 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
174 (patches (list (search-patch "patch-hurd-path-max.patch")))))
175 (build-system gnu-build-system)
176 (native-inputs `(("ed", ed)))
177 (synopsis "Apply differences to originals, with optional backups")
179 "Patch is a program that applies changes to files based on differences
180 laid out as by the program \"diff\". The changes may be applied to one or more
181 files depending on the contents of the diff file. It accepts several
182 different diff formats. It may also be used to revert previously applied
185 (home-page "http://savannah.gnu.org/projects/patch/")))
187 (define-public diffutils
193 (uri (string-append "mirror://gnu/diffutils/diffutils-"
197 "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2"))))
198 (build-system gnu-build-system)
199 (synopsis "Comparing and merging files")
201 "GNU Diffutils is a package containing tools for finding the
202 differences between files. The \"diff\" command is used to show how two files
203 differ, while \"cmp\" shows the offsets and line numbers where they differ.
204 \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
205 interactive means to merge two files.")
207 (home-page "http://www.gnu.org/software/diffutils/")))
209 (define-public findutils
215 (uri (string-append "mirror://gnu/findutils/findutils-"
219 "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y"))
220 (patches (map search-patch
221 '("findutils-localstatedir.patch"
222 "findutils-test-xargs.patch")))))
223 (build-system gnu-build-system)
225 `(#:configure-flags (list
226 ;; Tell 'updatedb' to write to /var.
227 "--localstatedir=/var"
229 ;; Work around cross-compilation failure. See
230 ;; <http://savannah.gnu.org/bugs/?27299#comment1>.
231 ,@(if (%current-target-system)
232 '("gl_cv_func_wcwidth_works=yes")
234 (synopsis "Operating on files matching given criteria")
236 "Findutils supplies the basic file directory searching utilities of the
237 GNU system. It consists of two primary searching utilities: \"find\"
238 recursively searches for files in a directory according to given criteria and
239 \"locate\" lists files in a database that match a query. Two auxiliary tools
240 are included: \"updatedb\" updates the file name database and \"xargs\" may be
241 used to apply commands with arbitrarily long arguments.")
243 (home-page "http://www.gnu.org/software/findutils/")))
245 (define-public coreutils
251 (uri (string-append "mirror://gnu/coreutils/coreutils-"
255 "0w11jw3fb5sslf0f72kxy7llxgk1ia3a6bcw0c9kmvxrlj355mx2"))
259 (uri "http://git.savannah.gnu.org/cgit/coreutils.git/\
260 patch/?id=3ba68f9e64fa2eb8af22d510437a0c6441feb5e0")
263 "1dnlszhc8lihhg801i9sz896mlrgfsjfcz62636prb27k5hmixqz"))
264 (file-name "coreutils-tail-inotify-race.patch"))))))
265 (build-system gnu-build-system)
266 (inputs `(("acl" ,acl) ; TODO: add SELinux
267 ("gmp" ,gmp) ;bignums in 'expr', yay!
269 ;; Drop the dependency on libcap when cross-compiling since it's
270 ;; not quite cross-compilable.
271 ,@(if (%current-target-system)
273 `(("libcap" ,libcap))))) ;capability support is 'ls', etc.
275 ;; Perl is needed to run tests in native builds, and to run the bundled
276 ;; copy of help2man. However, don't pass it when cross-compiling since
277 ;; that would lead it to try to run programs to get their '--help' output
279 (if (%current-target-system)
282 (outputs '("out" "debug"))
284 `(#:parallel-build? #f ; help2man may be called too early
285 #:phases (alist-cons-before
286 'build 'patch-shell-references
287 (lambda* (#:key inputs #:allow-other-keys)
288 (let ((bash (assoc-ref inputs "bash")))
289 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
290 ;; that tests pass, since /bin/sh isn't in the chroot.
291 (setenv "SHELL" (which "sh"))
293 (substitute* (find-files "gnulib-tests" "\\.c$")
295 (format #f "~a/bin/sh" bash)))
296 (substitute* (find-files "tests" "\\.sh$")
298 (format #f "#!~a/bin/sh" bash)))))
300 (synopsis "Core GNU utilities (file, text, shell)")
302 "GNU Coreutils includes all of the basic command-line tools that are
303 expected in a POSIX system. These provide the basic file, shell and text
304 manipulation functions of the GNU system. Most of these tools offer extended
305 functionality beyond that which is outlined in the POSIX standard.")
307 (home-page "http://www.gnu.org/software/coreutils/")))
309 (define-public coreutils-minimal
310 ;; Coreutils without its optional dependencies.
313 (name "coreutils-minimal")
317 (define-public gnu-make
323 (uri (string-append "mirror://gnu/make/make-" version
327 "19gwwhik3wdwn0r42b7xcihkbxvjl9r2bdal8nifc3k5i4rn3iqb"))
328 (patches (list (search-patch "make-impure-dirs.patch")))))
329 (build-system gnu-build-system)
330 (native-inputs `(("pkg-config", pkg-config))) ; to detect Guile
331 (inputs `(("guile" ,guile-2.0)))
332 (outputs '("out" "debug"))
334 '(#:phases (alist-cons-before
335 'build 'set-default-shell
336 (lambda* (#:key inputs #:allow-other-keys)
337 ;; Change the default shell from /bin/sh.
338 (let ((bash (assoc-ref inputs "bash")))
340 (("default_shell =.*$")
341 (format #f "default_shell = \"~a/bin/bash\";\n"
344 (synopsis "Remake files automatically")
346 "Make is a program that is used to control the production of
347 executables or other files from their source files. The process is
348 controlled from a Makefile, in which the developer specifies how each file is
349 generated from its source. It has powerful dependency resolution and the
350 ability to determine when files have to be regenerated after their sources
351 change. GNU make offers many powerful extensions over the standard utility.")
353 (home-page "http://www.gnu.org/software/make/")))
355 (define-public binutils
361 (uri (string-append "mirror://gnu/binutils/binutils-"
365 "08lzmhidzc16af1zbx34f8cy4z7mzrswpdbhrb8shy3xxpflmcdm"))
366 (patches (list (search-patch "binutils-ld-new-dtags.patch")
367 (search-patch "binutils-loongson-workaround.patch")))))
368 (build-system gnu-build-system)
370 ;; TODO: Add dependency on zlib + those for Gold.
372 `(#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
373 ;; on GCC when bootstrapping.
374 "LDFLAGS=-static-libgcc"
376 ;; Don't search under /usr/lib & co.
377 "--with-lib-path=/no-ld-lib-path"
379 ;; Glibc 2.17 has a "comparison of unsigned
380 ;; expression >= 0 is always true" in wchar.h.
383 ;; Install BFD. It ends up in a hidden directory,
385 "--enable-install-libbfd"
387 ;; Make sure 'ar' and 'ranlib' produce archives in a
388 ;; deterministic fashion.
389 "--enable-deterministic-archives")))
391 (synopsis "Binary utilities: bfd gas gprof ld")
393 "GNU Binutils is a collection of tools for working with binary files.
394 Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
395 Other tools include programs to display binary profiling information, list
396 the strings in a binary file, and utilities for working with archives. The
397 \"bfd\" library for working with executable and object formats is also
400 (home-page "http://www.gnu.org/software/binutils/")))
402 (define* (make-ld-wrapper name #:key binutils
403 (guile (canonical-package guile-2.0))
404 (bash (canonical-package bash)) target
405 (guile-for-build guile))
406 "Return a package called NAME that contains a wrapper for the 'ld' program
407 of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. When
408 TARGET is not #f, make a wrapper for the cross-linker for TARGET, called
409 'TARGET-ld'. The wrapper uses GUILE and BASH."
414 (build-system trivial-build-system)
415 (inputs `(("binutils" ,binutils)
418 ("wrapper" ,(search-path %load-path
419 "gnu/packages/ld-wrapper.in"))))
421 `(#:guile ,guile-for-build
422 #:modules ((guix build utils))
424 (use-modules (guix build utils)
425 (system base compile))
427 (let* ((out (assoc-ref %outputs "out"))
428 (bin (string-append out "/bin"))
430 `(string-append bin "/" ,target "-ld")
431 '(string-append bin "/ld")))
432 (go (string-append ld ".go")))
434 (setvbuf (current-output-port) _IOLBF)
435 (format #t "building ~s/bin/ld wrapper in ~s~%"
436 (assoc-ref %build-inputs "binutils")
440 (copy-file (assoc-ref %build-inputs "wrapper") ld)
445 (string-append (assoc-ref %build-inputs "guile")
448 (string-append (assoc-ref %build-inputs "bash")
451 (string-append (assoc-ref %build-inputs "binutils")
453 (string-append "/bin/"
457 (compile-file ld #:output-file go)))))
458 (synopsis "The linker wrapper")
460 "The linker wrapper (or 'ld-wrapper') wraps the linker to add any
461 missing '-rpath' flags, and to detect any misuse of libraries outside of the
463 (home-page "http://www.gnu.org/software/guix/")
466 (export make-ld-wrapper)
474 (uri (string-append "mirror://gnu/glibc/glibc-"
478 "0j49682pm2nh4qbdw35bas82p1pgfnz4d2l7iwfyzvrvj0318wzb"))
480 ;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
481 ;; required on LFS distros to avoid loading the distro's libc.so
483 '(substitute* "sysdeps/unix/sysv/linux/configure"
484 (("use_ldconfig=yes")
486 (modules '((guix build utils)))
487 (patches (map search-patch
488 '("glibc-ldd-x86_64.patch"
489 "glibc-locale-incompatibility.patch"
490 "glibc-versioned-locpath.patch"
491 "glibc-o-largefile.patch")))))
492 (build-system gnu-build-system)
494 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
495 ;; users should automatically pull Linux headers as well.
496 (propagated-inputs `(("linux-headers" ,linux-libre-headers)))
498 (outputs '("out" "debug"))
501 `(#:out-of-source? #t
503 ;; In version 2.21, there a race in the 'elf' directory, see
504 ;; <http://lists.gnu.org/archive/html/guix-devel/2015-02/msg00709.html>.
507 ;; The libraries have an empty RUNPATH, but some, such as the versioned
508 ;; libraries (libdl-2.22.so, etc.) have ld.so marked as NEEDED. Since
509 ;; these libraries are always going to be found anyway, just skip
511 #:validate-runpath? #f
514 (list "--enable-add-ons"
517 ;; Installing a locale archive with all the locales is to
518 ;; expensive (~100 MiB), so we rely on users to install the
519 ;; locales they really want.
521 ;; Set the default locale path. In practice, $LOCPATH may be
522 ;; defined to point whatever locales users want. However, setuid
523 ;; binaries don't honor $LOCPATH, so they'll instead look into
524 ;; $libc_cv_localedir; we choose /run/current-system/locale/X.Y,
525 ;; with the idea that it is going to be populated by the sysadmin.
526 ;; The "X.Y" sub-directory is because locale data formats are
527 ;; incompatible across libc versions; see
528 ;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
530 ;; `--localedir' is not honored, so work around it.
531 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
532 (string-append "libc_cv_localedir=/run/current-system/locale/"
535 (string-append "--with-headers="
536 (assoc-ref %build-inputs "linux-headers")
539 ;; This is the default for most architectures as of GNU libc 2.21,
540 ;; but we specify it explicitly for clarity and consistency. See
541 ;; "kernel-features.h" in the GNU libc for details.
542 "--enable-kernel=2.6.32"
544 ;; Use our Bash instead of /bin/sh.
545 (string-append "BASH_SHELL="
546 (assoc-ref %build-inputs "bash")
549 ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
553 #:phases (modify-phases %standard-phases
555 'configure 'pre-configure
556 (lambda* (#:key inputs native-inputs outputs
558 (let* ((out (assoc-ref outputs "out"))
559 (bin (string-append out "/bin"))
560 ;; FIXME: Normally we would look it up only in INPUTS
561 ;; but cross-base uses it as a native input.
562 (bash (or (assoc-ref inputs "static-bash")
563 (assoc-ref native-inputs "static-bash"))))
564 ;; Use `pwd', not `/bin/pwd'.
565 (substitute* "configure"
566 (("/bin/pwd") "pwd"))
568 ;; Install the rpc data base file under `$out/etc/rpc'.
569 ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
570 (substitute* "sunrpc/Makefile"
571 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
572 (string-append out "/etc/rpc" suffix "\n"))
573 (("^install-others =.*$")
574 (string-append "install-others = " out "/etc/rpc\n")))
576 (substitute* "Makeconfig"
578 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
579 ;; linking against libgcc_s is not needed with GCC
583 ;; Have `system' use that Bash.
584 (substitute* "sysdeps/posix/system.c"
585 (("#define[[:blank:]]+SHELL_PATH.*$")
586 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
590 (substitute* "libio/iopopen.c"
592 (string-append bash "/bin/bash")))
594 ;; Same for the shell used by the 'exec' functions for
595 ;; scripts that lack a shebang.
596 (substitute* (find-files "." "^paths\\.h$")
597 (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
598 (string-append "#define _PATH_BSHELL \""
599 bash "/bin/bash\"\n")))
601 ;; Nscd uses __DATE__ and __TIME__ to create a string to
602 ;; make sure the client and server come from the same
603 ;; libc. Use something deterministic instead.
604 (substitute* "nscd/nscd_stat.c"
605 (("static const char compilation\\[21\\] =.*$")
607 "static const char compilation[21] = \""
608 (string-take (basename out) 20) "\";\n")))
610 ;; Make sure we don't retain a reference to the
612 (substitute* "malloc/mtrace.pl"
614 ;; The shebang can be omitted, because there's the
615 ;; "bilingual" eval/exec magic at the top of the file.
620 (inputs `(("static-bash" ,static-bash)))
622 ;; To build the manual, we need Texinfo and Perl. Gettext is needed to
623 ;; install the message catalogs, with 'msgfmt'.
624 (native-inputs `(("texinfo" ,texinfo)
626 ("gettext" ,gnu-gettext)))
629 ;; Search path for packages that provide locale data. This is useful
630 ;; primarily in build environments. Use 'GUIX_LOCPATH' rather than
631 ;; 'LOCPATH' to avoid interference with the host system's libc on foreign
633 (list (search-path-specification
634 (variable "GUIX_LOCPATH")
635 (files '("lib/locale")))))
637 (synopsis "The GNU C Library")
639 "Any Unix-like operating system needs a C library: the library which
640 defines the \"system calls\" and other basic facilities such as open, malloc,
643 The GNU C library is used as the C library in the GNU system and most systems
644 with the Linux kernel.")
646 (home-page "http://www.gnu.org/software/libc/")))
648 (define-public glibc-2.21
649 ;; The old libc, which we use mostly to build locale data in the old format
650 ;; (which the new libc can cope with.)
655 (inherit (package-source glibc))
656 (uri (string-append "mirror://gnu/glibc/glibc-"
660 "1f135546j34s9bfkydmx2nhh9vwxlx60jldi80zmsnln6wj3dsxf"))
661 (patches (list (search-patch "glibc-ldd-x86_64.patch")))))))
663 (define-public glibc-locales
666 (name "glibc-locales")
667 (source (origin (inherit (package-source glibc))
668 (patches (cons (search-patch "glibc-locales.patch")
669 (origin-patches (package-source glibc))))))
670 (synopsis "All the locales supported by the GNU C Library")
672 "This package provides all the locales supported by the GNU C Library,
673 more than 400 in total. To use them set the 'LOCPATH' environment variable to
674 the 'share/locale' sub-directory of this package.")
675 (outputs '("out")) ;110+ MiB
676 (native-search-paths '())
678 (let ((args `(#:tests? #f #:strip-binaries? #f
679 ,@(package-arguments glibc))))
680 (substitute-keyword-arguments args
684 (lambda* (#:key outputs #:allow-other-keys)
685 (zero? (system* "make" "localedata/install-locales"
686 "-j" (number->string (parallel-job-count)))))
687 (alist-delete 'install ,phases)))
688 ((#:configure-flags flags)
690 ;; Use $(libdir)/locale/X.Y as is the case by default.
691 (list (string-append "libc_cv_localedir="
692 (assoc-ref %outputs "out")
694 ,(package-version glibc))))))))))
696 (define-public glibc-utf8-locales
698 (name "glibc-utf8-locales")
699 (version (package-version glibc))
701 (build-system trivial-build-system)
703 `(#:modules ((guix build utils))
705 (use-modules (srfi srfi-1)
708 (let* ((libc (assoc-ref %build-inputs "glibc"))
709 (gzip (assoc-ref %build-inputs "gzip"))
710 (out (assoc-ref %outputs "out"))
711 (localedir (string-append out "/lib/locale/"
713 ;; 'localedef' needs 'gzip'.
714 (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
717 (every (lambda (locale)
719 ;; Use the "normalized codeset" by
720 ;; default--e.g., "en_US.utf8".
721 (string-append localedir "/" locale ".utf8"))
723 (and (zero? (system* "localedef" "--no-archive"
728 ;; For backward compatibility with Guix
729 ;; <= 0.8.3, add "xx_YY.UTF-8".
730 (symlink (string-append locale ".utf8")
731 (string-append localedir "/"
735 ;; These are the locales commonly used for
736 ;; tests---e.g., in Guile's i18n tests.
737 '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))))))
738 (inputs `(("glibc" ,glibc)
740 (synopsis "Small sample of UTF-8 locales")
742 "This package provides a small sample of UTF-8 locales mostly useful in
744 (home-page (package-home-page glibc))
745 (license (package-license glibc))))
753 (uri (string-append "mirror://gnu/which/which-"
757 "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
758 (build-system gnu-build-system)
759 (home-page "https://gnu.org/software/which/")
760 (synopsis "Find full path of shell commands")
762 "The which program finds the location of executables in PATH, with a
763 variety of options. It is an alternative to the shell \"type\" built-in
765 (license gpl3+))) ; some files are under GPLv2+
767 (define-public glibc/hurd
768 ;; The Hurd's libc variant.
769 (package (inherit glibc)
775 (url "git://git.sv.gnu.org/hurd/glibc")
776 (commit "cc94b3cfe65523f980359e5f0e93a26196bda1d3")))
779 "17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
780 (file-name (string-append name "-" version))
781 (patches (map search-patch
782 '("glibc-hurd-extern-inline.patch")))))
784 ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
785 ;; so both should be propagated.
786 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
787 ("hurd-headers" ,hurd-headers)
788 ("hurd-minimal" ,hurd-minimal)))
790 `(,@(package-native-inputs glibc)
791 ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
794 ("libpthread" ,(origin
797 (url "git://git.sv.gnu.org/hurd/libpthread")
798 (commit "0ef7b75c4ba91b6660f0d3d8b51d14d25e3d5bfb")))
801 "031py18fls15z0wprni33mf762kg6fx8xqijppimhp83yp6ky3l3"))
802 (file-name "libpthread")))))
805 (substitute-keyword-arguments (package-arguments glibc)
806 ((#:configure-flags original-configure-flags)
807 `(append (list "--host=i686-pc-gnu"
809 ;; nscd fails to build for GNU/Hurd:
810 ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
813 (filter (lambda (flag)
814 (not (or (string-prefix? "--with-headers=" flag)
815 (string-prefix? "--enable-kernel=" flag))))
816 ;; Evaluate 'original-configure-flags' in a
817 ;; lexical environment that has a dummy
818 ;; "linux-headers" input, to prevent errors.
819 (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
821 ,original-configure-flags))))
824 'unpack 'prepare-libpthread
825 (lambda* (#:key inputs #:allow-other-keys)
826 (copy-recursively (assoc-ref inputs "libpthread") "libpthread")
828 (system* "patch" "--force" "-p1" "-i"
829 (assoc-ref inputs "patch/libpthread-patch"))
832 (synopsis "The GNU C Library (GNU Hurd variant)")
833 (supported-systems %hurd-systems)))
835 (define-public glibc/hurd-headers
836 (package (inherit glibc/hurd)
837 (name "glibc-hurd-headers")
839 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
840 ("hurd-headers" ,hurd-headers)))
842 (substitute-keyword-arguments (package-arguments glibc/hurd)
843 ;; We just pass the flags really needed to build the headers.
844 ((#:configure-flags _)
845 `(list "--enable-add-ons"
847 "--enable-obsolete-rpc"))
851 (lambda* (#:key outputs #:allow-other-keys)
852 (and (zero? (system* "make" "install-headers"))
854 ;; Make an empty stubs.h to work around not being able to
855 ;; produce a valid stubs.h and causing the build to fail. See
856 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
857 (let ((out (assoc-ref outputs "out")))
860 (string-append out "/include/gnu/stubs.h"))))))
867 'configure 'pre-configure
869 ;; Use the right 'pwd'.
870 (substitute* "configure"
871 (("/bin/pwd") "pwd")))
872 %standard-phases))))))))
874 (define-public tzdata
881 "http://www.iana.org/time-zones/repository/releases/tzdata"
885 "0qb1awqrn3215zd2jikpqnmkzrxwfjf0d3dw2xmnk4c40yzws8xr"))))
886 (build-system gnu-build-system)
889 #:make-flags (let ((out (assoc-ref %outputs "out"))
890 (tmp (getenv "TMPDIR")))
891 (list (string-append "TOPDIR=" out)
892 (string-append "TZDIR=" out "/share/zoneinfo")
894 ;; Discard zic, dump, and tzselect, already
895 ;; provided by glibc.
896 (string-append "ETCDIR=" tmp "/etc")
898 ;; Likewise for the C library routines.
899 (string-append "LIBDIR=" tmp "/lib")
900 (string-append "MANDIR=" tmp "/man")
904 #:modules ((guix build utils)
905 (guix build gnu-build-system)
910 (lambda* (#:key source inputs #:allow-other-keys)
911 (and (zero? (system* "tar" "xvf" source))
912 (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode")))))
914 'install 'post-install
915 (lambda* (#:key outputs #:allow-other-keys)
916 ;; Move data in the right place.
917 (let ((out (assoc-ref outputs "out")))
918 (copy-recursively (string-append out "/share/zoneinfo-posix")
919 (string-append out "/share/zoneinfo/posix"))
920 (copy-recursively (string-append out "/share/zoneinfo-leaps")
921 (string-append out "/share/zoneinfo/right"))
922 (delete-file-recursively (string-append out "/share/zoneinfo-posix"))
923 (delete-file-recursively (string-append out "/share/zoneinfo-leaps"))))
924 (alist-delete 'configure %standard-phases)))))
925 (inputs `(("tzcode" ,(origin
928 "http://www.iana.org/time-zones/repository/releases/tzcode"
932 "1i3y1kzjiz2j62c7vd4wf85983sqk9x9lg3473njvbdz4kph5r0q"))))))
933 (home-page "http://www.iana.org/time-zones")
934 (synopsis "Database of current and historical time zones")
935 (description "The Time Zone Database (often called tz or zoneinfo)
936 contains code and data that represent the history of local time for many
937 representative locations around the globe. It is updated periodically to
938 reflect changes made by political bodies to time zone boundaries, UTC offsets,
939 and daylight-saving rules.")
940 (license public-domain)))
942 (define-public (canonical-package package)
943 ;; Avoid circular dependency by lazily resolving 'commencement'.
944 (let* ((iface (resolve-interface '(gnu packages commencement)))
945 (proc (module-ref iface 'canonical-package)))
948 ;;; base.scm ends here