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