sync-descriptions: Improve output of proposed descriptions.
[jackhill/guix/guix.git] / gnu / packages / base.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
8fd6487e 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
722111ab 3;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
2f66e64c 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
e3ce5d70 6;;;
233e7676 7;;; This file is part of GNU Guix.
e3ce5d70 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
e3ce5d70
LC
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
e3ce5d70
LC
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
e3ce5d70 21
1ffa7090 22(define-module (gnu packages base)
c6d7e299 23 #:use-module ((guix licenses)
e789d9a8 24 #:select (gpl3+ lgpl2.0+ public-domain))
59a43334 25 #:use-module (gnu packages)
1ffa7090
LC
26 #:use-module (gnu packages acl)
27 #:use-module (gnu packages bash)
1ffa7090
LC
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages linux)
8fd6487e 32 #:use-module (gnu packages texinfo)
aa6b0d6b 33 #:use-module (gnu packages pkg-config)
e3ce5d70 34 #:use-module (guix packages)
87f5d366 35 #:use-module (guix download)
bdb36958 36 #:use-module (guix build-system gnu))
e3ce5d70
LC
37
38;;; Commentary:
39;;;
1722d680 40;;; Base packages of the Guix-based GNU user-land software distribution.
e3ce5d70
LC
41;;;
42;;; Code:
43
44(define-public hello
45 (package
46 (name "hello")
c3af0bf2 47 (version "2.9")
90c68be8 48 (source (origin
87f5d366 49 (method url-fetch)
0db342a5 50 (uri (string-append "mirror://gnu/hello/hello-" version
90c68be8 51 ".tar.gz"))
e3ce5d70 52 (sha256
c3af0bf2 53 (base32 "19qy37gkasc4csb1d3bdiz9snn8mir2p3aj0jgzmfv0r2hi7mfzc"))))
e3ce5d70 54 (build-system gnu-build-system)
f50d2669 55 (synopsis "Hello, GNU world: An example GNU package")
a22dc0c4
LC
56 (description
57 "GNU Hello prints the message \"Hello, world!\" and then exits. It
58serves as an example of standard GNU coding practices. As such, it supports
59command-line arguments, multiple languages, and so on.")
45753b65 60 (home-page "http://www.gnu.org/software/hello/")
4a44e743 61 (license gpl3+)))
d7672884 62
6794b278
LC
63(define-public grep
64 (package
65 (name "grep")
df142dd4 66 (version "2.20")
6794b278 67 (source (origin
87f5d366 68 (method url-fetch)
0db342a5 69 (uri (string-append "mirror://gnu/grep/grep-"
6794b278
LC
70 version ".tar.xz"))
71 (sha256
72 (base32
df142dd4 73 "0rcs0spsxdmh6yz8y4frkqp6f5iw19mdbdl9s2v6956hq0mlbbzh"))))
6794b278 74 (build-system gnu-build-system)
f50d2669 75 (synopsis "Print lines matching a pattern")
d45122f5 76 (description
a22dc0c4
LC
77 "grep is a tool for finding text inside files. Text is found by
78matching a pattern provided by the user in one or many files. The pattern
79c311b8
LC
79may be provided as a basic or extended regular expression, or as fixed
80strings. By default, the matching text is simply printed to the screen,
81however the output can be greatly customized to include, for example, line
82numbers. GNU grep offers many extensions over the standard utility,
83including, for example, recursive directory searching.")
4a44e743 84 (license gpl3+)
6794b278
LC
85 (home-page "http://www.gnu.org/software/grep/")))
86
8dcad9aa
LC
87(define-public sed
88 (package
89 (name "sed")
847e7725 90 (version "4.2.2")
8dcad9aa 91 (source (origin
87f5d366 92 (method url-fetch)
0db342a5 93 (uri (string-append "mirror://gnu/sed/sed-" version
8dcad9aa
LC
94 ".tar.bz2"))
95 (sha256
96 (base32
847e7725 97 "1myvrmh99jsvk7v3d7crm0gcrq51hmmm1r2kjyyci152in1x2j7h"))))
8dcad9aa 98 (build-system gnu-build-system)
f50d2669 99 (synopsis "Stream editor")
52b8e5fc 100 (arguments
c8c6bba5
LC
101 (if (%current-target-system)
102 '()
103 `(#:phases (alist-cons-before
104 'patch-source-shebangs 'patch-test-suite
105 (lambda* (#:key inputs #:allow-other-keys)
106 (let ((bash (assoc-ref inputs "bash")))
107 (patch-makefile-SHELL "testsuite/Makefile.tests")
108 (substitute* '("testsuite/bsd.sh"
109 "testsuite/bug-regex9.c")
110 (("/bin/sh")
111 (string-append bash "/bin/bash")))))
112 %standard-phases))))
d45122f5 113 (description
a22dc0c4
LC
114 "Sed is a non-interactive, text stream editor. It receives a text
115input from a file or from standard input and it then applies a series of text
116editing commands to the stream and prints its output to standard output. It
79c311b8
LC
117is often used for substituting text patterns in a stream. The GNU
118implementation offers several extensions over the standard utility.")
4a44e743 119 (license gpl3+)
8dcad9aa
LC
120 (home-page "http://www.gnu.org/software/sed/")))
121
85240322
LC
122(define-public tar
123 (package
124 (name "tar")
9ca8b5ac 125 (version "1.27.1")
85240322 126 (source (origin
87f5d366 127 (method url-fetch)
0db342a5 128 (uri (string-append "mirror://gnu/tar/tar-"
85240322
LC
129 version ".tar.bz2"))
130 (sha256
131 (base32
9ca8b5ac 132 "1iip0fk0wqhxb0jcwphz43r4fxkx1y7mznnhmlvr618jhp7b63wv"))))
85240322 133 (build-system gnu-build-system)
f50d2669 134 (synopsis "Managing tar archives")
d45122f5 135 (description
a22dc0c4
LC
136 "Tar provides the ability to create tar archives, as well as the
137ability to extract, update or list files in an existing archive. It is
138useful for combining many files into one larger file, while maintaining
139directory structure and file information such as permissions and
79c311b8
LC
140creation/modification dates. GNU tar offers many extensions over the
141standard utility.")
4a44e743 142 (license gpl3+)
85240322
LC
143 (home-page "http://www.gnu.org/software/tar/")))
144
fbeec3d9
LC
145(define-public patch
146 (package
147 (name "patch")
9369a02b 148 (version "2.7.1")
fbeec3d9 149 (source (origin
87f5d366 150 (method url-fetch)
0db342a5 151 (uri (string-append "mirror://gnu/patch/patch-"
fbeec3d9
LC
152 version ".tar.xz"))
153 (sha256
154 (base32
9369a02b 155 "1sqckf560pzwgniy00vcpdv2c9c11s4cmhlm14yqgg8avd3bl94i"))))
fbeec3d9
LC
156 (build-system gnu-build-system)
157 (native-inputs '()) ; FIXME: needs `ed' for the tests
158 (arguments
21c203a5
LC
159 '(#:tests? #f)
160 ;; TODO: When cross-compiling, add this:
161 ;; '(#:configure-flags '("ac_cv_func_strnlen_working=yes"))
162 )
f50d2669 163 (synopsis "Apply differences to originals, with optional backups")
d45122f5 164 (description
a22dc0c4 165 "Patch is a program that applies changes to files based on differences
79c311b8 166laid out as by the program \"diff\". The changes may be applied to one or more
a22dc0c4
LC
167files depending on the contents of the diff file. It accepts several
168different diff formats. It may also be used to revert previously applied
169differences.")
4a44e743 170 (license gpl3+)
fbeec3d9
LC
171 (home-page "http://savannah.gnu.org/projects/patch/")))
172
04a32ee5
LC
173(define-public diffutils
174 (package
175 (name "diffutils")
d83ae724 176 (version "3.3")
04a32ee5 177 (source (origin
87f5d366 178 (method url-fetch)
0db342a5 179 (uri (string-append "mirror://gnu/diffutils/diffutils-"
04a32ee5
LC
180 version ".tar.xz"))
181 (sha256
182 (base32
d83ae724 183 "1761vymxbp4wb5rzjvabhdkskk95pghnn67464byvzb5mfl8jpm2"))))
04a32ee5 184 (build-system gnu-build-system)
f50d2669 185 (synopsis "Comparing and merging files")
d45122f5 186 (description
79c311b8
LC
187 "GNU Diffutils is a package containing tools for finding the
188differences between files. The \"diff\" command is used to show how two files
189differ, while \"cmp\" shows the offsets and line numbers where they differ.
190\"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
a22dc0c4 191interactive means to merge two files.")
4a44e743 192 (license gpl3+)
04a32ee5
LC
193 (home-page "http://www.gnu.org/software/diffutils/")))
194
af5521ca
LC
195(define-public findutils
196 (package
197 (name "findutils")
198 (version "4.4.2")
199 (source (origin
87f5d366 200 (method url-fetch)
0db342a5 201 (uri (string-append "mirror://gnu/findutils/findutils-"
af5521ca
LC
202 version ".tar.gz"))
203 (sha256
204 (base32
de80b504
LC
205 "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3"))
206 (patches (list (search-patch "findutils-absolute-paths.patch")))))
af5521ca 207 (build-system gnu-build-system)
af5521ca 208 (arguments
de80b504
LC
209 ;; Work around cross-compilation failure.
210 ;; See <http://savannah.gnu.org/bugs/?27299#comment1>.
211 (if (%current-target-system)
212 '(#:configure-flags '("gl_cv_func_wcwidth_works=yes"))
213 '()))
f50d2669 214 (synopsis "Operating on files matching given criteria")
d45122f5 215 (description
a22dc0c4
LC
216 "Findutils supplies the basic file directory searching utilities of the
217GNU system. It consists of two primary searching utilities: \"find\"
218recursively searches for files in a directory according to given criteria and
219\"locate\" lists files in a database that match a query. Two auxiliary tools
79c311b8
LC
220are included: \"updatedb\" updates the file name database and \"xargs\" may be
221used to apply commands with arbitrarily long arguments.")
4a44e743 222 (license gpl3+)
af5521ca 223 (home-page "http://www.gnu.org/software/findutils/")))
2c957cd2
LC
224
225(define-public coreutils
226 (package
227 (name "coreutils")
8e92b6b5 228 (version "8.22")
2c957cd2 229 (source (origin
87f5d366 230 (method url-fetch)
0db342a5 231 (uri (string-append "mirror://gnu/coreutils/coreutils-"
2c957cd2
LC
232 version ".tar.xz"))
233 (sha256
234 (base32
7f31c71c 235 "04hjzzv434fb8ak3hh3dyhdvg3hqjjwvjmjxqzk1gh2jh6cr8gjv"))
ff3c0c1b
CR
236 (patches (list (search-patch "coreutils-dummy-man.patch")
237 ;; TODO: remove this patch for >= 8.23
238 (search-patch "coreutils-skip-nohup.patch")))))
2c957cd2 239 (build-system gnu-build-system)
de59af4d 240 (inputs `(("acl" ,acl) ; TODO: add SELinux
2c1dea85
LC
241 ("gmp" ,gmp)))
242 (native-inputs
243 ;; Perl is needed to run tests in native builds, and to run the bundled
7f31c71c
LC
244 ;; copy of help2man. However, don't pass it when cross-compiling since
245 ;; that would lead it to try to run programs to get their '--help' output
246 ;; for help2man.
247 (if (%current-target-system)
248 '()
249 `(("perl" ,perl))))
9bf62d9b 250 (outputs '("out" "debug"))
2c957cd2 251 (arguments
8ba8aeb7
LC
252 `(#:parallel-build? #f ; help2man may be called too early
253 #:phases (alist-cons-before
254 'build 'patch-shell-references
255 (lambda* (#:key inputs #:allow-other-keys)
256 (let ((bash (assoc-ref inputs "bash")))
b47b2b52
LC
257 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
258 ;; that tests pass, since /bin/sh isn't in the chroot.
259 (setenv "SHELL" (which "sh"))
260
261 (substitute* (find-files "gnulib-tests" "\\.c$")
8ba8aeb7
LC
262 (("/bin/sh")
263 (format #f "~a/bin/sh" bash)))
264 (substitute* (find-files "tests" "\\.sh$")
265 (("#!/bin/sh")
b47b2b52 266 (format #f "#!~a/bin/sh" bash)))))
56c092ce 267 %standard-phases)))
f50d2669 268 (synopsis "Core GNU utilities (file, text, shell)")
d45122f5 269 (description
79c311b8 270 "GNU Coreutils includes all of the basic command-line tools that are
a22dc0c4
LC
271expected in a POSIX system. These provide the basic file, shell and text
272manipulation functions of the GNU system. Most of these tools offer extended
273functionality beyond that which is outlined in the POSIX standard.")
4a44e743 274 (license gpl3+)
2c957cd2 275 (home-page "http://www.gnu.org/software/coreutils/")))
af5521ca 276
ab776865
LC
277(define-public gnu-make
278 (package
279 (name "make")
ed41d48e 280 (version "4.0")
ab776865 281 (source (origin
87f5d366 282 (method url-fetch)
0db342a5 283 (uri (string-append "mirror://gnu/make/make-" version
ab776865
LC
284 ".tar.bz2"))
285 (sha256
286 (base32
ed41d48e 287 "1nyvn8mknw0mf7727lprva3lisl1y0n03lvar342rrpdmz3qc1p6"))
de80b504 288 (patches (list (search-patch "make-impure-dirs.patch")))))
ab776865 289 (build-system gnu-build-system)
aa6b0d6b 290 (native-inputs `(("pkg-config", pkg-config))) ; to detect Guile
ed41d48e 291 (inputs `(("guile" ,guile-2.0)))
9bf62d9b 292 (outputs '("out" "debug"))
ea8fbbf2 293 (arguments
de80b504 294 '(#:phases (alist-cons-before
ea8fbbf2
LC
295 'build 'set-default-shell
296 (lambda* (#:key inputs #:allow-other-keys)
297 ;; Change the default shell from /bin/sh.
298 (let ((bash (assoc-ref inputs "bash")))
299 (substitute* "job.c"
300 (("default_shell\\[\\] =.*$")
301 (format #f "default_shell[] = \"~a/bin/bash\";\n"
302 bash)))))
303 %standard-phases)))
f50d2669 304 (synopsis "Remake files automatically")
d45122f5 305 (description
a22dc0c4
LC
306 "Make is a program that is used to control the production of
307executables or other files from their source files. The process is
308controlled from a Makefile, in which the developer specifies how each file is
309generated from its source. It has powerful dependency resolution and the
310ability to determine when files have to be regenerated after their sources
79c311b8 311change. GNU make offers many powerful extensions over the standard utility.")
4a44e743 312 (license gpl3+)
ab776865
LC
313 (home-page "http://www.gnu.org/software/make/")))
314
8f6201a3
LC
315(define-public binutils
316 (package
317 (name "binutils")
6c95f363 318 (version "2.24")
8f6201a3 319 (source (origin
87f5d366 320 (method url-fetch)
0db342a5 321 (uri (string-append "mirror://gnu/binutils/binutils-"
8f6201a3
LC
322 version ".tar.bz2"))
323 (sha256
324 (base32
6c95f363 325 "0ds1y7qa0xqihw4ihnsgg6bxanmb228r228ddvwzgrv4jszcbs75"))
2c1ceeac 326 (patches (list (search-patch "binutils-ld-new-dtags.patch")
6c95f363 327 (search-patch "binutils-loongson-workaround.patch")))))
8f6201a3
LC
328 (build-system gnu-build-system)
329
330 ;; TODO: Add dependency on zlib + those for Gold.
8f6201a3 331 (arguments
de80b504 332 `(#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
01d45404
LC
333 ;; on GCC when bootstrapping.
334 "LDFLAGS=-static-libgcc"
8f6201a3 335
01d45404 336 ;; Don't search under /usr/lib & co.
444c64b0
LC
337 "--with-lib-path=/no-ld-lib-path"
338
339 ;; Glibc 2.17 has a "comparison of unsigned
340 ;; expression >= 0 is always true" in wchar.h.
6c95f363
LC
341 "--disable-werror"
342
343 ;; Install BFD. It ends up in a hidden directory,
344 ;; but it's here.
cc0a1282
LC
345 "--enable-install-libbfd"
346
347 ;; Make sure 'ar' and 'ranlib' produce archives in a
348 ;; deterministic fashion.
349 "--enable-deterministic-archives")))
8f6201a3 350
f50d2669 351 (synopsis "Binary utilities: bfd gas gprof ld")
d45122f5 352 (description
a22dc0c4 353 "GNU Binutils is a collection of tools for working with binary files.
79c311b8
LC
354Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler. Other
355tools include programs to display binary profiling information, list the
356strings in a binary file, and utilities for working with archives. The \"bfd\"
357library for working with executable and object formats is also included.")
4a44e743 358 (license gpl3+)
8f6201a3
LC
359 (home-page "http://www.gnu.org/software/binutils/")))
360
7cdeac02
LC
361(define-public glibc
362 (package
363 (name "glibc")
99662b8d 364 (version "2.19")
7cdeac02 365 (source (origin
87f5d366 366 (method url-fetch)
0db342a5 367 (uri (string-append "mirror://gnu/glibc/glibc-"
7cdeac02
LC
368 version ".tar.xz"))
369 (sha256
370 (base32
99662b8d 371 "18m2dssd6ja5arxmdxinc90xvpqcsnqjfwmjl2as07j0i3srff9d"))
13990c73
LC
372 (snippet
373 ;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
374 ;; required on LFS distros to avoid loading the distro's libc.so
375 ;; instead of ours.
376 '(substitute* "sysdeps/unix/sysv/linux/configure"
377 (("use_ldconfig=yes")
378 "use_ldconfig=no")))
1faca892 379 (modules '((guix build utils)))
99662b8d 380 (patches (list (search-patch "glibc-ldd-x86_64.patch")))))
7cdeac02 381 (build-system gnu-build-system)
0a3da5b7
LC
382
383 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
384 ;; users should automatically pull Linux headers as well.
124b1767 385 (propagated-inputs `(("linux-headers" ,linux-libre-headers)))
0a3da5b7 386
7f614e49
LC
387 ;; Store the locales separately (~100 MiB). Note that "out" retains a
388 ;; reference to them anyway, so there's no space savings here.
389 ;; TODO: Eventually we may want to add a $LOCALE_ARCHIVE search path like
390 ;; Nixpkgs does.
9bf62d9b 391 (outputs '("out" "locales" "debug"))
7f614e49 392
7cdeac02 393 (arguments
8197c978 394 `(#:out-of-source? #t
7cdeac02
LC
395 #:configure-flags
396 (list "--enable-add-ons"
397 "--sysconfdir=/etc"
7f614e49
LC
398 (string-append "--localedir=" (assoc-ref %outputs "locales")
399 "/share/locale")
400
401 ;; `--localedir' is not honored, so work around it.
402 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
403 (string-append "libc_cv_localedir="
404 (assoc-ref %outputs "locales")
405 "/share/locale")
406
7cdeac02
LC
407 (string-append "--with-headers="
408 (assoc-ref %build-inputs "linux-headers")
409 "/include")
5f456680
LC
410
411 ;; The default is to assume a 2.4 Linux interface, but we'll
412 ;; always use something newer. See "kernel-features.h" in the
413 ;; GNU libc for details.
414 "--enable-kernel=2.6.30"
415
6e32f6c0 416 ;; Use our Bash instead of /bin/sh.
8cd8e97c 417 (string-append "BASH_SHELL="
6e32f6c0 418 (assoc-ref %build-inputs "bash")
8cd8e97c
LC
419 "/bin/bash")
420
421 ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
422 "libc_cv_ssp=no")
6e32f6c0 423
7cdeac02
LC
424 #:tests? #f ; XXX
425 #:phases (alist-cons-before
426 'configure 'pre-configure
6e32f6c0
LC
427 (lambda* (#:key inputs outputs #:allow-other-keys)
428 (let* ((out (assoc-ref outputs "out"))
429 (bin (string-append out "/bin")))
7cdeac02
LC
430 ;; Use `pwd', not `/bin/pwd'.
431 (substitute* "configure"
0a3da5b7 432 (("/bin/pwd") "pwd"))
7cdeac02
LC
433
434 ;; Install the rpc data base file under `$out/etc/rpc'.
8197c978 435 ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
7cdeac02
LC
436 (substitute* "sunrpc/Makefile"
437 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
438 (string-append out "/etc/rpc" suffix "\n"))
439 (("^install-others =.*$")
321b0996
LC
440 (string-append "install-others = " out "/etc/rpc\n")))
441
442 (substitute* "Makeconfig"
443 ;; According to
444 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
445 ;; linking against libgcc_s is not needed with GCC
446 ;; 4.7.1.
6e32f6c0
LC
447 ((" -lgcc_s") ""))
448
46866fad
LC
449 ;; Copy a statically-linked Bash in the output, with
450 ;; no references to other store paths.
6e32f6c0 451 (mkdir-p bin)
46866fad
LC
452 (copy-file (string-append (assoc-ref inputs "static-bash")
453 "/bin/bash")
6e32f6c0 454 (string-append bin "/bash"))
46866fad 455 (remove-store-references (string-append bin "/bash"))
6e32f6c0
LC
456 (chmod (string-append bin "/bash") #o555)
457
46866fad
LC
458 ;; Keep a symlink, for `patch-shebang' resolution.
459 (with-directory-excursion bin
460 (symlink "bash" "sh"))
461
6e32f6c0
LC
462 ;; Have `system' use that Bash.
463 (substitute* "sysdeps/posix/system.c"
464 (("#define[[:blank:]]+SHELL_PATH.*$")
465 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
466 out)))
467
468 ;; Same for `popen'.
469 (substitute* "libio/iopopen.c"
470 (("/bin/sh")
2ed6aa9e
LC
471 (string-append out "/bin/bash")))
472
473 ;; Make sure we don't retain a reference to the
474 ;; bootstrap Perl.
475 (substitute* "malloc/mtrace.pl"
476 (("^#!.*")
477 ;; The shebang can be omitted, because there's the
478 ;; "bilingual" eval/exec magic at the top of the file.
479 "")
480 (("exec @PERL@")
481 "exec perl"))))
7f614e49
LC
482 (alist-cons-after
483 'install 'install-locales
484 (lambda _
485 (zero? (system* "make" "localedata/install-locales")))
486 %standard-phases))))
487
de80b504 488 (inputs `(("static-bash" ,(static-package bash-light))))
8fd6487e
LC
489
490 ;; To build the manual, we need Texinfo and Perl.
491 (native-inputs `(("texinfo" ,texinfo)
492 ("perl" ,perl)))
493
d45122f5
LC
494 (synopsis "The GNU C Library")
495 (description
7cdeac02
LC
496 "Any Unix-like operating system needs a C library: the library which
497defines the \"system calls\" and other basic facilities such as open, malloc,
498printf, exit...
499
500The GNU C library is used as the C library in the GNU system and most systems
501with the Linux kernel.")
4a44e743 502 (license lgpl2.0+)
7cdeac02
LC
503 (home-page "http://www.gnu.org/software/libc/")))
504
e789d9a8
LC
505(define-public tzdata
506 (package
507 (name "tzdata")
2f66e64c 508 (version "2014a")
e789d9a8
LC
509 (source (origin
510 (method url-fetch)
511 (uri (string-append
512 "http://www.iana.org/time-zones/repository/releases/tzdata"
513 version ".tar.gz"))
514 (sha256
515 (base32
2f66e64c 516 "1cg843ajz4g16axpz56zvalwsbp1s764na2bk4fb44ayx162bzvw"))))
e789d9a8
LC
517 (build-system gnu-build-system)
518 (arguments
519 '(#:tests? #f
520 #:make-flags (let ((out (assoc-ref %outputs "out"))
521 (tmp (getenv "TMPDIR")))
522 (list (string-append "TOPDIR=" out)
523 (string-append "TZDIR=" out "/share/zoneinfo")
524
525 ;; Discard zic, dump, and tzselect, already
526 ;; provided by glibc.
527 (string-append "ETCDIR=" tmp "/etc")
528
529 ;; Likewise for the C library routines.
530 (string-append "LIBDIR=" tmp "/lib")
531 (string-append "MANDIR=" tmp "/man")
532
533 "AWK=awk"
534 "CC=gcc"))
535 #:modules ((guix build utils)
536 (guix build gnu-build-system)
537 (srfi srfi-1))
538 #:phases
539 (alist-replace
540 'unpack
c94d01ba
LC
541 (lambda* (#:key source inputs #:allow-other-keys)
542 (and (zero? (system* "tar" "xvf" source))
e789d9a8
LC
543 (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode")))))
544 (alist-cons-after
545 'install 'post-install
546 (lambda* (#:key outputs #:allow-other-keys)
547 ;; Move data in the right place.
548 (let ((out (assoc-ref outputs "out")))
549 (copy-recursively (string-append out "/share/zoneinfo-posix")
550 (string-append out "/share/zoneinfo/posix"))
551 (copy-recursively (string-append out "/share/zoneinfo-leaps")
552 (string-append out "/share/zoneinfo/right"))
553 (delete-file-recursively (string-append out "/share/zoneinfo-posix"))
554 (delete-file-recursively (string-append out "/share/zoneinfo-leaps"))))
555 (alist-delete 'configure %standard-phases)))))
556 (inputs `(("tzcode" ,(origin
557 (method url-fetch)
558 (uri (string-append
559 "http://www.iana.org/time-zones/repository/releases/tzcode"
560 version ".tar.gz"))
561 (sha256
562 (base32
2f66e64c 563 "1xfkqi1q8cnxqbv8azdj5pqlzhkjz6xag09f1z0s8rxi86jkpf85"))))))
e789d9a8
LC
564 (home-page "http://www.iana.org/time-zones")
565 (synopsis "Database of current and historical time zones")
566 (description "The Time Zone Database (often called tz or zoneinfo)
567contains code and data that represent the history of local time for many
568representative locations around the globe. It is updated periodically to
569reflect changes made by political bodies to time zone boundaries, UTC offsets,
570and daylight-saving rules.")
571 (license public-domain)))
572
bdb36958
LC
573(define-public (canonical-package package)
574 ;; Avoid circular dependency by lazily resolving 'commencement'.
575 (let* ((iface (resolve-interface '(gnu packages commencement)))
576 (proc (module-ref iface 'canonical-package)))
577 (proc package)))
571aa6cd 578
1722d680 579;;; base.scm ends here