diff options
Diffstat (limited to 'gnu/packages/base.scm')
-rw-r--r-- | gnu/packages/base.scm | 106 |
1 files changed, 66 insertions, 40 deletions
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index bc745351af..7e1177db9d 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -81,16 +81,15 @@ command-line arguments, multiple languages, and so on.") (define-public grep (package (name "grep") - (version "3.0") + (version "3.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/grep/grep-" version ".tar.xz")) (sha256 (base32 - "1dcasjp3a578nrvzrcn38mpizb8w1q6mvfzhjmcqqgkf0nsivj72")) - (patches (search-patches "grep-timing-sensitive-test.patch" - "grep-gnulib-lock.patch")))) + "0zm0ywmyz9g8vn1plw14mn8kj74yipx5qsljndbyfgmvndx5qqnv")) + (patches (search-patches "grep-timing-sensitive-test.patch")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) ;some of the tests require it (arguments @@ -293,15 +292,14 @@ used to apply commands with arbitrarily long arguments.") (define-public coreutils (package (name "coreutils") - (version "8.27") + (version "8.28") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/coreutils/coreutils-" version ".tar.xz")) (sha256 (base32 - "0sv547572iq8ayy8klir4hnngnx92a9nsazmf1wgzfc7xr4x74c8")) - (patches (search-patches "coreutils-cut-huge-range-test.patch")))) + "0r8c1bgm68kl70j1lgd0rv12iykw6143k4m9a56xip9rc2hv25qi")))) (build-system gnu-build-system) (inputs `(("acl" ,acl) ; TODO: add SELinux ("gmp" ,gmp) ;bignums in 'expr', yay! @@ -322,21 +320,18 @@ used to apply commands with arbitrarily long arguments.") (outputs '("out" "debug")) (arguments `(#:parallel-build? #f ; help2man may be called too early - #:phases (alist-cons-before - 'build 'patch-shell-references - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash"))) - ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so - ;; that tests pass, since /bin/sh isn't in the chroot. - (setenv "SHELL" (which "sh")) - - (substitute* (find-files "gnulib-tests" "\\.c$") - (("/bin/sh") - (format #f "~a/bin/sh" bash))) - (substitute* (find-files "tests" "\\.sh$") - (("#!/bin/sh") - (format #f "#!~a/bin/sh" bash))))) - %standard-phases))) + #:phases (modify-phases %standard-phases + (add-before 'build 'patch-shell-references + (lambda _ + ;; 'split' uses either $SHELL or /bin/sh. Set $SHELL so + ;; that tests pass, since /bin/sh isn't in the chroot. + (setenv "SHELL" (which "sh")) + + (substitute* (find-files "gnulib-tests" "\\.c$") + (("/bin/sh") (which "sh"))) + (substitute* (find-files "tests" "\\.sh$") + (("#!/bin/sh") (which "sh"))) + #t))))) (synopsis "Core GNU utilities (file, text, shell)") (description "GNU Coreutils includes all of the basic command-line tools that are @@ -394,16 +389,15 @@ change. GNU make offers many powerful extensions over the standard utility.") (define-public binutils (package - (replacement binutils/fixed) (name "binutils") - (version "2.28") + (version "2.28.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/binutils/binutils-" version ".tar.bz2")) (sha256 (base32 - "0wiasgns7i8km8nrxas265sh2dfpsw93b3qw195ipc90w4z475v2")) + "1sj234nd05cdgga1r36zalvvdkvpfbr12g5mir2n8i1dwsdrj939")) (patches (search-patches "binutils-ld-new-dtags.patch" "binutils-loongson-workaround.patch")))) (build-system gnu-build-system) @@ -436,19 +430,6 @@ included.") (license gpl3+) (home-page "https://www.gnu.org/software/binutils/"))) -(define binutils/fixed - (package - (inherit binutils) - ;; 2.28.1 is two characters longer than 2.28, so grafting fails due to - ;; mismatched lengths of filenames, so we have to force it to the same length. - (version "2281") - (source - (origin (inherit (package-source binutils)) - (uri "mirror://gnu/binutils/binutils-2.28.1.tar.bz2") - (sha256 - (base32 - "1sj234nd05cdgga1r36zalvvdkvpfbr12g5mir2n8i1dwsdrj939")))))) - (define* (make-ld-wrapper name #:key (target (const #f)) binutils @@ -557,7 +538,8 @@ store.") ;; users should automatically pull Linux headers as well. (propagated-inputs `(("kernel-headers" ,linux-libre-headers))) - (outputs '("out" "debug")) + (outputs '("out" "debug" + "static")) ;9 MiB of .a files (arguments `(#:out-of-source? #t @@ -568,6 +550,11 @@ store.") ;; RUNPATH checks. #:validate-runpath? #f + #:modules ((ice-9 ftw) + (srfi srfi-26) + (guix build utils) + (guix build gnu-build-system)) + #:configure-flags (list "--enable-add-ons" "--sysconfdir=/etc" @@ -672,7 +659,46 @@ store.") ;; "bilingual" eval/exec magic at the top of the file. "") (("exec @PERL@") - "exec perl")))))))) + "exec perl"))))) + + (add-after 'install 'move-static-libs + (lambda* (#:key outputs #:allow-other-keys) + ;; Move static libraries to the "static" output. + (define (static-library? file) + ;; Return true if FILE is a static library. The + ;; "_nonshared.a" files are referred to by libc.so, + ;; libpthread.so, etc., which are in fact linker + ;; scripts. + (and (string-suffix? ".a" file) + (not (string-contains file "_nonshared")))) + + (define (linker-script? file) + ;; Guess whether FILE, a ".a" file, is actually a + ;; linker script. + (and (not (ar-file? file)) + (not (elf-file? file)))) + + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (files (scandir lib static-library?)) + (static (assoc-ref outputs "static")) + (slib (string-append static "/lib"))) + (mkdir-p slib) + (for-each (lambda (base) + (rename-file (string-append lib "/" base) + (string-append slib "/" base))) + files) + + ;; Usually libm.a is a linker script so we need to + ;; change the file names in there to refer to STATIC + ;; instead of OUT. + (for-each (lambda (ld-script) + (substitute* ld-script + ((out) static))) + (filter linker-script? + (map (cut string-append slib "/" <>) + files))) + #t)))))) (inputs `(("static-bash" ,static-bash))) |