Merge remote-tracking branch 'origin/master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / base.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
10 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
11 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages base)
30 #:use-module ((guix licenses)
31 #:select (gpl3+ lgpl2.0+ lgpl3+ public-domain))
32 #:use-module (gnu packages)
33 #:use-module (gnu packages acl)
34 #:use-module (gnu packages bash)
35 #:use-module (gnu packages ed)
36 #:use-module (gnu packages guile)
37 #:use-module (gnu packages multiprecision)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages linux)
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages hurd)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages gettext)
45 #:use-module (guix utils)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system trivial)
51 #:use-module (ice-9 match)
52 #:export (glibc
53 libiconv-if-needed))
54
55 ;;; Commentary:
56 ;;;
57 ;;; Base packages of the Guix-based GNU user-land software distribution.
58 ;;;
59 ;;; Code:
60
61 (define-public hello
62 (package
63 (name "hello")
64 (version "2.10")
65 (source (origin
66 (method url-fetch)
67 (uri (string-append "mirror://gnu/hello/hello-" version
68 ".tar.gz"))
69 (sha256
70 (base32
71 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"))))
72 (build-system gnu-build-system)
73 (synopsis "Hello, GNU world: An example GNU package")
74 (description
75 "GNU Hello prints the message \"Hello, world!\" and then exits. It
76 serves as an example of standard GNU coding practices. As such, it supports
77 command-line arguments, multiple languages, and so on.")
78 (home-page "https://www.gnu.org/software/hello/")
79 (license gpl3+)))
80
81 (define-public grep
82 (package
83 (name "grep")
84 (version "3.1")
85 (source (origin
86 (method url-fetch)
87 (uri (string-append "mirror://gnu/grep/grep-"
88 version ".tar.xz"))
89 (sha256
90 (base32
91 "0zm0ywmyz9g8vn1plw14mn8kj74yipx5qsljndbyfgmvndx5qqnv"))
92 (patches (search-patches "grep-timing-sensitive-test.patch"))))
93 (build-system gnu-build-system)
94 (native-inputs `(("perl" ,perl))) ;some of the tests require it
95 (arguments
96 `(#:phases
97 (modify-phases %standard-phases
98 (add-after 'install 'fix-egrep-and-fgrep
99 ;; Patch 'egrep' and 'fgrep' to execute 'grep' via its
100 ;; absolute file name instead of searching for it in $PATH.
101 (lambda* (#:key outputs #:allow-other-keys)
102 (let* ((out (assoc-ref outputs "out"))
103 (bin (string-append out "/bin")))
104 (substitute* (list (string-append bin "/egrep")
105 (string-append bin "/fgrep"))
106 (("^exec grep")
107 (string-append "exec " bin "/grep")))
108 #t))))))
109 (synopsis "Print lines matching a pattern")
110 (description
111 "grep is a tool for finding text inside files. Text is found by
112 matching a pattern provided by the user in one or many files. The pattern
113 may be provided as a basic or extended regular expression, or as fixed
114 strings. By default, the matching text is simply printed to the screen,
115 however the output can be greatly customized to include, for example, line
116 numbers. GNU grep offers many extensions over the standard utility,
117 including, for example, recursive directory searching.")
118 (license gpl3+)
119 (home-page "https://www.gnu.org/software/grep/")))
120
121 (define-public sed
122 (package
123 (name "sed")
124 (version "4.4")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/sed/sed-" version
128 ".tar.xz"))
129 (sha256
130 (base32
131 "0fv88bcnraixc8jvpacvxshi30p5x9m7yb8ns1hfv07hmb2ypmnb"))))
132 (build-system gnu-build-system)
133 (synopsis "Stream editor")
134 (arguments
135 `(#:phases
136 (modify-phases %standard-phases
137 (add-after 'unpack 'dont-rebuild-sed.1
138 (lambda _
139 ;; Make sure we do not attempt to rebuild 'doc/sed.1', which does
140 ;; not work when cross-compiling because we cannot run 'sed'.
141 ;; This is fixed upstream as commit a0a25e3.
142 (substitute* "Makefile.in"
143 (("^doc/sed\\.1:.*")
144 "doc/sed.1:\n"))
145 #t))
146 (add-before 'patch-source-shebangs 'patch-test-suite
147 (lambda* (#:key inputs #:allow-other-keys)
148 (patch-makefile-SHELL "testsuite/Makefile.tests")
149 (substitute* '("testsuite/bsd.sh"
150 "testsuite/bug-regex9.c")
151 (("/bin/sh")
152 (which "sh")))
153 #t)))))
154 (description
155 "Sed is a non-interactive, text stream editor. It receives a text
156 input from a file or from standard input and it then applies a series of text
157 editing commands to the stream and prints its output to standard output. It
158 is often used for substituting text patterns in a stream. The GNU
159 implementation offers several extensions over the standard utility.")
160 (license gpl3+)
161 (home-page "https://www.gnu.org/software/sed/")))
162
163 (define-public tar
164 (package
165 (name "tar")
166 (version "1.29")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "mirror://gnu/tar/tar-"
170 version ".tar.xz"))
171 (sha256
172 (base32
173 "097hx7sbzp8qirl4m930lw84kn0wmxhmq7v1qpra3mrg0b8cyba0"))
174 (patches (search-patches "tar-CVE-2016-6321.patch"
175 "tar-skip-unreliable-tests.patch"))))
176 (build-system gnu-build-system)
177 ;; Note: test suite requires ~1GiB of disk space.
178 (arguments
179 '(#:phases (modify-phases %standard-phases
180 (add-before 'build 'set-shell-file-name
181 (lambda* (#:key inputs #:allow-other-keys)
182 ;; Do not use "/bin/sh" to run programs.
183 (let ((bash (assoc-ref inputs "bash")))
184 (substitute* "src/system.c"
185 (("/bin/sh")
186 (string-append bash "/bin/sh")))
187 #t))))))
188
189 ;; When cross-compiling, the 'set-shell-file-name' phase needs to be able
190 ;; to refer to the target Bash.
191 (inputs (if (%current-target-system)
192 `(("bash" ,bash))
193 '()))
194
195 (synopsis "Managing tar archives")
196 (description
197 "Tar provides the ability to create tar archives, as well as the
198 ability to extract, update or list files in an existing archive. It is
199 useful for combining many files into one larger file, while maintaining
200 directory structure and file information such as permissions and
201 creation/modification dates. GNU tar offers many extensions over the
202 standard utility.")
203 (license gpl3+)
204 (home-page "https://www.gnu.org/software/tar/")))
205
206 (define-public patch
207 (package
208 (name "patch")
209 (version "2.7.5")
210 (source (origin
211 (method url-fetch)
212 (uri (string-append "mirror://gnu/patch/patch-"
213 version ".tar.xz"))
214 (sha256
215 (base32
216 "16d2r9kpivaak948mxzc0bai45mqfw73m113wrkmbffnalv1b5gx"))
217 (patches (search-patches "patch-hurd-path-max.patch"))))
218 (build-system gnu-build-system)
219 (native-inputs `(("ed" ,ed)))
220 (synopsis "Apply differences to originals, with optional backups")
221 (description
222 "Patch is a program that applies changes to files based on differences
223 laid out as by the program \"diff\". The changes may be applied to one or more
224 files depending on the contents of the diff file. It accepts several
225 different diff formats. It may also be used to revert previously applied
226 differences.")
227 (license gpl3+)
228 (home-page "https://savannah.gnu.org/projects/patch/")))
229
230 (define-public diffutils
231 (package
232 (name "diffutils")
233 (version "3.6")
234 (source (origin
235 (method url-fetch)
236 (uri (string-append "mirror://gnu/diffutils/diffutils-"
237 version ".tar.xz"))
238 (sha256
239 (base32
240 "1mivg0fy3a6fcn535ln8nkgfj6vxh5hsxxs5h6692wxmsjyyh8fn"))))
241 (build-system gnu-build-system)
242 (synopsis "Comparing and merging files")
243 (description
244 "GNU Diffutils is a package containing tools for finding the
245 differences between files. The \"diff\" command is used to show how two files
246 differ, while \"cmp\" shows the offsets and line numbers where they differ.
247 \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
248 interactive means to merge two files.")
249 (license gpl3+)
250 (home-page "https://www.gnu.org/software/diffutils/")))
251
252 (define-public findutils
253 (package
254 (name "findutils")
255 (version "4.6.0")
256 (source (origin
257 (method url-fetch)
258 (uri (string-append "mirror://gnu/findutils/findutils-"
259 version ".tar.gz"))
260 (sha256
261 (base32
262 "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y"))
263 (patches (search-patches
264 "findutils-localstatedir.patch"
265 "findutils-test-xargs.patch"
266 ;; test-lock has performance issues on multi-core
267 ;; machines, it hangs or takes a long time to complete.
268 ;; This is a commit from gnulib to fix this issue.
269 "findutils-gnulib-multi-core.patch"))))
270 (build-system gnu-build-system)
271 (arguments
272 `(#:configure-flags (list
273 ;; Tell 'updatedb' to write to /var.
274 "--localstatedir=/var"
275
276 ;; Work around cross-compilation failure. See
277 ;; <http://savannah.gnu.org/bugs/?27299#comment1>.
278 ,@(if (%current-target-system)
279 '("gl_cv_func_wcwidth_works=yes")
280 '()))))
281 (synopsis "Operating on files matching given criteria")
282 (description
283 "Findutils supplies the basic file directory searching utilities of the
284 GNU system. It consists of two primary searching utilities: \"find\"
285 recursively searches for files in a directory according to given criteria and
286 \"locate\" lists files in a database that match a query. Two auxiliary tools
287 are included: \"updatedb\" updates the file name database and \"xargs\" may be
288 used to apply commands with arbitrarily long arguments.")
289 (license gpl3+)
290 (home-page "https://www.gnu.org/software/findutils/")))
291
292 (define-public coreutils
293 (package
294 (name "coreutils")
295 (version "8.28")
296 (source (origin
297 (method url-fetch)
298 (uri (string-append "mirror://gnu/coreutils/coreutils-"
299 version ".tar.xz"))
300 (sha256
301 (base32
302 "0r8c1bgm68kl70j1lgd0rv12iykw6143k4m9a56xip9rc2hv25qi"))))
303 (build-system gnu-build-system)
304 (inputs `(("acl" ,acl) ; TODO: add SELinux
305 ("gmp" ,gmp) ;bignums in 'expr', yay!
306
307 ;; Drop the dependency on libcap when cross-compiling since it's
308 ;; not quite cross-compilable.
309 ,@(if (%current-target-system)
310 '()
311 `(("libcap" ,libcap))))) ;capability support is 'ls', etc.
312 (native-inputs
313 ;; Perl is needed to run tests in native builds, and to run the bundled
314 ;; copy of help2man. However, don't pass it when cross-compiling since
315 ;; that would lead it to try to run programs to get their '--help' output
316 ;; for help2man.
317 (if (%current-target-system)
318 '()
319 `(("perl" ,perl))))
320 (outputs '("out" "debug"))
321 (arguments
322 `(#:parallel-build? #f ; help2man may be called too early
323 #:phases (modify-phases %standard-phases
324 (add-before 'build 'patch-shell-references
325 (lambda _
326 ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so
327 ;; that tests pass, since /bin/sh isn't in the chroot.
328 (setenv "SHELL" (which "sh"))
329
330 (substitute* (find-files "gnulib-tests" "\\.c$")
331 (("/bin/sh") (which "sh")))
332 (substitute* (find-files "tests" "\\.sh$")
333 (("#!/bin/sh") (which "sh")))
334 #t)))))
335 (synopsis "Core GNU utilities (file, text, shell)")
336 (description
337 "GNU Coreutils includes all of the basic command-line tools that are
338 expected in a POSIX system. These provide the basic file, shell and text
339 manipulation functions of the GNU system. Most of these tools offer extended
340 functionality beyond that which is outlined in the POSIX standard.")
341 (license gpl3+)
342 (home-page "https://www.gnu.org/software/coreutils/")))
343
344 (define-public coreutils-minimal
345 ;; Coreutils without its optional dependencies.
346 (package
347 (inherit coreutils)
348 (name "coreutils-minimal")
349 (outputs '("out"))
350 (inputs '())))
351
352 (define-public gnu-make
353 (package
354 (name "make")
355 (version "4.2.1")
356 (source (origin
357 (method url-fetch)
358 (uri (string-append "mirror://gnu/make/make-" version
359 ".tar.bz2"))
360 (sha256
361 (base32
362 "12f5zzyq2w56g95nni65hc0g5p7154033y2f3qmjvd016szn5qnn"))
363 (patches (search-patches "make-impure-dirs.patch"))))
364 (build-system gnu-build-system)
365 (native-inputs `(("pkg-config" ,pkg-config))) ; to detect Guile
366 (inputs `(("guile" ,guile-2.0)))
367 (outputs '("out" "debug"))
368 (arguments
369 '(#:phases
370 (modify-phases %standard-phases
371 (add-before 'build 'set-default-shell
372 (lambda* (#:key inputs #:allow-other-keys)
373 ;; Change the default shell from /bin/sh.
374 (let ((bash (assoc-ref inputs "bash")))
375 (substitute* "job.c"
376 (("default_shell =.*$")
377 (format #f "default_shell = \"~a/bin/sh\";\n"
378 bash)))))))))
379 (synopsis "Remake files automatically")
380 (description
381 "Make is a program that is used to control the production of
382 executables or other files from their source files. The process is
383 controlled from a Makefile, in which the developer specifies how each file is
384 generated from its source. It has powerful dependency resolution and the
385 ability to determine when files have to be regenerated after their sources
386 change. GNU make offers many powerful extensions over the standard utility.")
387 (license gpl3+)
388 (home-page "https://www.gnu.org/software/make/")))
389
390 (define-public binutils
391 (package
392 (name "binutils")
393 (version "2.28.1")
394 (source (origin
395 (method url-fetch)
396 (uri (string-append "mirror://gnu/binutils/binutils-"
397 version ".tar.bz2"))
398 (sha256
399 (base32
400 "1sj234nd05cdgga1r36zalvvdkvpfbr12g5mir2n8i1dwsdrj939"))
401 (patches (search-patches "binutils-ld-new-dtags.patch"
402 "binutils-loongson-workaround.patch"))))
403 (build-system gnu-build-system)
404
405 ;; TODO: Add dependency on zlib + those for Gold.
406 (arguments
407 `(#:configure-flags '(;; Add `-static-libgcc' to not retain a dependency
408 ;; on GCC when bootstrapping.
409 "LDFLAGS=-static-libgcc"
410
411 ;; Don't search under /usr/lib & co.
412 "--with-lib-path=/no-ld-lib-path"
413
414 ;; Install BFD. It ends up in a hidden directory,
415 ;; but it's here.
416 "--enable-install-libbfd"
417
418 ;; Make sure 'ar' and 'ranlib' produce archives in a
419 ;; deterministic fashion.
420 "--enable-deterministic-archives")))
421
422 (synopsis "Binary utilities: bfd gas gprof ld")
423 (description
424 "GNU Binutils is a collection of tools for working with binary files.
425 Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
426 Other tools include programs to display binary profiling information, list
427 the strings in a binary file, and utilities for working with archives. The
428 \"bfd\" library for working with executable and object formats is also
429 included.")
430 (license gpl3+)
431 (home-page "https://www.gnu.org/software/binutils/")))
432
433 (define* (make-ld-wrapper name #:key
434 (target (const #f))
435 binutils
436 (guile (canonical-package guile-2.2))
437 (bash (canonical-package bash))
438 (guile-for-build guile))
439 "Return a package called NAME that contains a wrapper for the 'ld' program
440 of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. The
441 wrapper uses GUILE and BASH.
442
443 TARGET must be a one-argument procedure that, given a system type, returns a
444 cross-compilation target triplet or #f. When the result is not #f, make a
445 wrapper for the cross-linker for that target, called 'TARGET-ld'."
446 ;; Note: #:system->target-triplet is a procedure so that the evaluation of
447 ;; its result can be delayed until the 'arguments' field is evaluated, thus
448 ;; in a context where '%current-system' is accurate.
449 (package
450 (name name)
451 (version "0")
452 (source #f)
453 (build-system trivial-build-system)
454 (inputs `(("binutils" ,binutils)
455 ("guile" ,guile)
456 ("bash" ,bash)
457 ("wrapper" ,(search-path %load-path
458 "gnu/packages/ld-wrapper.in"))))
459 (arguments
460 (let ((target (target (%current-system))))
461 `(#:guile ,guile-for-build
462 #:modules ((guix build utils))
463 #:builder (begin
464 (use-modules (guix build utils)
465 (system base compile))
466
467 (let* ((out (assoc-ref %outputs "out"))
468 (bin (string-append out "/bin"))
469 (ld ,(if target
470 `(string-append bin "/" ,target "-ld")
471 '(string-append bin "/ld")))
472 (go (string-append ld ".go")))
473
474 (setvbuf (current-output-port) _IOLBF)
475 (format #t "building ~s/bin/ld wrapper in ~s~%"
476 (assoc-ref %build-inputs "binutils")
477 out)
478
479 (mkdir-p bin)
480 (copy-file (assoc-ref %build-inputs "wrapper") ld)
481 (substitute* ld
482 (("@SELF@")
483 ld)
484 (("@GUILE@")
485 (string-append (assoc-ref %build-inputs "guile")
486 "/bin/guile"))
487 (("@BASH@")
488 (string-append (assoc-ref %build-inputs "bash")
489 "/bin/bash"))
490 (("@LD@")
491 (string-append (assoc-ref %build-inputs "binutils")
492 ,(if target
493 (string-append "/bin/"
494 target "-ld")
495 "/bin/ld"))))
496 (chmod ld #o555)
497 (compile-file ld #:output-file go))))))
498 (synopsis "The linker wrapper")
499 (description
500 "The linker wrapper (or 'ld-wrapper') wraps the linker to add any
501 missing '-rpath' flags, and to detect any misuse of libraries outside of the
502 store.")
503 (home-page "https://www.gnu.org/software/guix//")
504 (license gpl3+)))
505
506 (export make-ld-wrapper)
507
508 (define-public glibc/linux
509 (package
510 (name "glibc")
511 (version "2.26")
512 (source (origin
513 (method url-fetch)
514 (uri (string-append "mirror://gnu/glibc/glibc-"
515 version ".tar.xz"))
516 (sha256
517 (base32
518 "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5"))
519 (snippet
520 ;; Disable 'ldconfig' and /etc/ld.so.cache. The latter is
521 ;; required on LFS distros to avoid loading the distro's libc.so
522 ;; instead of ours.
523 '(substitute* "sysdeps/unix/sysv/linux/configure"
524 (("use_ldconfig=yes")
525 "use_ldconfig=no")))
526 (modules '((guix build utils)))
527 (patches (search-patches "glibc-ldd-x86_64.patch"
528 "glibc-versioned-locpath.patch"
529 "glibc-CVE-2017-15670-15671.patch"
530 "glibc-o-largefile.patch"))))
531 (build-system gnu-build-system)
532
533 ;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
534 ;; users should automatically pull Linux headers as well.
535 (propagated-inputs `(("kernel-headers" ,linux-libre-headers)))
536
537 (outputs '("out" "debug"
538 "static")) ;9 MiB of .a files
539
540 (arguments
541 `(#:out-of-source? #t
542
543 ;; The libraries have an empty RUNPATH, but some, such as the versioned
544 ;; libraries (libdl-2.24.so, etc.) have ld.so marked as NEEDED. Since
545 ;; these libraries are always going to be found anyway, just skip
546 ;; RUNPATH checks.
547 #:validate-runpath? #f
548
549 #:modules ((ice-9 ftw)
550 (srfi srfi-26)
551 (guix build utils)
552 (guix build gnu-build-system))
553
554 #:configure-flags
555 (list "--enable-add-ons"
556 "--sysconfdir=/etc"
557
558 ;; Installing a locale archive with all the locales is to
559 ;; expensive (~100 MiB), so we rely on users to install the
560 ;; locales they really want.
561 ;;
562 ;; Set the default locale path. In practice, $LOCPATH may be
563 ;; defined to point whatever locales users want. However, setuid
564 ;; binaries don't honor $LOCPATH, so they'll instead look into
565 ;; $libc_cv_complocaledir; we choose /run/current-system/locale/X.Y,
566 ;; with the idea that it is going to be populated by the sysadmin.
567 ;; The "X.Y" sub-directory is because locale data formats are
568 ;; incompatible across libc versions; see
569 ;; <https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
570 ;;
571 ;; `--localedir' is not honored, so work around it.
572 ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
573 (string-append "libc_cv_complocaledir=/run/current-system/locale/"
574 ,version)
575
576 (string-append "--with-headers="
577 (assoc-ref ,(if (%current-target-system)
578 '%build-target-inputs
579 '%build-inputs)
580 "kernel-headers")
581 "/include")
582
583 ;; This is the default for most architectures as of GNU libc 2.26,
584 ;; but we specify it explicitly for clarity and consistency. See
585 ;; "kernel-features.h" in the GNU libc for details.
586 "--enable-kernel=3.2.0"
587
588 ;; Use our Bash instead of /bin/sh.
589 (string-append "BASH_SHELL="
590 (assoc-ref %build-inputs "bash")
591 "/bin/bash")
592
593 ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
594 "libc_cv_ssp=no" "libc_cv_ssp_strong=no")
595
596 #:tests? #f ; XXX
597 #:phases (modify-phases %standard-phases
598 (add-before
599 'configure 'pre-configure
600 (lambda* (#:key inputs native-inputs outputs
601 #:allow-other-keys)
602 (let* ((out (assoc-ref outputs "out"))
603 (bin (string-append out "/bin"))
604 ;; FIXME: Normally we would look it up only in INPUTS
605 ;; but cross-base uses it as a native input.
606 (bash (or (assoc-ref inputs "static-bash")
607 (assoc-ref native-inputs "static-bash"))))
608 ;; Install the rpc data base file under `$out/etc/rpc'.
609 ;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
610 (substitute* "sunrpc/Makefile"
611 (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
612 (string-append out "/etc/rpc" suffix "\n"))
613 (("^install-others =.*$")
614 (string-append "install-others = " out "/etc/rpc\n")))
615
616 (substitute* "Makeconfig"
617 ;; According to
618 ;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
619 ;; linking against libgcc_s is not needed with GCC
620 ;; 4.7.1.
621 ((" -lgcc_s") ""))
622
623 ;; Have `system' use that Bash.
624 (substitute* "sysdeps/posix/system.c"
625 (("#define[[:blank:]]+SHELL_PATH.*$")
626 (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
627 bash)))
628
629 ;; Same for `popen'.
630 (substitute* "libio/iopopen.c"
631 (("/bin/sh")
632 (string-append bash "/bin/sh")))
633
634 ;; Same for the shell used by the 'exec' functions for
635 ;; scripts that lack a shebang.
636 (substitute* (find-files "." "^paths\\.h$")
637 (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
638 (string-append "#define _PATH_BSHELL \""
639 bash "/bin/sh\"\n")))
640
641 ;; Nscd uses __DATE__ and __TIME__ to create a string to
642 ;; make sure the client and server come from the same
643 ;; libc. Use something deterministic instead.
644 (substitute* "nscd/nscd_stat.c"
645 (("static const char compilation\\[21\\] =.*$")
646 (string-append
647 "static const char compilation[21] = \""
648 (string-take (basename out) 20) "\";\n")))
649
650 ;; Make sure we don't retain a reference to the
651 ;; bootstrap Perl.
652 (substitute* "malloc/mtrace.pl"
653 (("^#!.*")
654 ;; The shebang can be omitted, because there's the
655 ;; "bilingual" eval/exec magic at the top of the file.
656 "")
657 (("exec @PERL@")
658 "exec perl")))))
659
660 (add-after 'install 'move-static-libs
661 (lambda* (#:key outputs #:allow-other-keys)
662 ;; Move static libraries to the "static" output.
663 (define (static-library? file)
664 ;; Return true if FILE is a static library. The
665 ;; "_nonshared.a" files are referred to by libc.so,
666 ;; libpthread.so, etc., which are in fact linker
667 ;; scripts.
668 (and (string-suffix? ".a" file)
669 (not (string-contains file "_nonshared"))))
670
671 (define (linker-script? file)
672 ;; Guess whether FILE, a ".a" file, is actually a
673 ;; linker script.
674 (and (not (ar-file? file))
675 (not (elf-file? file))))
676
677 (let* ((out (assoc-ref outputs "out"))
678 (lib (string-append out "/lib"))
679 (files (scandir lib static-library?))
680 (static (assoc-ref outputs "static"))
681 (slib (string-append static "/lib")))
682 (mkdir-p slib)
683 (for-each (lambda (base)
684 (rename-file (string-append lib "/" base)
685 (string-append slib "/" base)))
686 files)
687
688 ;; Usually libm.a is a linker script so we need to
689 ;; change the file names in there to refer to STATIC
690 ;; instead of OUT.
691 (for-each (lambda (ld-script)
692 (substitute* ld-script
693 ((out) static)))
694 (filter linker-script?
695 (map (cut string-append slib "/" <>)
696 files)))
697 #t))))))
698
699 (inputs `(("static-bash" ,static-bash)))
700
701 ;; To build the manual, we need Texinfo and Perl. Gettext is needed to
702 ;; install the message catalogs, with 'msgfmt'.
703 (native-inputs `(("texinfo" ,texinfo)
704 ("perl" ,perl)
705 ("gettext" ,gettext-minimal)))
706
707 (native-search-paths
708 ;; Search path for packages that provide locale data. This is useful
709 ;; primarily in build environments. Use 'GUIX_LOCPATH' rather than
710 ;; 'LOCPATH' to avoid interference with the host system's libc on foreign
711 ;; distros.
712 (list (search-path-specification
713 (variable "GUIX_LOCPATH")
714 (files '("lib/locale")))))
715
716 (synopsis "The GNU C Library")
717 (description
718 "Any Unix-like operating system needs a C library: the library which
719 defines the \"system calls\" and other basic facilities such as open, malloc,
720 printf, exit...
721
722 The GNU C library is used as the C library in the GNU system and most systems
723 with the Linux kernel.")
724 (license lgpl2.0+)
725 (home-page "https://www.gnu.org/software/libc/")))
726
727 (define-public glibc/hurd
728 ;; The Hurd's libc variant.
729 (package (inherit glibc/linux)
730 (name "glibc-hurd")
731 (version "2.23")
732 (source (origin
733 (method url-fetch)
734 (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-"
735 version "-hurd+libpthread-20161218" ".tar.gz"))
736 (sha256
737 (base32
738 "0vpdv05j6j3ria5bw8gp468i64gij94cslxkxj9xkfgi6p615b8p"))))
739
740 ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
741 ;; so both should be propagated.
742 (propagated-inputs `(("hurd-core-headers" ,hurd-core-headers)))
743 (native-inputs
744 `(,@(package-native-inputs glibc/linux)
745 ("mig" ,mig)
746 ("perl" ,perl)))
747
748 (arguments
749 (substitute-keyword-arguments (package-arguments glibc/linux)
750 ((#:phases original-phases)
751 ;; Add libmachuser.so and libhurduser.so to libc.so's search path.
752 ;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-07/msg00051.html>.
753 `(modify-phases ,original-phases
754 (add-after 'install 'augment-libc.so
755 (lambda* (#:key outputs #:allow-other-keys)
756 (let* ((out (assoc-ref outputs "out")))
757 (substitute* (string-append out "/lib/libc.so")
758 (("/[^ ]+/lib/libc.so.0.3")
759 (string-append out "/lib/libc.so.0.3" " libmachuser.so" " libhurduser.so"))))
760 #t))
761 (add-after 'pre-configure 'pre-configure-set-pwd
762 (lambda _
763 ;; Use the right 'pwd'.
764 (substitute* "configure"
765 (("/bin/pwd") "pwd"))
766 #t))
767 (replace 'build
768 (lambda _
769 ;; Force mach/hurd/libpthread subdirs to build first in order to avoid
770 ;; linking errors.
771 ;; See <https://lists.gnu.org/archive/html/bug-hurd/2016-11/msg00045.html>
772 (let ((-j (list "-j" (number->string (parallel-job-count)))))
773 (let-syntax ((make (syntax-rules ()
774 ((_ target)
775 (zero? (apply system* "make" target -j))))))
776 (and (make "mach/subdir_lib")
777 (make "hurd/subdir_lib")
778 (make "libpthread/subdir_lib")
779 (zero? (apply system* "make" -j)))))))))
780 ((#:configure-flags original-configure-flags)
781 `(append (list "--host=i586-pc-gnu"
782
783 ;; We need this to get a working openpty() function.
784 "--enable-pt_chown"
785
786 ;; <https://lists.gnu.org/archive/html/bug-hurd/2016-10/msg00033.html>
787 "--disable-werror"
788
789 ;; nscd fails to build for GNU/Hurd:
790 ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
791 ;; Disable it.
792 "--disable-nscd")
793 (filter (lambda (flag)
794 (not (string-prefix? "--enable-kernel=" flag)))
795 ,original-configure-flags)))))
796 (synopsis "The GNU C Library (GNU Hurd variant)")
797 (supported-systems %hurd-systems)))
798
799 (define* (glibc-for-target #:optional
800 (target (or (%current-target-system)
801 (%current-system))))
802 "Return the glibc for TARGET, GLIBC/LINUX for a Linux host or
803 GLIBC/HURD for a Hurd host"
804 (match target
805 ((or "i586-pc-gnu" "i586-gnu") glibc/hurd)
806 (_ glibc/linux)))
807
808 (define-syntax glibc
809 (identifier-syntax (glibc-for-target)))
810
811 ;; Below are old libc versions, which we use mostly to build locale data in
812 ;; the old format (which the new libc cannot cope with.)
813
814 (define-public glibc-2.25
815 (package
816 (inherit glibc)
817 (version "2.25")
818 (source (origin
819 (inherit (package-source glibc))
820 (uri (string-append "mirror://gnu/glibc/glibc-"
821 version ".tar.xz"))
822 (sha256
823 (base32
824 "1813dzkgw6v8q8q1m4v96yfis7vjqc9pslqib6j9mrwh6fxxjyq6"))
825 (patches (search-patches "glibc-ldd-x86_64.patch"
826 "glibc-versioned-locpath.patch"
827 "glibc-o-largefile.patch"
828 "glibc-vectorized-strcspn-guards.patch"
829 "glibc-CVE-2015-5180.patch"
830 "glibc-CVE-2017-15670-15671.patch"
831 "glibc-CVE-2017-1000366-pt1.patch"
832 "glibc-CVE-2017-1000366-pt2.patch"
833 "glibc-CVE-2017-1000366-pt3.patch"))))))
834
835 (define-public glibc-2.24
836 (package
837 (inherit glibc)
838 (version "2.24")
839 (source (origin
840 (inherit (package-source glibc))
841 (uri (string-append "mirror://gnu/glibc/glibc-"
842 version ".tar.xz"))
843 (sha256
844 (base32
845 "1lxmprg9gm73gvafxd503x70z32phwjzcy74i0adfi6ixzla7m4r"))
846 (patches (search-patches "glibc-ldd-x86_64.patch"
847 "glibc-versioned-locpath.patch"
848 "glibc-o-largefile.patch"
849 "glibc-vectorized-strcspn-guards.patch"
850 "glibc-CVE-2015-5180.patch"
851 "glibc-CVE-2017-15670-15671.patch"
852 "glibc-CVE-2017-1000366-pt1.patch"
853 "glibc-CVE-2017-1000366-pt2.patch"
854 "glibc-CVE-2017-1000366-pt3.patch"))))))
855
856 (define-public glibc-2.23
857 (package
858 (inherit glibc)
859 (version "2.23")
860 (source (origin
861 (inherit (package-source glibc))
862 (uri (string-append "mirror://gnu/glibc/glibc-"
863 version ".tar.xz"))
864 (sha256
865 (base32
866 "1s8krs3y2n6pzav7ic59dz41alqalphv7vww4138ag30wh0fpvwl"))
867 (patches (search-patches "glibc-ldd-x86_64.patch"
868 "glibc-versioned-locpath.patch"
869 "glibc-o-largefile.patch"
870 "glibc-vectorized-strcspn-guards.patch"
871 "glibc-CVE-2015-5180.patch"
872 "glibc-CVE-2016-3075.patch"
873 "glibc-CVE-2016-3706.patch"
874 "glibc-CVE-2016-4429.patch"
875 "glibc-CVE-2017-15670-15671.patch"
876 "glibc-CVE-2017-1000366-pt1.patch"
877 "glibc-CVE-2017-1000366-pt2.patch"
878 "glibc-CVE-2017-1000366-pt3.patch"))))))
879
880 (define-public glibc-2.22
881 (package
882 (inherit glibc)
883 (version "2.22")
884 (source (origin
885 (inherit (package-source glibc))
886 (uri (string-append "mirror://gnu/glibc/glibc-"
887 version ".tar.xz"))
888 (sha256
889 (base32
890 "0j49682pm2nh4qbdw35bas82p1pgfnz4d2l7iwfyzvrvj0318wzb"))
891 (patches (search-patches "glibc-ldd-x86_64.patch"
892 "glibc-vectorized-strcspn-guards.patch"
893 "glibc-CVE-2015-5180.patch"
894 "glibc-CVE-2015-7547.patch"
895 "glibc-CVE-2016-3075.patch"
896 "glibc-CVE-2016-3706.patch"
897 "glibc-CVE-2016-4429.patch"
898 "glibc-CVE-2017-15670-15671.patch"
899 "glibc-CVE-2017-1000366-pt1.patch"
900 "glibc-CVE-2017-1000366-pt2.patch"
901 "glibc-CVE-2017-1000366-pt3.patch"))))
902 (arguments
903 (substitute-keyword-arguments (package-arguments glibc)
904 ((#:phases phases)
905 `(modify-phases ,phases
906 (add-before 'configure 'fix-pwd
907 (lambda _
908 ;; Use `pwd' instead of `/bin/pwd' for glibc-2.22.
909 (substitute* "configure"
910 (("/bin/pwd") "pwd"))
911 #t))))))))
912
913 (define-public glibc-locales
914 (package
915 (inherit glibc)
916 (name "glibc-locales")
917 (source (origin (inherit (package-source glibc))
918 (patches (cons (search-patch "glibc-locales.patch")
919 (origin-patches (package-source glibc))))))
920 (synopsis "All the locales supported by the GNU C Library")
921 (description
922 "This package provides all the locales supported by the GNU C Library,
923 more than 400 in total. To use them set the 'LOCPATH' environment variable to
924 the 'share/locale' sub-directory of this package.")
925 (outputs '("out")) ;110+ MiB
926 (native-search-paths '())
927 (arguments
928 (let ((args `(#:tests? #f #:strip-binaries? #f
929 ,@(package-arguments glibc))))
930 (substitute-keyword-arguments args
931 ((#:phases phases)
932 `(modify-phases ,phases
933 (replace 'build
934 (lambda _
935 (zero? (system* "make" "localedata/install-locales"
936 "-j" (number->string (parallel-job-count))))))
937 (delete 'install)))
938 ((#:configure-flags flags)
939 `(append ,flags
940 ;; Use $(libdir)/locale/X.Y as is the case by default.
941 (list (string-append "libc_cv_complocaledir="
942 (assoc-ref %outputs "out")
943 "/lib/locale/"
944 ,(package-version glibc))))))))))
945
946 (define-public glibc-utf8-locales
947 (package
948 (name "glibc-utf8-locales")
949 (version (package-version glibc))
950 (source #f)
951 (build-system trivial-build-system)
952 (arguments
953 `(#:modules ((guix build utils))
954 #:builder (begin
955 (use-modules (srfi srfi-1)
956 (guix build utils))
957
958 (let* ((libc (assoc-ref %build-inputs "glibc"))
959 (gzip (assoc-ref %build-inputs "gzip"))
960 (out (assoc-ref %outputs "out"))
961 (localedir (string-append out "/lib/locale/"
962 ,version)))
963 ;; 'localedef' needs 'gzip'.
964 (setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
965
966 (mkdir-p localedir)
967 (every (lambda (locale)
968 (define file
969 ;; Use the "normalized codeset" by
970 ;; default--e.g., "en_US.utf8".
971 (string-append localedir "/" locale ".utf8"))
972
973 (and (zero? (system* "localedef" "--no-archive"
974 "--prefix" localedir
975 "-i" locale
976 "-f" "UTF-8" file))
977 (begin
978 ;; For backward compatibility with Guix
979 ;; <= 0.8.3, add "xx_YY.UTF-8".
980 (symlink (string-append locale ".utf8")
981 (string-append localedir "/"
982 locale ".UTF-8"))
983 #t)))
984
985 ;; These are the locales commonly used for
986 ;; tests---e.g., in Guile's i18n tests.
987 '("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))))))
988 (inputs `(("glibc" ,glibc)
989 ("gzip" ,gzip)))
990 (synopsis "Small sample of UTF-8 locales")
991 (description
992 "This package provides a small sample of UTF-8 locales mostly useful in
993 test environments.")
994 (home-page (package-home-page glibc))
995 (license (package-license glibc))))
996
997 (define-public which
998 (package
999 (name "which")
1000 (version "2.21")
1001 (source (origin
1002 (method url-fetch)
1003 (uri (string-append "mirror://gnu/which/which-"
1004 version ".tar.gz"))
1005 (sha256
1006 (base32
1007 "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
1008 (build-system gnu-build-system)
1009 (home-page "https://gnu.org/software/which/")
1010 (synopsis "Find full path of shell commands")
1011 (description
1012 "The which program finds the location of executables in PATH, with a
1013 variety of options. It is an alternative to the shell \"type\" built-in
1014 command.")
1015 (license gpl3+))) ; some files are under GPLv2+
1016
1017 (define-public glibc/hurd-headers
1018 (package (inherit glibc/hurd)
1019 (name "glibc-hurd-headers")
1020 (outputs '("out"))
1021 (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
1022 ("hurd-headers" ,hurd-headers)))
1023 (arguments
1024 (substitute-keyword-arguments (package-arguments glibc/hurd)
1025 ;; We just pass the flags really needed to build the headers.
1026 ((#:configure-flags _)
1027 `(list "--enable-add-ons"
1028 "--host=i586-pc-gnu"
1029 "--enable-obsolete-rpc"))
1030 ((#:phases _)
1031 '(alist-replace
1032 'install
1033 (lambda* (#:key outputs #:allow-other-keys)
1034 (and (zero? (system* "make" "install-headers"))
1035
1036 ;; Make an empty stubs.h to work around not being able to
1037 ;; produce a valid stubs.h and causing the build to fail. See
1038 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
1039 (let ((out (assoc-ref outputs "out")))
1040 (close-port
1041 (open-output-file
1042 (string-append out "/include/gnu/stubs.h"))))))
1043
1044 ;; Nothing to build.
1045 (alist-delete
1046 'build
1047
1048 (alist-cons-before
1049 'configure 'pre-configure
1050 (lambda _
1051 ;; Use the right 'pwd'.
1052 (substitute* "configure"
1053 (("/bin/pwd") "pwd")))
1054 %standard-phases))))))))
1055
1056 (define-public tzdata
1057 (package
1058 (name "tzdata")
1059 (version "2017b")
1060 (source (origin
1061 (method url-fetch)
1062 (uri (string-append
1063 "https://www.iana.org/time-zones/repository/releases/tzdata"
1064 version ".tar.gz"))
1065 (sha256
1066 (base32
1067 "11l0s43vx33dcs78p80122i8s5s9l1sjwkzzwh66njd35r92l97q"))))
1068 (build-system gnu-build-system)
1069 (arguments
1070 '(#:tests? #f
1071 #:make-flags (let ((out (assoc-ref %outputs "out"))
1072 (tmp (getenv "TMPDIR")))
1073 (list (string-append "TOPDIR=" out)
1074 (string-append "TZDIR=" out "/share/zoneinfo")
1075
1076 ;; Discard zic, dump, and tzselect, already
1077 ;; provided by glibc.
1078 (string-append "ETCDIR=" tmp "/etc")
1079
1080 ;; Likewise for the C library routines.
1081 (string-append "LIBDIR=" tmp "/lib")
1082 (string-append "MANDIR=" tmp "/man")
1083
1084 "AWK=awk"
1085 "CC=gcc"))
1086 #:modules ((guix build utils)
1087 (guix build gnu-build-system)
1088 (srfi srfi-1))
1089 #:phases
1090 (modify-phases %standard-phases
1091 (replace 'unpack
1092 (lambda* (#:key source inputs #:allow-other-keys)
1093 (and (zero? (system* "tar" "xvf" source))
1094 (zero? (system* "tar" "xvf" (assoc-ref inputs "tzcode"))))))
1095 (add-after 'install 'post-install
1096 (lambda* (#:key outputs #:allow-other-keys)
1097 ;; Move data in the right place.
1098 (let ((out (assoc-ref outputs "out")))
1099 (symlink (string-append out "/share/zoneinfo")
1100 (string-append out "/share/zoneinfo/posix"))
1101 (delete-file-recursively
1102 (string-append out "/share/zoneinfo-posix"))
1103 (copy-recursively (string-append out "/share/zoneinfo-leaps")
1104 (string-append out "/share/zoneinfo/right"))
1105 (delete-file-recursively
1106 (string-append out "/share/zoneinfo-leaps")))))
1107 (delete 'configure))))
1108 (inputs `(("tzcode" ,(origin
1109 (method url-fetch)
1110 (uri (string-append
1111 "http://www.iana.org/time-zones/repository/releases/tzcode"
1112 version ".tar.gz"))
1113 (sha256
1114 (base32
1115 "0h1d567gn8l3iqgyadcswwdy2yh07nhz3lfl8ds8saz2ajxka5sd"))))))
1116 (home-page "https://www.iana.org/time-zones")
1117 (synopsis "Database of current and historical time zones")
1118 (description "The Time Zone Database (often called tz or zoneinfo)
1119 contains code and data that represent the history of local time for many
1120 representative locations around the globe. It is updated periodically to
1121 reflect changes made by political bodies to time zone boundaries, UTC offsets,
1122 and daylight-saving rules.")
1123 (license public-domain)))
1124
1125 ;;; A "fixed" version of tzdata, which is used in the test suites of
1126 ;;; glib and R. We can update this whenever we are able to rebuild
1127 ;;; thousands of packages (for example, in a core-updates rebuild).
1128 (define-public tzdata-2017a
1129 (package
1130 (inherit tzdata)
1131 (version "2017a")
1132 (source
1133 (origin
1134 (method url-fetch)
1135 (uri (string-append "https://www.iana.org/time-zones/repository"
1136 "/releases/tzdata" version ".tar.gz"))
1137 (sha256
1138 (base32
1139 "1mmv4rvcs12lrvgghw4fidczvb69yv69cmzknghcvw1c196mqfnz"))))
1140 (inputs `(("tzcode" ,(origin
1141 (method url-fetch)
1142 (uri (string-append
1143 "http://www.iana.org/time-zones/repository/releases/tzcode"
1144 version ".tar.gz"))
1145 (sha256
1146 (base32
1147 "1b1q7gnlsh5hjgs5065pvajd37rmbc3k9b8cgzad1vcrifswdwh2"))))))))
1148
1149
1150 (define-public libiconv
1151 (package
1152 (name "libiconv")
1153 (version "1.15")
1154 (source (origin
1155 (method url-fetch)
1156 (uri (string-append "mirror://gnu/libiconv/libiconv-"
1157 version ".tar.gz"))
1158 (sha256
1159 (base32
1160 "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc"))
1161 (modules '((guix build utils)))
1162 (snippet
1163 ;; Work around "declared gets" error on glibc systems (fixed by
1164 ;; Gnulib commit 66712c23388e93e5c518ebc8515140fa0c807348.)
1165 '(substitute* "srclib/stdio.in.h"
1166 (("^#undef gets") "")
1167 (("^_GL_WARN_ON_USE \\(gets.*") "")))))
1168 (build-system gnu-build-system)
1169 (synopsis "Character set conversion library")
1170 (description
1171 "libiconv provides an implementation of the iconv function for systems
1172 that lack it. iconv is used to convert between character encodings in a
1173 program. It supports a wide variety of different encodings.")
1174 (home-page "https://www.gnu.org/software/libiconv/")
1175 (license lgpl3+)))
1176
1177 (define* (libiconv-if-needed #:optional (target (%current-target-system)))
1178 "Return either a libiconv package specification to include in a dependency
1179 list for platforms that have an incomplete libc, or the empty list. If a
1180 package needs iconv ,@(libiconv-if-needed) should be added."
1181 ;; POSIX C libraries provide iconv. Platforms with an incomplete libc
1182 ;; without iconv, such as MinGW, must return the then clause.
1183 (if (target-mingw? target)
1184 `(("libiconv" ,libiconv))
1185 '()))
1186
1187 (define-public (canonical-package package)
1188 ;; Avoid circular dependency by lazily resolving 'commencement'.
1189 (let* ((iface (resolve-interface '(gnu packages commencement)))
1190 (proc (module-ref iface 'canonical-package)))
1191 (proc package)))
1192
1193 (define-public (%final-inputs)
1194 "Return the list of \"final inputs\"."
1195 ;; Avoid circular dependency by lazily resolving 'commencement'.
1196 (let ((iface (resolve-interface '(gnu packages commencement))))
1197 (module-ref iface '%final-inputs)))
1198
1199 ;;; base.scm ends here