| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 |
|
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 |
|
| 49 | (define-module (gnu packages base)
|
| 50 | #:use-module ((guix licenses)
|
| 51 | #:select (gpl3+ lgpl2.0+ lgpl3+ public-domain))
|
| 52 | #:use-module (gnu packages)
|
| 53 | #:use-module (gnu packages acl)
|
| 54 | #:use-module (gnu packages algebra)
|
| 55 | #:use-module (gnu packages attr)
|
| 56 | #:use-module (gnu packages autotools)
|
| 57 | #:use-module (gnu packages bash)
|
| 58 | #:use-module (gnu packages bison)
|
| 59 | #:use-module (gnu packages build-tools)
|
| 60 | #:use-module (gnu packages gcc)
|
| 61 | #:use-module (gnu packages guile)
|
| 62 | #:use-module (gnu packages multiprecision)
|
| 63 | #:use-module (gnu packages compression)
|
| 64 | #:use-module (gnu packages perl)
|
| 65 | #:use-module (gnu packages linux)
|
| 66 | #:use-module (gnu packages pcre)
|
| 67 | #:use-module (gnu packages texinfo)
|
| 68 | #:use-module (gnu packages text-editors)
|
| 69 | #:use-module (gnu packages hurd)
|
| 70 | #:use-module (gnu packages pkg-config)
|
| 71 | #:use-module (gnu packages python)
|
| 72 | #:use-module (gnu packages gettext)
|
| 73 | #:use-module (guix i18n)
|
| 74 | #:use-module (guix utils)
|
| 75 | #:use-module (guix gexp)
|
| 76 | #:use-module (guix packages)
|
| 77 | #:use-module (guix download)
|
| 78 | #:use-module (guix git-download)
|
| 79 | #:use-module (guix build-system gnu)
|
| 80 | #:use-module (guix build-system trivial)
|
| 81 | #:use-module (guix search-paths)
|
| 82 | #:use-module (ice-9 format)
|
| 83 | #:use-module (ice-9 match)
|
| 84 | #:use-module (ice-9 optargs)
|
| 85 | #:use-module (srfi srfi-1)
|
| 86 | #:use-module (srfi srfi-26)
|
| 87 | #:export (glibc
|
| 88 | libc-for-target
|
| 89 | libc-locales-for-target
|
| 90 | libc-utf8-locales-for-target
|
| 91 | make-ld-wrapper
|
| 92 | libiconv-if-needed
|
| 93 |
|
| 94 | |
| 95 | |
| 96 | canonical-package
|
| 97 | %final-inputs))
|
| 98 |
|
| 99 | (define-public hello
|
| 100 | (package
|
| 101 | (name "hello")
|
| 102 | (version "2.12.3")
|
| 103 | (source (origin
|
| 104 | (method url-fetch)
|
| 105 | (uri (string-append "mirror://gnu/hello/hello-" version
|
| 106 | ".tar.gz"))
|
| 107 | (sha256
|
| 108 | (base32
|
| 109 | "183a6rxnhixiyykd7qis0y9g9cfqhpkk872a245y3zl28can0pqd"))))
|
| 110 | (build-system gnu-build-system)
|
| 111 | (synopsis "Example GNU package")
|
| 112 | (description
|
| 113 | "GNU Hello prints the message \"Hello, world!\" and then exits. It
|
| 114 | serves as an example of standard GNU coding practices. As such, it supports
|
| 115 | command-line arguments, multiple languages, and so on.")
|
| 116 | (home-page "https://www.gnu.org/software/hello/")
|
| 117 | (license gpl3+)))
|
| 118 |
|
| 119 | (define-public grep
|
| 120 | (package
|
| 121 | (name "grep")
|
| 122 | (version "3.11")
|
| 123 | (source (origin
|
| 124 | (method url-fetch)
|
| 125 | (uri (string-append "mirror://gnu/grep/grep-"
|
| 126 | version ".tar.xz"))
|
| 127 | (sha256
|
| 128 | (base32
|
| 129 | "1avf4x8skxbqrjp5j2qr9sp5vlf8jkw2i5bdn51fl3cxx3fsxchx"))
|
| 130 | (patches (search-patches "grep-timing-sensitive-test.patch"))))
|
| 131 | (build-system gnu-build-system)
|
| 132 | (native-inputs (list perl)) |
| 133 | (inputs (list pcre2))
|
| 134 | (arguments
|
| 135 | (list #:configure-flags #~(list "--enable-perl-regexp")
|
| 136 | #:phases
|
| 137 | #~(modify-phases %standard-phases
|
| 138 | (add-after 'install 'fix-egrep-and-fgrep
|
| 139 | |
| 140 | |
| 141 | (lambda* (#:key outputs #:allow-other-keys)
|
| 142 | (let* ((out (assoc-ref outputs "out"))
|
| 143 | (bin (string-append out "/bin")))
|
| 144 | (substitute* (list (string-append bin "/egrep")
|
| 145 | (string-append bin "/fgrep"))
|
| 146 | (("^exec grep")
|
| 147 | (string-append "exec " bin "/grep"))))))
|
| 148 | #$@(if (target-hurd64?)
|
| 149 | #~((add-after 'unpack 'patch-sigsegv
|
| 150 | (lambda _
|
| 151 | |
| 152 | (substitute* "lib/sigsegv.in.h"
|
| 153 | (("__GNU__") "__XGNU__")))))
|
| 154 | #~())
|
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | #$@(if (target-hurd32?)
|
| 160 | #~((add-after 'unpack 'skip-year2038-test
|
| 161 | (lambda _
|
| 162 | (substitute* "gnulib-tests/test-year2038.c"
|
| 163 | (("(^| )main *\\(.*" all)
|
| 164 | (string-append all "{\n return 77;//"))))))
|
| 165 | #~())
|
| 166 | #$@(if (system-hurd?)
|
| 167 | #~((add-before 'check 'skip-test
|
| 168 | (lambda _
|
| 169 | (substitute* |
| 170 | '("tests/hash-collision-perf"
|
| 171 | |
| 172 | "tests/file")
|
| 173 | (("^#!.*" all)
|
| 174 | (string-append all "exit 77;\n"))))))
|
| 175 | #~())
|
| 176 | #$@(if (system-hurd64?)
|
| 177 | #~((add-before 'check 'skip-test
|
| 178 | (lambda _
|
| 179 | (substitute* "tests/stack-overflow" |
| 180 | (("^#!.*" all)
|
| 181 | (string-append all "exit 77;\n"))))))
|
| 182 | #~()))))
|
| 183 | (synopsis "Print lines matching a pattern")
|
| 184 | (description
|
| 185 | "grep is a tool for finding text inside files. Text is found by
|
| 186 | matching a pattern provided by the user in one or many files. The pattern
|
| 187 | may be provided as a basic or extended regular expression, or as fixed
|
| 188 | strings. By default, the matching text is simply printed to the screen,
|
| 189 | however the output can be greatly customized to include, for example, line
|
| 190 | numbers. GNU grep offers many extensions over the standard utility,
|
| 191 | including, for example, recursive directory searching.")
|
| 192 | (license gpl3+)
|
| 193 | (home-page "https://www.gnu.org/software/grep/")))
|
| 194 |
|
| 195 | (define-public sed
|
| 196 | (package
|
| 197 | (name "sed")
|
| 198 | (version "4.9")
|
| 199 | (source (origin
|
| 200 | (method url-fetch)
|
| 201 | (uri (string-append "mirror://gnu/sed/sed-" version
|
| 202 | ".tar.gz"))
|
| 203 | (sha256
|
| 204 | (base32
|
| 205 | "0bi808vfkg3szmpy9g5wc7jnn2yk6djiz412d30km9rky0c8liyi"))))
|
| 206 | (build-system gnu-build-system)
|
| 207 | (synopsis "Stream editor")
|
| 208 | (native-inputs (append (if (target-loongarch64?)
|
| 209 | (list config)
|
| 210 | '())
|
| 211 | (list perl))) |
| 212 | (arguments (if (target-loongarch64?)
|
| 213 | (list #:phases
|
| 214 | #~(modify-phases %standard-phases
|
| 215 | (add-after 'unpack 'update-config-scripts
|
| 216 | (lambda* (#:key inputs native-inputs #:allow-other-keys)
|
| 217 | |
| 218 | (for-each (lambda (file)
|
| 219 | (install-file
|
| 220 | (search-input-file
|
| 221 | (or native-inputs inputs)
|
| 222 | (string-append "/bin/" file)) "./build-aux"))
|
| 223 | '("config.guess" "config.sub"))))))
|
| 224 | '()))
|
| 225 | (description
|
| 226 | "Sed is a non-interactive, text stream editor. It receives a text
|
| 227 | input from a file or from standard input and it then applies a series of text
|
| 228 | editing commands to the stream and prints its output to standard output. It
|
| 229 | is often used for substituting text patterns in a stream. The GNU
|
| 230 | implementation offers several extensions over the standard utility.")
|
| 231 | (license gpl3+)
|
| 232 | (home-page "https://www.gnu.org/software/sed/")))
|
| 233 |
|
| 234 | (define-public tar
|
| 235 | (package
|
| 236 | (name "tar")
|
| 237 | (version "1.35")
|
| 238 | (source (origin
|
| 239 | (method url-fetch)
|
| 240 | (uri (string-append "mirror://gnu/tar/tar-"
|
| 241 | version ".tar.xz"))
|
| 242 | (sha256
|
| 243 | (base32
|
| 244 | "05nw7q7sazkana11hnf3f77lmybw1j9j6lsk93bsxirf6hvzyqjd"))
|
| 245 | (patches (search-patches "tar-skip-unreliable-tests.patch"
|
| 246 | "tar-remove-wholesparse-check.patch"))))
|
| 247 | (build-system gnu-build-system)
|
| 248 | |
| 249 | (arguments
|
| 250 | `(,@(cond
|
| 251 | ((target-hurd?)
|
| 252 | '(#:make-flags
|
| 253 | (list (string-append
|
| 254 | "TESTSUITEFLAGS= -k '"
|
| 255 | "!sparse"
|
| 256 | ",!renamed dirs in incrementals"
|
| 257 | ",!--exclude-tag option in incremental pass"
|
| 258 | ",!incremental dumps with -C"
|
| 259 | ",!incremental dumps of nested directories"
|
| 260 | ",!incremental restores with -C"
|
| 261 | ",!concatenated incremental archives (renames)"
|
| 262 | ",!renamed directory containing subdirectories"
|
| 263 | ",!renamed subdirectories"
|
| 264 | ",!chained renames"
|
| 265 | ",!Directory"
|
| 266 | "'"))))
|
| 267 | |
| 268 | |
| 269 | ((target-ppc32?)
|
| 270 | '(#:make-flags (list (string-append "TESTSUITEFLAGS= -k "
|
| 271 | "'!tricky time stamps"
|
| 272 | ",!storing sparse files > 8G'"))))
|
| 273 | |
| 274 | |
| 275 | |
| 276 | ((target-32bit?)
|
| 277 | '(#:make-flags (list "TESTSUITEFLAGS= -k '!tricky time stamps'")))
|
| 278 | (else '()))
|
| 279 | |
| 280 | ,@(if (target-hurd32?)
|
| 281 | (list #:configure-flags ''("--disable-year2038"))
|
| 282 | '())
|
| 283 | #:phases (modify-phases %standard-phases
|
| 284 | (add-before 'build 'set-shell-file-name
|
| 285 | (lambda* (#:key inputs #:allow-other-keys)
|
| 286 | |
| 287 | (let ((bash (assoc-ref inputs "bash")))
|
| 288 | (substitute* "src/system.c"
|
| 289 | (("/bin/sh")
|
| 290 | (string-append bash "/bin/sh")))))))))
|
| 291 |
|
| 292 | |
| 293 | |
| 294 | (inputs (if (%current-target-system)
|
| 295 | (list bash)
|
| 296 | '()))
|
| 297 |
|
| 298 | (synopsis "Managing tar archives")
|
| 299 | (description
|
| 300 | "Tar provides the ability to create tar archives, as well as the
|
| 301 | ability to extract, update or list files in an existing archive. It is
|
| 302 | useful for combining many files into one larger file, while maintaining
|
| 303 | directory structure and file information such as permissions and
|
| 304 | creation/modification dates. GNU tar offers many extensions over the
|
| 305 | standard utility.")
|
| 306 | (license gpl3+)
|
| 307 | (home-page "https://www.gnu.org/software/tar/")))
|
| 308 |
|
| 309 | |
| 310 | (define-public patch/pinned
|
| 311 | (hidden-package
|
| 312 | (package
|
| 313 | (name "patch")
|
| 314 | (version "2.7.6")
|
| 315 | (source (origin
|
| 316 | (method url-fetch)
|
| 317 | (uri (string-append "mirror://gnu/patch/patch-"
|
| 318 | version ".tar.xz"))
|
| 319 | (sha256
|
| 320 | (base32
|
| 321 | "1zfqy4rdcy279vwn2z1kbv19dcfw25d2aqy9nzvdkq5bjzd0nqdc"))
|
| 322 | (patches (search-patches "patch-hurd-path-max.patch"))))
|
| 323 | (build-system gnu-build-system)
|
| 324 | (arguments
|
| 325 | |
| 326 | |
| 327 | (if (%current-target-system)
|
| 328 | `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
|
| 329 | '()))
|
| 330 | (native-inputs (list ed))
|
| 331 | (synopsis "Apply differences to originals, with optional backups")
|
| 332 | (description
|
| 333 | "Patch is a program that applies changes to files based on differences
|
| 334 | laid out as by the program \"diff\". The changes may be applied to one or more
|
| 335 | files depending on the contents of the diff file. It accepts several
|
| 336 | different diff formats. It may also be used to revert previously applied
|
| 337 | differences.")
|
| 338 | (license gpl3+)
|
| 339 | (home-page "https://savannah.gnu.org/projects/patch/"))))
|
| 340 |
|
| 341 | (define-public patch
|
| 342 | (package
|
| 343 | (inherit patch/pinned)
|
| 344 | (name "patch")
|
| 345 | (version "2.8")
|
| 346 | (source (origin
|
| 347 | (method url-fetch)
|
| 348 | (uri (string-append "mirror://gnu/patch/patch-"
|
| 349 | version ".tar.xz"))
|
| 350 | (sha256
|
| 351 | (base32
|
| 352 | "1qssgwgy3mfahkpgg99a35gl38vamlqb15m3c2zzrd62xrlywz7q"))))
|
| 353 | (arguments
|
| 354 | (substitute-keyword-arguments (package-arguments patch/pinned)
|
| 355 | ((#:configure-flags flags #~'())
|
| 356 | (if (target-hurd32?)
|
| 357 | #~(cons* "--disable-year2038"
|
| 358 | #$flags)
|
| 359 | flags))))
|
| 360 | (properties '())))
|
| 361 |
|
| 362 | (define-public diffutils
|
| 363 | (package
|
| 364 | (name "diffutils")
|
| 365 | (version "3.12")
|
| 366 | (source (origin
|
| 367 | (method url-fetch)
|
| 368 | (uri (string-append "mirror://gnu/diffutils/diffutils-"
|
| 369 | version ".tar.xz"))
|
| 370 | (sha256
|
| 371 | (base32
|
| 372 | "1zbxf8vv7z18ypddwqgzj51n426k959fiv4wxbyl34b0r2gpz2vw"))))
|
| 373 | (build-system gnu-build-system)
|
| 374 | (arguments
|
| 375 | (list
|
| 376 | |
| 377 | |
| 378 | #:make-flags
|
| 379 | #~#$(cond ((and (not (%current-target-system))
|
| 380 | (target-hurd32?))
|
| 381 | #~'("XFAIL_TESTS=test-year2038"))
|
| 382 | |
| 383 | ((and (not (%current-target-system))
|
| 384 | (target-powerpc?))
|
| 385 | #~'("XFAIL_TESTS=test-float-h large-subopt"))
|
| 386 | (else
|
| 387 | #~'()))
|
| 388 |
|
| 389 | #:configure-flags
|
| 390 | #~#$(if (%current-target-system)
|
| 391 | |
| 392 | #~'("ac_cv_func_strcasecmp=yes" "gl_cv_func_strcasecmp_works=yes")
|
| 393 | #~'())
|
| 394 |
|
| 395 | #:phases (if (system-hurd?)
|
| 396 | #~(modify-phases %standard-phases
|
| 397 | (add-after 'unpack 'skip-tests
|
| 398 | (lambda _
|
| 399 | (substitute* "tests/large-subopt"
|
| 400 | (("^#!.*" all)
|
| 401 | (string-append all "exit 77;\n"))))))
|
| 402 | #~%standard-phases)))
|
| 403 | (native-inputs (list perl))
|
| 404 | (synopsis "Comparing and merging files")
|
| 405 | (description
|
| 406 | "GNU Diffutils is a package containing tools for finding the
|
| 407 | differences between files. The \"diff\" command is used to show how two files
|
| 408 | differ, while \"cmp\" shows the offsets and line numbers where they differ.
|
| 409 | \"diff3\" allows you to compare three files. Finally, \"sdiff\" offers an
|
| 410 | interactive means to merge two files.")
|
| 411 | (license gpl3+)
|
| 412 | (home-page "https://www.gnu.org/software/diffutils/")))
|
| 413 |
|
| 414 | (define-public findutils
|
| 415 | (package
|
| 416 | (name "findutils")
|
| 417 | (version "4.10.0")
|
| 418 | (source (origin
|
| 419 | (method url-fetch)
|
| 420 | (uri (string-append "mirror://gnu/findutils/findutils-"
|
| 421 | version ".tar.xz"))
|
| 422 | (sha256
|
| 423 | (base32
|
| 424 | "1xd4y24qfsdfp3ndz7d5j49lkhbhpzgr13wrvsmx4izjgyvf11qk"))
|
| 425 | (patches (search-patches "findutils-localstatedir.patch"))))
|
| 426 | (build-system gnu-build-system)
|
| 427 | (arguments
|
| 428 | `(#:configure-flags (list
|
| 429 | |
| 430 | ,@(if (target-hurd32?)
|
| 431 | '("--disable-year2038")
|
| 432 | '())
|
| 433 | |
| 434 | "--localstatedir=/var")
|
| 435 | #:phases (modify-phases %standard-phases
|
| 436 | (add-before 'check 'adjust-test-shebangs
|
| 437 | (lambda _
|
| 438 | (substitute* '("tests/xargs/verbose-quote.sh"
|
| 439 | "tests/find/exec-plus-last-file.sh")
|
| 440 | (("#!/bin/sh")
|
| 441 | (string-append "#!" (which "sh"))))))
|
| 442 | ,@(if (system-hurd?)
|
| 443 | '((add-after 'unpack 'skip-tests
|
| 444 | (lambda _
|
| 445 | (substitute*
|
| 446 | |
| 447 | "gnulib-tests/test-strerror_r.c"
|
| 448 | (("(^| )main *\\(.*" all)
|
| 449 | (string-append all "{\n exit (77);//"))))))
|
| 450 | '()))))
|
| 451 | (synopsis "Operating on files matching given criteria")
|
| 452 | (description
|
| 453 | "Findutils supplies the basic file directory searching utilities of the
|
| 454 | GNU system. It consists of two primary searching utilities: \"find\"
|
| 455 | recursively searches for files in a directory according to given criteria and
|
| 456 | \"locate\" lists files in a database that match a query. Two auxiliary tools
|
| 457 | are included: \"updatedb\" updates the file name database and \"xargs\" may be
|
| 458 | used to apply commands with arbitrarily long arguments.")
|
| 459 | (license gpl3+)
|
| 460 | (home-page "https://www.gnu.org/software/findutils/")))
|
| 461 |
|
| 462 | (define-public coreutils
|
| 463 | (package
|
| 464 | (name "coreutils")
|
| 465 | (version "9.1")
|
| 466 | (source (origin
|
| 467 | (method url-fetch)
|
| 468 | (uri (string-append "mirror://gnu/coreutils/coreutils-"
|
| 469 | version ".tar.xz"))
|
| 470 | (sha256
|
| 471 | (base32
|
| 472 | "08q4b0w7mwfxbqjs712l6wrwl2ijs7k50kssgbryg9wbsw8g98b1"))))
|
| 473 | (build-system gnu-build-system)
|
| 474 | (inputs `(,acl |
| 475 | ,attr |
| 476 | ,gmp |
| 477 |
|
| 478 | |
| 479 | |
| 480 | ,@(if (and (not (%current-target-system))
|
| 481 | (member (%current-system)
|
| 482 | (package-supported-systems libcap)))
|
| 483 | `(,libcap) |
| 484 | '())))
|
| 485 | (native-inputs
|
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | (if (%current-target-system)
|
| 491 | '()
|
| 492 | (list perl)))
|
| 493 | (outputs '("out" "debug"))
|
| 494 | (arguments
|
| 495 | `(#:parallel-build? #f |
| 496 | ,@(if (system-hurd?)
|
| 497 | '(#:make-flags |
| 498 | (list (string-append "XFAIL_TESTS="
|
| 499 | |
| 500 | " test-fdutimensat"
|
| 501 | " test-futimens"
|
| 502 | " test-linkat"
|
| 503 | " test-renameat"
|
| 504 | " test-renameatu"
|
| 505 | " test-utimensat")))
|
| 506 | '())
|
| 507 | #:phases (modify-phases %standard-phases
|
| 508 | (add-before 'build 'patch-shell-references
|
| 509 | (lambda _
|
| 510 | |
| 511 | |
| 512 | (setenv "SHELL" (which "sh"))
|
| 513 |
|
| 514 | (substitute* (find-files "gnulib-tests" "\\.c$")
|
| 515 | (("/bin/sh") (which "sh")))
|
| 516 | (substitute* (find-files "tests" "\\.sh$")
|
| 517 | (("#!/bin/sh") (string-append "#!" (which "sh"))))))
|
| 518 | (add-after 'unpack 'remove-tests
|
| 519 | (lambda _
|
| 520 | ,@(if (system-hurd?)
|
| 521 | '((substitute*
|
| 522 | |
| 523 | '("tests/cp/sparse-to-pipe.sh"
|
| 524 | "tests/split/fail.sh"
|
| 525 | |
| 526 | "tests/dd/nocache.sh"
|
| 527 | |
| 528 | "tests/cp/parent-perm-race.sh"
|
| 529 | "tests/cp/sparse.sh"
|
| 530 | "tests/cp/special-f.sh"
|
| 531 | "tests/dd/bytes.sh"
|
| 532 | "tests/dd/stats.sh"
|
| 533 | "tests/ls/dangle.sh"
|
| 534 | "tests/ls/follow-slink.sh"
|
| 535 | "tests/ls/hyperlink.sh"
|
| 536 | "tests/ls/infloop.sh"
|
| 537 | "tests/ls/inode.sh"
|
| 538 | "tests/ls/selinux-segfault.sh"
|
| 539 | "tests/misc/env-S.pl"
|
| 540 | "tests/misc/factor-parallel.sh"
|
| 541 | "tests/misc/ls-misc.pl"
|
| 542 | "tests/misc/nice.sh"
|
| 543 | "tests/misc/pwd-long.sh"
|
| 544 | "tests/misc/shred-passes.sh"
|
| 545 | "tests/misc/stat-slash.sh"
|
| 546 | "tests/rm/fail-eperm.xpl"
|
| 547 | "tests/split/filter.sh")
|
| 548 | (("^#!.*" all)
|
| 549 | (string-append all "exit 77;\n")))
|
| 550 | (substitute* "gnulib-tests/Makefile.in"
|
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | ((" test-tls\\$\\(EXEEXT\\) ") " ")))
|
| 556 | '())
|
| 557 | ,@(if (system-hurd64?)
|
| 558 | '((substitute*
|
| 559 | |
| 560 | '("tests/misc/sort-NaN-infloop.sh")
|
| 561 | (("^#!.*" all)
|
| 562 | (string-append all "exit 77;\n"))))
|
| 563 | '())
|
| 564 | |
| 565 | (substitute* "tests/cp/reflink-auto.sh"
|
| 566 | (("^#!.*" all)
|
| 567 | (string-append all "exit 77;\n")))
|
| 568 | (substitute* "Makefile.in"
|
| 569 | |
| 570 | |
| 571 | (("^ *tests/tail-2/inotify-dir-recreate.sh.*") "")))))))
|
| 572 | (synopsis "Core GNU utilities (file, text, shell)")
|
| 573 | (description
|
| 574 | "GNU Coreutils package includes all of the basic command-line tools that
|
| 575 | are expected in a POSIX system, excluding shell. This package is the union of
|
| 576 | the GNU fileutils, sh-utils, and textutils packages. Most of these tools
|
| 577 | offer extended functionality beyond that which is outlined in the POSIX
|
| 578 | standard.")
|
| 579 | (license gpl3+)
|
| 580 | (home-page "https://www.gnu.org/software/coreutils/")))
|
| 581 |
|
| 582 | (define-public coreutils-minimal
|
| 583 | |
| 584 | (package
|
| 585 | (inherit coreutils)
|
| 586 | (name "coreutils-minimal")
|
| 587 | (outputs '("out"))
|
| 588 | (native-inputs '())
|
| 589 | (inputs '())))
|
| 590 |
|
| 591 | (define-public coreutils-8.30
|
| 592 | |
| 593 | (hidden-package
|
| 594 | (package
|
| 595 | (inherit coreutils-minimal)
|
| 596 | (version "8.30")
|
| 597 | (source (origin
|
| 598 | (method url-fetch)
|
| 599 | (uri (string-append "mirror://gnu/coreutils/coreutils-"
|
| 600 | version ".tar.xz"))
|
| 601 | (sha256
|
| 602 | (base32
|
| 603 | "0mxhw43d4wpqmvg0l4znk1vm10fy92biyh90lzdnqjcic2lb6cg8"))))
|
| 604 | (arguments
|
| 605 | (substitute-keyword-arguments arguments
|
| 606 | ((#:phases phases '%standard-phases)
|
| 607 | `(modify-phases ,phases
|
| 608 | (add-before 'check 'disable-broken-test
|
| 609 | (lambda _
|
| 610 | |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | (substitute* "Makefile"
|
| 616 | (("^.*tests/misc/env-S.pl.*$") "")))))))))))
|
| 617 |
|
| 618 | (define-public gnu-make
|
| 619 | (package
|
| 620 | (name "make")
|
| 621 | (version "4.4.1")
|
| 622 | (source (origin
|
| 623 | (method url-fetch)
|
| 624 | (uri (string-append "mirror://gnu/make/make-" version
|
| 625 | ".tar.gz"))
|
| 626 | (sha256
|
| 627 | (base32
|
| 628 | "1cwgcmwdn7gqn5da2ia91gkyiqs9birr10sy5ykpkaxzcwfzn5nx"))
|
| 629 | (patches (search-patches "make-impure-dirs.patch"))))
|
| 630 | (build-system gnu-build-system)
|
| 631 | (native-inputs (list pkg-config)) |
| 632 | (inputs (list guile-3.0))
|
| 633 | (outputs '("out" "debug"))
|
| 634 | (arguments
|
| 635 | `(,@(if (target-hurd?)
|
| 636 | '(#:configure-flags '("CFLAGS=-D__alloca=alloca"
|
| 637 | "ac_cv_func_posix_spawn=no"))
|
| 638 | '())
|
| 639 | #:phases
|
| 640 | (modify-phases %standard-phases
|
| 641 | (add-before 'build 'set-default-shell
|
| 642 | (lambda* (#:key inputs #:allow-other-keys)
|
| 643 | |
| 644 | (let ((bash (assoc-ref inputs "bash")))
|
| 645 | (substitute* "src/job.c"
|
| 646 | (("default_shell =.*$")
|
| 647 | (format #f "default_shell = \"~a/bin/sh\";\n"
|
| 648 | bash)))))))))
|
| 649 | (synopsis "Remake files automatically")
|
| 650 | (description
|
| 651 | "Make is a program that is used to control the production of
|
| 652 | executables or other files from their source files. The process is
|
| 653 | controlled from a Makefile, in which the developer specifies how each file is
|
| 654 | generated from its source. It has powerful dependency resolution and the
|
| 655 | ability to determine when files have to be regenerated after their sources
|
| 656 | change. GNU make offers many powerful extensions over the standard utility.")
|
| 657 | (license gpl3+)
|
| 658 | (home-page "https://www.gnu.org/software/make/")))
|
| 659 |
|
| 660 | (define-public gnu-make-4.2
|
| 661 | (package
|
| 662 | (inherit gnu-make)
|
| 663 | (version "4.2.1")
|
| 664 | (source (origin
|
| 665 | (method url-fetch)
|
| 666 | (uri (string-append "mirror://gnu/make/make-" version
|
| 667 | ".tar.bz2"))
|
| 668 | (sha256
|
| 669 | (base32
|
| 670 | "12f5zzyq2w56g95nni65hc0g5p7154033y2f3qmjvd016szn5qnn"))))
|
| 671 | (arguments
|
| 672 | `(#:configure-flags '("CFLAGS=-D__alloca=alloca -D__stat=stat")
|
| 673 | #:phases
|
| 674 | (modify-phases %standard-phases
|
| 675 | (add-before 'build 'set-default-shell
|
| 676 | (lambda* (#:key inputs #:allow-other-keys)
|
| 677 | |
| 678 | (let ((bash (assoc-ref inputs "bash")))
|
| 679 | (substitute* "job.c"
|
| 680 | (("default_shell =.*$")
|
| 681 | (format #f "default_shell = \"~a/bin/sh\";\n"
|
| 682 | bash)))))))))))
|
| 683 |
|
| 684 | (define-public binutils
|
| 685 | (package
|
| 686 | (name "binutils")
|
| 687 | (version "2.44")
|
| 688 | (source
|
| 689 | (origin
|
| 690 | (method url-fetch)
|
| 691 | (uri (string-append "mirror://gnu/binutils/binutils-"
|
| 692 | version ".tar.bz2"))
|
| 693 | (sha256
|
| 694 | (base32 "0fnwaasfglbphqzvz5n25js9gl695p7pjbmb1z81g8gsc6k90qzn"))
|
| 695 | (patches (search-patches
|
| 696 | "binutils-2.41-fix-cross.patch"
|
| 697 | "binutils-loongson-workaround.patch"))))
|
| 698 | (build-system gnu-build-system)
|
| 699 | (arguments
|
| 700 | (list #:out-of-source? #t |
| 701 | #:configure-flags #~'( |
| 702 | |
| 703 | "LDFLAGS=-static-libgcc"
|
| 704 |
|
| 705 | |
| 706 | |
| 707 | |
| 708 | |
| 709 | "--enable-new-dtags"
|
| 710 |
|
| 711 | |
| 712 | "--with-lib-path=/no-ld-lib-path"
|
| 713 |
|
| 714 | |
| 715 | |
| 716 | "--enable-install-libbfd"
|
| 717 |
|
| 718 | |
| 719 | |
| 720 | "--enable-deterministic-archives"
|
| 721 |
|
| 722 | "--enable-64-bit-bfd"
|
| 723 | "--enable-compressed-debug-sections=all"
|
| 724 | "--enable-lto"
|
| 725 | "--enable-separate-code"
|
| 726 | "--enable-threads")
|
| 727 |
|
| 728 | |
| 729 | |
| 730 | #:make-flags #~'("MAKEINFO=true")))
|
| 731 | (native-inputs (list bison)) |
| 732 | (synopsis "Binary utilities: bfd gas gprof ld")
|
| 733 | (description
|
| 734 | "GNU Binutils is a collection of tools for working with binary files.
|
| 735 | Perhaps the most notable are \"ld\", a linker, and \"as\", an assembler.
|
| 736 | Other tools include programs to display binary profiling information, list
|
| 737 | the strings in a binary file, and utilities for working with archives. The
|
| 738 | \"bfd\" library for working with executable and object formats is also
|
| 739 | included.")
|
| 740 | (license gpl3+)
|
| 741 | (home-page "https://www.gnu.org/software/binutils/")))
|
| 742 |
|
| 743 | |
| 744 | |
| 745 | |
| 746 | (define-public binutils-2.33
|
| 747 | (package
|
| 748 | (inherit binutils)
|
| 749 | (version "2.33.1")
|
| 750 | (source (origin
|
| 751 | (inherit (package-source binutils))
|
| 752 | (uri (string-append "mirror://gnu/binutils/binutils-"
|
| 753 | version ".tar.bz2"))
|
| 754 | (sha256
|
| 755 | (base32
|
| 756 | "1cmd0riv37bqy9mwbg6n3523qgr8b3bbm5kwj19sjrasl4yq9d0c"))
|
| 757 | (patches '())))
|
| 758 | (arguments
|
| 759 | (substitute-keyword-arguments arguments
|
| 760 | ((#:make-flags _ #~'()) #~'())))
|
| 761 | (native-inputs '())
|
| 762 | (properties '())))
|
| 763 |
|
| 764 | (define-public binutils-gold
|
| 765 | (package
|
| 766 | (inherit binutils)
|
| 767 | (name "binutils-gold")
|
| 768 | (version "2.44")
|
| 769 | (source
|
| 770 | (origin
|
| 771 | (inherit (package-source binutils))
|
| 772 | (uri (string-append "mirror://gnu/binutils/binutils-with-gold-"
|
| 773 | version ".tar.bz2"))
|
| 774 | (sha256
|
| 775 | (base32 "1j64m2czn9ygd5g1cjjcw7q43b18xh6qkrdl1pkm03ncjnj3wwrl"))))
|
| 776 | (arguments
|
| 777 | (substitute-keyword-arguments arguments
|
| 778 | ((#:configure-flags flags)
|
| 779 | #~(cons* "--enable-gold=default"
|
| 780 | (delete "LDFLAGS=-static-libgcc" #$flags)))
|
| 781 | ((#:phases phases '%standard-phases)
|
| 782 | #~(modify-phases #$phases
|
| 783 | (add-after 'patch-source-shebangs 'patch-more-shebangs
|
| 784 | (lambda _
|
| 785 | (substitute* "gold/Makefile.in"
|
| 786 | (("/bin/sh") (which "sh")))))
|
| 787 | |
| 788 | #$@(if (or (target-arm?)
|
| 789 | (target-ppc32?))
|
| 790 | #~((add-after 'unpack 'skip-gold-testsuite
|
| 791 | (lambda _
|
| 792 | (substitute* "gold/Makefile.in"
|
| 793 | ((" testsuite") " ")))))
|
| 794 | #~())))))
|
| 795 | (native-inputs (modify-inputs native-inputs
|
| 796 | (append bc)))))
|
| 797 |
|
| 798 | (define-public libbfd
|
| 799 | (package/inherit binutils
|
| 800 | (name "libbfd")
|
| 801 | (inputs
|
| 802 | (modify-inputs (package-native-inputs binutils)
|
| 803 | (append texinfo))) |
| 804 | (arguments
|
| 805 | (substitute-keyword-arguments arguments
|
| 806 | |
| 807 | ((#:configure-flags flags)
|
| 808 | #~(append #$flags '("--enable-shared" "--disable-static")))
|
| 809 | |
| 810 | ((#:phases phases #~%standard-phases)
|
| 811 | #~(modify-phases #$phases
|
| 812 | (replace 'build
|
| 813 | (lambda _
|
| 814 | (invoke "make" "-j" (number->string (parallel-job-count))
|
| 815 | "all-bfd")))
|
| 816 | (replace 'check
|
| 817 | (lambda _
|
| 818 | (invoke "make" "check-bfd"
|
| 819 | "-j" (number->string (parallel-job-count))
|
| 820 | "MAKEINFO=true")))
|
| 821 | (replace 'install
|
| 822 | (lambda _ (invoke "make" "install-bfd")))))))
|
| 823 | (synopsis "GNU BFD library for operating on object files")
|
| 824 | (description "This package provides a standalone shared library version of
|
| 825 | BFD, which is otherwise distributed and installed as part of the Binutils
|
| 826 | package release.")))
|
| 827 |
|
| 828 | (define* (make-ld-wrapper name #:key
|
| 829 | (target (const #f))
|
| 830 | binutils
|
| 831 | (linker "ld")
|
| 832 | (guile (canonical-package guile-3.0))
|
| 833 | (bash (canonical-package bash))
|
| 834 | (guile-for-build guile))
|
| 835 | "Return a package called NAME that contains a wrapper for the 'ld' program
|
| 836 | of BINUTILS, which adds '-rpath' flags to the actual 'ld' command line. The
|
| 837 | wrapper uses GUILE and BASH.
|
| 838 |
|
| 839 | TARGET must be a one-argument procedure that, given a system type, returns a
|
| 840 | cross-compilation target triplet or #f. When the result is not #f, make a
|
| 841 | wrapper for the cross-linker for that target, called 'TARGET-ld'. To use a
|
| 842 | different linker than the default \"ld\", such as \"ld.gold\" the linker name
|
| 843 | can be provided via the LINKER argument."
|
| 844 | |
| 845 | |
| 846 | |
| 847 | (package
|
| 848 | (name name)
|
| 849 | (version "0")
|
| 850 | (source #f)
|
| 851 | (build-system trivial-build-system)
|
| 852 | (inputs `(("binutils" ,binutils)
|
| 853 | ("guile" ,guile)
|
| 854 | ("bash" ,bash)
|
| 855 | ("wrapper" ,(search-path %load-path
|
| 856 | "gnu/packages/ld-wrapper.in"))))
|
| 857 | (arguments
|
| 858 | (let ((target (target (%current-system))))
|
| 859 | `(#:guile ,guile-for-build
|
| 860 | #:modules ((guix build utils))
|
| 861 | #:builder (begin
|
| 862 | (use-modules (guix build utils)
|
| 863 | (system base compile))
|
| 864 |
|
| 865 | (let* ((out (assoc-ref %outputs "out"))
|
| 866 | (bin (string-append out "/bin"))
|
| 867 | (ld ,(if target
|
| 868 | `(string-append bin "/" ,target "-"
|
| 869 | ,linker)
|
| 870 | `(string-append bin "/" ,linker)))
|
| 871 | (go (string-append ld ".go")))
|
| 872 |
|
| 873 | (setvbuf (current-output-port)
|
| 874 | (cond-expand (guile-2.0 _IOLBF)
|
| 875 | (else 'line)))
|
| 876 | (format #t "building ~s/bin/ld wrapper in ~s~%"
|
| 877 | (assoc-ref %build-inputs "binutils")
|
| 878 | out)
|
| 879 |
|
| 880 | (mkdir-p bin)
|
| 881 | (copy-file (assoc-ref %build-inputs "wrapper") ld)
|
| 882 | (substitute* ld
|
| 883 | (("@SELF@")
|
| 884 | ld)
|
| 885 | (("@GUILE@")
|
| 886 | (string-append (assoc-ref %build-inputs "guile")
|
| 887 | "/bin/guile"))
|
| 888 | (("@BASH@")
|
| 889 | (string-append (assoc-ref %build-inputs "bash")
|
| 890 | "/bin/bash"))
|
| 891 | (("@LD@")
|
| 892 | (string-append (assoc-ref %build-inputs "binutils")
|
| 893 | ,(if target
|
| 894 | (string-append "/bin/"
|
| 895 | target "-" linker)
|
| 896 | (string-append "/bin/" linker)))))
|
| 897 | (chmod ld #o555)
|
| 898 | (compile-file ld #:output-file go))))))
|
| 899 | (synopsis "The linker wrapper")
|
| 900 | (description
|
| 901 | "The linker wrapper (or @code{ld-wrapper}) wraps the linker to add any
|
| 902 | missing @code{-rpath} flags, and to detect any misuse of libraries outside of
|
| 903 | the store.")
|
| 904 | (home-page "https://www.gnu.org/software/guix//")
|
| 905 | (license gpl3+)))
|
| 906 |
|
| 907 | (define %glibc-patches
|
| 908 | (list "glibc-ldd-powerpc.patch"
|
| 909 | "glibc-2.41-ldd-x86_64.patch"
|
| 910 | "glibc-2.40-dl-cache.patch"
|
| 911 | "glibc-2.37-versioned-locpath.patch"
|
| 912 | |
| 913 | "glibc-guix-locpath.patch"
|
| 914 | "glibc-reinstate-prlimit64-fallback.patch"
|
| 915 | "glibc-supported-locales.patch"
|
| 916 | "glibc-2.37-hurd-clock_t_centiseconds.patch"
|
| 917 | "glibc-2.41-hurd-local-clock_gettime_MONOTONIC.patch"
|
| 918 | "glibc-hurd-mach-print.patch"
|
| 919 | "glibc-hurd-gettyent.patch"
|
| 920 | "glibc-hurd-getauxval.patch"
|
| 921 | "glibc-hurd-pthread_setcancelstate.patch"
|
| 922 | "glibc-hurd-signal-fpe-exception.patch"
|
| 923 | "glibc-hurd-xstate.patch"
|
| 924 | "glibc-hurd-2.41-pthread-once.patch"
|
| 925 | "glibc-hurd-2.41-pthread-sigmask.patch"
|
| 926 | "glibc-hurd-2.41-symlink.patch"
|
| 927 | "glibc-hurd64-gcc-14.2-tls-bug.patch"))
|
| 928 |
|
| 929 | (define-public glibc
|
| 930 | |
| 931 | |
| 932 | (package
|
| 933 | (name "glibc")
|
| 934 | (version "2.41")
|
| 935 | (source (origin
|
| 936 | (method url-fetch)
|
| 937 | (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
|
| 938 | (sha256
|
| 939 | (base32
|
| 940 | "00g95047sshv0zxk9ja3mi7lzwi8wh8qx0nxngbvgmj5yli6p8m5"))
|
| 941 | (patches (map search-patch %glibc-patches))))
|
| 942 | (properties `((lint-hidden-cve . ("CVE-2024-2961"
|
| 943 | "CVE-2024-33601" "CVE-2024-33602"
|
| 944 | "CVE-2024-33600" "CVE-2024-33599"))))
|
| 945 | (build-system gnu-build-system)
|
| 946 |
|
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | (propagated-inputs
|
| 952 | (if (target-hurd?)
|
| 953 | `(("hurd-core-headers" ,hurd-core-headers))
|
| 954 | `(("kernel-headers" ,linux-libre-headers))))
|
| 955 |
|
| 956 | (outputs '("out" "debug"
|
| 957 | "static")) |
| 958 |
|
| 959 | (arguments
|
| 960 | `(#:out-of-source? #t
|
| 961 |
|
| 962 | |
| 963 | |
| 964 | |
| 965 | |
| 966 | #:validate-runpath? #f
|
| 967 |
|
| 968 | #:modules ((ice-9 ftw)
|
| 969 | (srfi srfi-1)
|
| 970 | (srfi srfi-26)
|
| 971 | (guix build utils)
|
| 972 | (guix build gnu-build-system))
|
| 973 |
|
| 974 | |
| 975 | |
| 976 | #:strip-flags '("--strip-debug")
|
| 977 |
|
| 978 | #:configure-flags
|
| 979 | (list "--sysconfdir=/etc"
|
| 980 |
|
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | (string-append "libc_cv_complocaledir=/run/current-system/locale/"
|
| 997 | ,(version-major+minor version))
|
| 998 |
|
| 999 | (string-append "--with-headers="
|
| 1000 | (assoc-ref ,(if (%current-target-system)
|
| 1001 | '%build-target-inputs
|
| 1002 | '%build-inputs)
|
| 1003 | "kernel-headers")
|
| 1004 | "/include")
|
| 1005 |
|
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | "--enable-kernel=3.2.0"
|
| 1010 |
|
| 1011 | |
| 1012 | (string-append "BASH_SHELL="
|
| 1013 | (assoc-ref %build-inputs "bash")
|
| 1014 | "/bin/bash")
|
| 1015 |
|
| 1016 | |
| 1017 | |
| 1018 | ,@(if (target-hurd?)
|
| 1019 | `("--disable-werror")
|
| 1020 | '()))
|
| 1021 |
|
| 1022 | #:tests? #f |
| 1023 | #:phases (modify-phases %standard-phases
|
| 1024 | (add-before
|
| 1025 | 'configure 'pre-configure
|
| 1026 | (lambda* (#:key inputs native-inputs outputs
|
| 1027 | #:allow-other-keys)
|
| 1028 | (let* ((out (assoc-ref outputs "out"))
|
| 1029 | (bin (string-append out "/bin"))
|
| 1030 | |
| 1031 | |
| 1032 | (bash (or (assoc-ref inputs "static-bash")
|
| 1033 | (assoc-ref native-inputs "static-bash"))))
|
| 1034 | |
| 1035 | (substitute* "inet/Makefile"
|
| 1036 | (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
|
| 1037 | (string-append out "/etc/rpc" suffix "\n"))
|
| 1038 | (("^install-others =.*$")
|
| 1039 | (string-append "install-others = " out "/etc/rpc\n")))
|
| 1040 |
|
| 1041 | (substitute* "Makeconfig"
|
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | ((" -lgcc_s") ""))
|
| 1047 |
|
| 1048 | |
| 1049 | (substitute* "elf/dl-cache.c"
|
| 1050 | (("@STORE_DIRECTORY@")
|
| 1051 | (string-append "\"" (%store-directory) "\"")))
|
| 1052 |
|
| 1053 | |
| 1054 | (substitute* "sysdeps/posix/system.c"
|
| 1055 | (("#define[[:blank:]]+SHELL_PATH.*$")
|
| 1056 | (format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
|
| 1057 | bash)))
|
| 1058 |
|
| 1059 | |
| 1060 | (substitute* "libio/iopopen.c"
|
| 1061 | (("/bin/sh")
|
| 1062 | (string-append bash "/bin/sh")))
|
| 1063 |
|
| 1064 | |
| 1065 | |
| 1066 | (substitute* (find-files "." "^paths\\.h$")
|
| 1067 | (("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
|
| 1068 | (string-append "#define _PATH_BSHELL \""
|
| 1069 | bash "/bin/sh\"\n")))
|
| 1070 |
|
| 1071 | |
| 1072 | |
| 1073 | (substitute* "malloc/mtrace.pl"
|
| 1074 | (("^#!.*")
|
| 1075 | |
| 1076 | |
| 1077 | "")
|
| 1078 | (("exec @PERL@")
|
| 1079 | "exec perl")))))
|
| 1080 |
|
| 1081 | (add-after 'install 'move-static-libs
|
| 1082 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1083 | |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 |
|
| 1094 | (define (empty-static-library? file)
|
| 1095 | |
| 1096 | |
| 1097 | (let ((file (string-append (assoc-ref outputs "out")
|
| 1098 | "/lib/" file)))
|
| 1099 | (and (ar-file? file)
|
| 1100 | (= (stat:size (stat file)) 8))))
|
| 1101 |
|
| 1102 | (define (static-library? file)
|
| 1103 | |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | (and (string-suffix? ".a" file)
|
| 1108 | (not (string-contains file "_nonshared"))
|
| 1109 | (not (empty-static-library? file))))
|
| 1110 |
|
| 1111 | (define (linker-script? file)
|
| 1112 | |
| 1113 | |
| 1114 | (and (not (ar-file? file))
|
| 1115 | (not (elf-file? file))))
|
| 1116 |
|
| 1117 | (let* ((out (assoc-ref outputs "out"))
|
| 1118 | (lib (string-append out "/lib"))
|
| 1119 | (files (scandir lib static-library?))
|
| 1120 | (empty (scandir lib empty-static-library?))
|
| 1121 | (static (assoc-ref outputs "static"))
|
| 1122 | (slib (string-append static "/lib")))
|
| 1123 | (mkdir-p slib)
|
| 1124 | (for-each (lambda (base)
|
| 1125 | (rename-file (string-append lib "/" base)
|
| 1126 | (string-append slib "/" base)))
|
| 1127 | files)
|
| 1128 | (for-each (lambda (base)
|
| 1129 | (copy-file (string-append lib "/" base)
|
| 1130 | (string-append slib "/" base)))
|
| 1131 | empty)
|
| 1132 |
|
| 1133 | |
| 1134 | |
| 1135 | |
| 1136 | (for-each (lambda (ld-script)
|
| 1137 | (substitute* ld-script
|
| 1138 | ((out) static)))
|
| 1139 | (filter linker-script?
|
| 1140 | (map (cut string-append slib "/" <>)
|
| 1141 | files))))))
|
| 1142 |
|
| 1143 | (add-after 'install 'install-utf8-c-locale
|
| 1144 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1145 | |
| 1146 | |
| 1147 | (let* ((out (assoc-ref outputs "out"))
|
| 1148 | (bin (string-append out "/bin"))
|
| 1149 | (locale (string-append out "/lib/locale/"
|
| 1150 | ,(package-version
|
| 1151 | this-package))))
|
| 1152 | (mkdir-p locale)
|
| 1153 |
|
| 1154 | |
| 1155 | |
| 1156 | (invoke ,(if (%current-target-system)
|
| 1157 | "true"
|
| 1158 | '(string-append bin "/localedef"))
|
| 1159 | "--no-archive" "--prefix" locale
|
| 1160 | "-i" "C" "-f" "UTF-8"
|
| 1161 | (string-append locale "/C.UTF-8")))))
|
| 1162 |
|
| 1163 | ,@(if (target-hurd?)
|
| 1164 | `((add-after 'install 'augment-libc.so
|
| 1165 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1166 | (let ((out (assoc-ref outputs "out")))
|
| 1167 | (substitute* (string-append out "/lib/libc.so")
|
| 1168 | (("/[^ ]+/lib/libc.so.0.3")
|
| 1169 | (string-append out "/lib/libc.so.0.3"
|
| 1170 | " libmachuser.so libhurduser.so"))))))
|
| 1171 | (add-after 'install 'create-machine-symlink
|
| 1172 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1173 | (let* ((out (assoc-ref outputs "out"))
|
| 1174 | (cpu ,(match (or (%current-target-system)
|
| 1175 | (%current-system))
|
| 1176 | ((? target-x86-32?)
|
| 1177 | "i386")
|
| 1178 | ((? target-x86-64?)
|
| 1179 | "x86_64")))
|
| 1180 | (machine (string-append
|
| 1181 | out "/include/mach/machine")))
|
| 1182 | (unless (file-exists? machine)
|
| 1183 | (symlink cpu machine))))))
|
| 1184 | '()))))
|
| 1185 |
|
| 1186 | (inputs `(("static-bash" ,static-bash)))
|
| 1187 |
|
| 1188 | |
| 1189 | |
| 1190 | (native-inputs `(("texinfo" ,texinfo)
|
| 1191 | ("perl" ,perl)
|
| 1192 | ("bison" ,bison)
|
| 1193 | ("gettext" ,gettext-minimal)
|
| 1194 | ("python" ,python-minimal)
|
| 1195 |
|
| 1196 | ,@(if (target-hurd?)
|
| 1197 | `(("mig" ,mig)
|
| 1198 | ("perl" ,perl))
|
| 1199 | '())))
|
| 1200 |
|
| 1201 | (native-search-paths
|
| 1202 | |
| 1203 | |
| 1204 | |
| 1205 | |
| 1206 | (list (search-path-specification
|
| 1207 | (variable "GUIX_LOCPATH")
|
| 1208 | (files '("lib/locale")))
|
| 1209 | $TZDIR))
|
| 1210 |
|
| 1211 | (synopsis "The GNU C Library")
|
| 1212 | (description
|
| 1213 | "Any Unix-like operating system needs a C library: the library which
|
| 1214 | defines the \"system calls\" and other basic facilities such as open, malloc,
|
| 1215 | printf, exit...
|
| 1216 |
|
| 1217 | The GNU C library is used as the C library in the GNU system and most systems
|
| 1218 | with the Linux kernel.")
|
| 1219 | (license lgpl2.0+)
|
| 1220 | (home-page "https://www.gnu.org/software/libc/")))
|
| 1221 |
|
| 1222 | |
| 1223 | |
| 1224 | (define-public glibc-for-fhs
|
| 1225 | (hidden-package
|
| 1226 | (package/inherit glibc
|
| 1227 | (name "glibc-for-fhs")
|
| 1228 | (source (origin (inherit (package-source glibc))
|
| 1229 | |
| 1230 | |
| 1231 | |
| 1232 | (patches
|
| 1233 | (delete (search-patch "glibc-2.40-dl-cache.patch")
|
| 1234 | (origin-patches (package-source glibc)))))))))
|
| 1235 |
|
| 1236 | |
| 1237 | |
| 1238 |
|
| 1239 | (define-public glibc-2.39
|
| 1240 | (package
|
| 1241 | (inherit glibc)
|
| 1242 | (version "2.39")
|
| 1243 | (source (origin
|
| 1244 | (method url-fetch)
|
| 1245 | (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
|
| 1246 | (sha256
|
| 1247 | (base32
|
| 1248 | "09nrwb0ksbah9k35jchd28xxp2hidilqdgz7b8v5f30pz1yd8yzp"))
|
| 1249 | (patches (search-patches "glibc-2.39-git-updates.patch"
|
| 1250 | "glibc-ldd-powerpc.patch"
|
| 1251 | "glibc-2.38-ldd-x86_64.patch"
|
| 1252 | "glibc-dl-cache.patch"
|
| 1253 | "glibc-2.37-versioned-locpath.patch"
|
| 1254 | |
| 1255 | "glibc-reinstate-prlimit64-fallback.patch"
|
| 1256 | "glibc-supported-locales.patch"
|
| 1257 | "glibc-2.37-hurd-clock_t_centiseconds.patch"
|
| 1258 | |
| 1259 | "glibc-hurd-mach-print.patch"
|
| 1260 | "glibc-hurd-gettyent.patch"
|
| 1261 | "glibc-hurd-getauxval.patch"))))))
|
| 1262 |
|
| 1263 | (define-public glibc-2.35
|
| 1264 | (package
|
| 1265 | (inherit glibc)
|
| 1266 | (version "2.35")
|
| 1267 | (source (origin
|
| 1268 | (method url-fetch)
|
| 1269 | (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
|
| 1270 | (sha256
|
| 1271 | (base32
|
| 1272 | "0bpm1kfi09dxl4c6aanc5c9951fmf6ckkzay60cx7k37dcpp68si"))
|
| 1273 | (patches (search-patches "glibc-2.35-CVE-2023-4911.patch"
|
| 1274 | "glibc-ldd-powerpc.patch"
|
| 1275 | "glibc-ldd-x86_64.patch"
|
| 1276 | "glibc-dl-cache.patch"
|
| 1277 | "glibc-versioned-locpath.patch"
|
| 1278 | "glibc-allow-kernel-2.6.32.patch"
|
| 1279 | "glibc-reinstate-prlimit64-fallback.patch"
|
| 1280 | "glibc-supported-locales.patch"
|
| 1281 | "glibc-cross-objdump.patch"
|
| 1282 | "glibc-cross-objcopy.patch" |
| 1283 | "glibc-hurd-clock_t_centiseconds.patch"
|
| 1284 | "glibc-hurd-clock_gettime_monotonic.patch"
|
| 1285 | "glibc-hurd-mach-print.patch"
|
| 1286 | "glibc-hurd-gettyent.patch"))))
|
| 1287 | (arguments
|
| 1288 | (substitute-keyword-arguments arguments
|
| 1289 | ((#:configure-flags flags #~'())
|
| 1290 | #~(cons* "CFLAGS=-g -O2 -Wno-error=builtin-declaration-mismatch"
|
| 1291 | "--enable-crypt"
|
| 1292 | |
| 1293 | |
| 1294 | |
| 1295 | |
| 1296 | |
| 1297 | "libc_cv_cxx_link_ok=no"
|
| 1298 | #$flags))
|
| 1299 | ((#:phases phases)
|
| 1300 | |
| 1301 | |
| 1302 | |
| 1303 | `(modify-phases ,phases
|
| 1304 | (delete 'install-utf8-c-locale)))))))
|
| 1305 |
|
| 1306 | (define-public glibc-2.33
|
| 1307 | (package
|
| 1308 | (inherit glibc)
|
| 1309 | (name "glibc")
|
| 1310 | (version "2.33")
|
| 1311 | (source (origin
|
| 1312 | (method url-fetch)
|
| 1313 | (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
|
| 1314 | (sha256
|
| 1315 | (base32
|
| 1316 | "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f"))
|
| 1317 | (patches
|
| 1318 | (cons (search-patch "glibc-2.33-riscv64-miscompilation.patch")
|
| 1319 | |
| 1320 | |
| 1321 | (remove
|
| 1322 | (lambda (patch)
|
| 1323 | (member (basename patch)
|
| 1324 | '("glibc-2.35-CVE-2023-4911.patch"
|
| 1325 | "glibc-hurd-clock_gettime_monotonic.patch")))
|
| 1326 | (origin-patches (package-source glibc-2.35)))))))
|
| 1327 | (arguments
|
| 1328 | (substitute-keyword-arguments arguments
|
| 1329 | ((#:configure-flags flags #~'())
|
| 1330 | #~(cons* #$(string-append
|
| 1331 | "CFLAGS=-g -O2"
|
| 1332 | " -Wno-error=builtin-declaration-mismatch"
|
| 1333 | " -Wno-error=format-overflow"
|
| 1334 | " -Wno-error=stringop-overflow"
|
| 1335 | " -Wno-error=use-after-free")
|
| 1336 | "--enable-crypt"
|
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | "libc_cv_cxx_link_ok=no"
|
| 1343 | #$flags))
|
| 1344 | ((#:phases phases)
|
| 1345 | `(modify-phases ,phases
|
| 1346 | |
| 1347 | (delete 'install-utf8-c-locale)))))))
|
| 1348 |
|
| 1349 | (define-public (make-gcc-libc base-gcc libc)
|
| 1350 | "Return a GCC that targets LIBC."
|
| 1351 | (package (inherit base-gcc)
|
| 1352 | (name (string-append (package-name base-gcc) "-"
|
| 1353 | (package-name libc) "-"
|
| 1354 | (package-version libc)))
|
| 1355 | (arguments
|
| 1356 | (ensure-keyword-arguments (package-arguments base-gcc)
|
| 1357 | '(#:implicit-inputs? #f)))
|
| 1358 | (native-inputs
|
| 1359 | `(,@(package-native-inputs base-gcc)
|
| 1360 | ,@(append (fold alist-delete (%final-inputs) '("libc" "libc:static")))
|
| 1361 | ("libc" ,libc)
|
| 1362 | ("libc:static" ,libc "static")))))
|
| 1363 |
|
| 1364 | (define-public (make-glibc-locales glibc)
|
| 1365 | (package
|
| 1366 | (inherit glibc)
|
| 1367 | (name "glibc-locales")
|
| 1368 | (source (origin (inherit (package-source glibc))
|
| 1369 | (patches (cons (search-patch "glibc-locales.patch")
|
| 1370 | (origin-patches (package-source glibc))))))
|
| 1371 | (synopsis "All the locales supported by the GNU C Library")
|
| 1372 | (description
|
| 1373 | "This package provides all the locales supported by the GNU C Library,
|
| 1374 | more than 400 in total. To use them set the @code{LOCPATH} environment variable
|
| 1375 | to the @code{share/locale} sub-directory of this package.")
|
| 1376 | (outputs '("out")) |
| 1377 | (native-search-paths '())
|
| 1378 | (arguments
|
| 1379 | (let ((args `(#:tests? #f #:strip-binaries? #f
|
| 1380 | ,@(package-arguments glibc))))
|
| 1381 | (substitute-keyword-arguments args
|
| 1382 | ((#:modules modules '((guix build utils)
|
| 1383 | (guix build gnu-build-system)))
|
| 1384 | `((srfi srfi-11)
|
| 1385 | (gnu build locale)
|
| 1386 | ,@modules))
|
| 1387 | ((#:imported-modules modules '())
|
| 1388 | `((gnu build locale)
|
| 1389 | ,@%default-gnu-imported-modules))
|
| 1390 | ((#:phases phases)
|
| 1391 | #~(modify-phases #$phases
|
| 1392 | (replace 'build
|
| 1393 | (lambda _
|
| 1394 | (invoke "make" "localedata/install-locales"
|
| 1395 | "-j" (number->string (parallel-job-count)))))
|
| 1396 | (add-after 'build 'symlink-normalized-codesets
|
| 1397 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1398 | |
| 1399 | |
| 1400 | |
| 1401 | (define (locale-directory? file stat)
|
| 1402 | (and (file-is-directory? file)
|
| 1403 | (string-index (basename file) #\_)
|
| 1404 | (string-rindex (basename file) #\.)))
|
| 1405 |
|
| 1406 | (let* ((locales (find-files #$output locale-directory?
|
| 1407 | #:directories? #t)))
|
| 1408 | (for-each (lambda (directory)
|
| 1409 | (let*-values (((base)
|
| 1410 | (basename directory))
|
| 1411 | ((name codeset)
|
| 1412 | (locale->name+codeset base))
|
| 1413 | ((normalized)
|
| 1414 | (normalize-codeset codeset)))
|
| 1415 | (unless (string=? codeset normalized)
|
| 1416 | (symlink base
|
| 1417 | (string-append (dirname directory)
|
| 1418 | "/" name "."
|
| 1419 | normalized)))))
|
| 1420 | locales))))
|
| 1421 | #$@(if (target-hurd?)
|
| 1422 | #~((delete 'augment-libc.so)
|
| 1423 | (delete 'create-machine-symlink))
|
| 1424 | #~())
|
| 1425 | (delete 'install)
|
| 1426 | (delete 'install-utf8-c-locale)
|
| 1427 | (delete 'move-static-libs)))
|
| 1428 | ((#:configure-flags flags)
|
| 1429 | #~(append #$flags
|
| 1430 | |
| 1431 | (list (string-append "libc_cv_complocaledir="
|
| 1432 | #$output
|
| 1433 | "/lib/locale/"
|
| 1434 | #$(version-major+minor
|
| 1435 | (package-version glibc)))))))))
|
| 1436 | (properties `((upstream-name . "glibc")))))
|
| 1437 |
|
| 1438 | (define %default-utf8-locales
|
| 1439 | |
| 1440 | |
| 1441 | '("C" "de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
|
| 1442 |
|
| 1443 | (define*-public (make-glibc-utf8-locales glibc #:key
|
| 1444 | (locales %default-utf8-locales)
|
| 1445 | (name "glibc-utf8-locales"))
|
| 1446 | (define default-locales?
|
| 1447 | (equal? locales %default-utf8-locales))
|
| 1448 |
|
| 1449 | (package
|
| 1450 | (name name)
|
| 1451 | (version (package-version glibc))
|
| 1452 | (source #f)
|
| 1453 | (build-system trivial-build-system)
|
| 1454 | (arguments
|
| 1455 | (list #:modules '((guix build utils))
|
| 1456 | #:builder
|
| 1457 | #~(begin
|
| 1458 | (use-modules (guix build utils))
|
| 1459 |
|
| 1460 | (let* ((libc (dirname
|
| 1461 | (search-input-file %build-inputs
|
| 1462 | "/bin/localedef")))
|
| 1463 | (gzip (dirname
|
| 1464 | (search-input-file %build-inputs
|
| 1465 | "/bin/gzip")))
|
| 1466 | (out #$output)
|
| 1467 | (localedir (string-append out "/lib/locale/"
|
| 1468 | #$(version-major+minor
|
| 1469 | (package-version this-package)))))
|
| 1470 | |
| 1471 | (setenv "PATH" (string-append libc ":" gzip ""))
|
| 1472 |
|
| 1473 | (mkdir-p localedir)
|
| 1474 | (for-each (lambda (locale)
|
| 1475 | (define file
|
| 1476 | |
| 1477 | |
| 1478 | (string-append localedir "/" locale ".utf8"))
|
| 1479 |
|
| 1480 | (invoke "localedef" "--no-archive"
|
| 1481 | "--prefix" localedir
|
| 1482 | "-i" locale
|
| 1483 | "-f" "UTF-8" file)
|
| 1484 |
|
| 1485 | |
| 1486 | |
| 1487 | (symlink (string-append locale ".utf8")
|
| 1488 | (string-append localedir "/"
|
| 1489 | locale ".UTF-8")))
|
| 1490 |
|
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | '#$(if (version>? (package-version this-package)
|
| 1495 | "2.35")
|
| 1496 | locales
|
| 1497 | (delete "C" locales)))))))
|
| 1498 | (native-inputs (list glibc gzip))
|
| 1499 | (synopsis (if default-locales?
|
| 1500 | (P_ "Small sample of UTF-8 locales")
|
| 1501 | (P_ "Customized sample of UTF-8 locales")))
|
| 1502 | (description
|
| 1503 | (if default-locales?
|
| 1504 | (P_ "This package provides a small sample of UTF-8 locales mostly useful in
|
| 1505 | test environments.")
|
| 1506 | (format #f (P_ "This package provides the following UTF-8 locales:
|
| 1507 | @itemize
|
| 1508 | ~{@item ~a~%~}
|
| 1509 | @end itemize~%")
|
| 1510 | locales)))
|
| 1511 | (home-page (package-home-page glibc))
|
| 1512 | (license (package-license glibc))))
|
| 1513 |
|
| 1514 | (define-public glibc-locales
|
| 1515 | (make-glibc-locales glibc))
|
| 1516 | (define-public glibc-utf8-locales
|
| 1517 | (hidden-package
|
| 1518 | (make-glibc-utf8-locales glibc)))
|
| 1519 |
|
| 1520 | |
| 1521 | (define-public glibc-locales-2.35
|
| 1522 | (package (inherit (make-glibc-locales glibc-2.35))
|
| 1523 | (name "glibc-locales-2.35")))
|
| 1524 | (define-public glibc-locales-2.33
|
| 1525 | (package (inherit (make-glibc-locales glibc-2.33))
|
| 1526 | (name "glibc-locales-2.33")))
|
| 1527 |
|
| 1528 | (define-public which
|
| 1529 | (package
|
| 1530 | (name "which")
|
| 1531 | (version "2.21")
|
| 1532 | (source (origin
|
| 1533 | (method url-fetch)
|
| 1534 | (uri (string-append "mirror://gnu/which/which-"
|
| 1535 | version ".tar.gz"))
|
| 1536 | (sha256
|
| 1537 | (base32
|
| 1538 | "1bgafvy3ypbhhfznwjv1lxmd6mci3x1byilnnkc7gcr486wlb8pl"))))
|
| 1539 | (build-system gnu-build-system)
|
| 1540 | (home-page "https://gnu.org/software/which/")
|
| 1541 | (synopsis "Find full path of shell commands")
|
| 1542 | (description
|
| 1543 | "The which program finds the location of executables in PATH, with a
|
| 1544 | variety of options. It is an alternative to the shell \"type\" built-in
|
| 1545 | command.")
|
| 1546 | (license gpl3+))) |
| 1547 |
|
| 1548 | (define-public glibc/hurd glibc)
|
| 1549 |
|
| 1550 | (define-public glibc/hurd-headers
|
| 1551 | (package/inherit glibc/hurd
|
| 1552 | (name "glibc-hurd-headers")
|
| 1553 | (outputs '("out"))
|
| 1554 | (propagated-inputs (list gnumach-headers hurd-headers))
|
| 1555 | (native-inputs
|
| 1556 | (modify-inputs (package-native-inputs glibc/hurd)
|
| 1557 | (prepend (if (%current-target-system)
|
| 1558 | (let* ((cross-base (resolve-interface '(gnu packages cross-base)))
|
| 1559 | (cross-mig (module-ref cross-base 'cross-mig)))
|
| 1560 | (cross-mig (%current-target-system)))
|
| 1561 | mig))))
|
| 1562 | (arguments
|
| 1563 | (substitute-keyword-arguments (package-arguments glibc/hurd)
|
| 1564 | |
| 1565 | ((#:configure-flags flags)
|
| 1566 | `(list "--enable-add-ons"))
|
| 1567 | ((#:phases _)
|
| 1568 | '(modify-phases %standard-phases
|
| 1569 | (replace 'install
|
| 1570 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1571 | (invoke "make" "install-headers")
|
| 1572 |
|
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | (let ((out (assoc-ref outputs "out")))
|
| 1577 | (close-port
|
| 1578 | (open-output-file
|
| 1579 | (string-append out "/include/gnu/stubs.h"))))))
|
| 1580 | (delete 'build))))) |
| 1581 | (supported-systems %hurd-systems)))
|
| 1582 |
|
| 1583 | (define-public glibc-utf8-locales/hurd
|
| 1584 | |
| 1585 | (hidden-package
|
| 1586 | (make-glibc-utf8-locales glibc/hurd)))
|
| 1587 |
|
| 1588 | (define* (libc-for-target #:optional
|
| 1589 | (target (or (%current-target-system)
|
| 1590 | (%current-system))))
|
| 1591 | (match target
|
| 1592 | ((? target-hurd?)
|
| 1593 | glibc/hurd)
|
| 1594 | (_
|
| 1595 | glibc)))
|
| 1596 |
|
| 1597 | (define-public glibc-locales/hurd
|
| 1598 | |
| 1599 | |
| 1600 | (hidden-package
|
| 1601 | (make-glibc-locales glibc/hurd)))
|
| 1602 |
|
| 1603 | (define* (libc-locales-for-target #:optional
|
| 1604 | (target (or (%current-target-system)
|
| 1605 | (%current-system))))
|
| 1606 | (if (target-hurd? target)
|
| 1607 | glibc-locales/hurd
|
| 1608 | glibc-locales))
|
| 1609 |
|
| 1610 | (define* (libc-utf8-locales-for-target #:optional
|
| 1611 | (target (or (%current-target-system)
|
| 1612 | (%current-system))))
|
| 1613 | "Return the glibc UTF-8 locale package for TARGET."
|
| 1614 | |
| 1615 | |
| 1616 | |
| 1617 | (canonical-package
|
| 1618 | (if (target-hurd? target)
|
| 1619 | glibc-utf8-locales/hurd
|
| 1620 | glibc-utf8-locales)))
|
| 1621 |
|
| 1622 | (define-public tzdata
|
| 1623 | (package
|
| 1624 | (name "tzdata")
|
| 1625 | |
| 1626 | |
| 1627 | (version "2025a")
|
| 1628 | (source (origin
|
| 1629 | (method url-fetch)
|
| 1630 | (uri (string-append
|
| 1631 | "https://data.iana.org/time-zones/releases/tzdata"
|
| 1632 | version ".tar.gz"))
|
| 1633 | (sha256
|
| 1634 | (base32
|
| 1635 | "1l7hnlgc4wgy2gmaj5zmswpzbyq23h7vsndnw2zhwibw5k3wnpsd"))))
|
| 1636 | (build-system gnu-build-system)
|
| 1637 | (arguments
|
| 1638 | (list #:tests? #f
|
| 1639 |
|
| 1640 | |
| 1641 | |
| 1642 | |
| 1643 | #:target #f
|
| 1644 |
|
| 1645 | #:make-flags
|
| 1646 | #~(let ((out #$output)
|
| 1647 | (tmp (getenv "TMPDIR")))
|
| 1648 | (list (string-append "TOPDIR=" out)
|
| 1649 | (string-append "TZDIR=" out "/share/zoneinfo")
|
| 1650 | (string-append "TZDEFAULT=" out
|
| 1651 | "/share/zoneinfo/localtime")
|
| 1652 |
|
| 1653 | |
| 1654 | (string-append "LIBDIR=" tmp "/lib")
|
| 1655 | (string-append "MANDIR=" tmp "/man")
|
| 1656 |
|
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | |
| 1661 | |
| 1662 | #$@(if (version>=? (package-version this-package)
|
| 1663 | "2020b")
|
| 1664 | '("CPPFLAGS=-DZIC_BLOAT_DEFAULT='\"fat\"'")
|
| 1665 | '())
|
| 1666 |
|
| 1667 | "AWK=awk"
|
| 1668 | "CC=gcc"))
|
| 1669 | #:modules '((guix build utils)
|
| 1670 | (guix build gnu-build-system)
|
| 1671 | (srfi srfi-1))
|
| 1672 | #:phases
|
| 1673 | #~(modify-phases %standard-phases
|
| 1674 | (replace 'unpack
|
| 1675 | (lambda* (#:key source inputs #:allow-other-keys)
|
| 1676 | (invoke "tar" "xvf" source)
|
| 1677 | (invoke "tar" "xvf"
|
| 1678 | #$(match (package-inputs this-package)
|
| 1679 | (((_ tzcode)) tzcode)))))
|
| 1680 | (add-after 'install 'post-install
|
| 1681 | (lambda* (#:key outputs #:allow-other-keys)
|
| 1682 | |
| 1683 | (let ((out (assoc-ref outputs "out")))
|
| 1684 | |
| 1685 | |
| 1686 | (delete-file-recursively (string-append out "/usr"))
|
| 1687 | (symlink (string-append out "/share/zoneinfo")
|
| 1688 | (string-append out "/share/zoneinfo/posix"))
|
| 1689 | (delete-file-recursively
|
| 1690 | (string-append out "/share/zoneinfo-posix"))
|
| 1691 | (copy-recursively (string-append out "/share/zoneinfo-leaps")
|
| 1692 | (string-append out "/share/zoneinfo/right"))
|
| 1693 | (delete-file-recursively
|
| 1694 | (string-append out "/share/zoneinfo-leaps")))))
|
| 1695 | (delete 'configure))))
|
| 1696 | (inputs (list (origin
|
| 1697 | (method url-fetch)
|
| 1698 | (uri (string-append
|
| 1699 | "https://data.iana.org/time-zones/releases/tzcode"
|
| 1700 | version ".tar.gz"))
|
| 1701 | (sha256
|
| 1702 | (base32
|
| 1703 | "0qahpwp1zlyvi7qrlm4r74pmj3c7sx3jlg9xw2siwj3nkzapk5hi")))))
|
| 1704 | (home-page "https://www.iana.org/time-zones")
|
| 1705 | (synopsis "Database of current and historical time zones")
|
| 1706 | (description "The Time Zone Database (often called tz or zoneinfo)
|
| 1707 | contains code and data that represent the history of local time for many
|
| 1708 | representative locations around the globe. It is updated periodically to
|
| 1709 | reflect changes made by political bodies to time zone boundaries, UTC offsets,
|
| 1710 | and daylight-saving rules.")
|
| 1711 | (license public-domain)))
|
| 1712 |
|
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | (define-public tzdata-for-tests tzdata)
|
| 1722 |
|
| 1723 | |
| 1724 | |
| 1725 | (define-public tzdata/leap-seconds
|
| 1726 | (hidden-package
|
| 1727 | (package/inherit tzdata
|
| 1728 | (arguments
|
| 1729 | (substitute-keyword-arguments arguments
|
| 1730 | ((#:phases phases)
|
| 1731 | #~(modify-phases #$phases
|
| 1732 | (add-after 'post-install 'install-leap-seconds
|
| 1733 | (lambda _
|
| 1734 | (install-file "leap-seconds.list"
|
| 1735 | (string-append #$output "/share/zoneinfo")))))))))))
|
| 1736 |
|
| 1737 | (define-public libiconv
|
| 1738 | (package
|
| 1739 | (name "libiconv")
|
| 1740 | (version "1.19")
|
| 1741 | (source (origin
|
| 1742 | (method url-fetch)
|
| 1743 | (uri (string-append "mirror://gnu/libiconv/libiconv-"
|
| 1744 | version ".tar.gz"))
|
| 1745 | (sha256
|
| 1746 | (base32
|
| 1747 | "19lsl729bh2zwabp7ri1hgkqxk9irmhax4f79waclkj6q2l9dpc8"))
|
| 1748 | (modules '((guix build utils)))
|
| 1749 | (snippet
|
| 1750 | |
| 1751 | |
| 1752 | '(substitute* "srclib/stdio.in.h"
|
| 1753 | (("^#undef gets") "")
|
| 1754 | (("^_GL_WARN_ON_USE \\(gets.*") "")))))
|
| 1755 | (build-system gnu-build-system)
|
| 1756 | (synopsis "Character set conversion library")
|
| 1757 | (description
|
| 1758 | "libiconv provides an implementation of the iconv function for systems
|
| 1759 | that lack it. iconv is used to convert between character encodings in a
|
| 1760 | program. It supports a wide variety of different encodings.")
|
| 1761 | (home-page "https://www.gnu.org/software/libiconv/")
|
| 1762 | (license lgpl3+)))
|
| 1763 |
|
| 1764 | (define* (libiconv-if-needed #:optional (target (%current-target-system)))
|
| 1765 | "Return either a libiconv package specification to include in a dependency
|
| 1766 | list for platforms that have an incomplete libc, or the empty list. If a
|
| 1767 | package needs iconv ,@(libiconv-if-needed) should be added."
|
| 1768 | |
| 1769 | |
| 1770 | (if (target-mingw? target)
|
| 1771 | (list libiconv)
|
| 1772 | '()))
|
| 1773 |
|
| 1774 | |
| 1775 | |
| 1776 | |
| 1777 | (define (canonical-package package)
|
| 1778 | |
| 1779 | (let* ((iface (resolve-interface '(gnu packages commencement)))
|
| 1780 | (proc (module-ref iface 'canonical-package)))
|
| 1781 | (proc package)))
|
| 1782 |
|
| 1783 | |
| 1784 | |
| 1785 | |
| 1786 | (define* (%final-inputs #:optional (system (%current-system)))
|
| 1787 | "Return the list of \"final inputs\"."
|
| 1788 | |
| 1789 | (let ((iface (resolve-interface '(gnu packages commencement))))
|
| 1790 | ((module-ref iface '%final-inputs) system)))
|
| 1791 |
|
| 1792 | |