gnu: linux-libre-headers: Remove rsync dependency.

The resulting packages are bit-identical, sans for a missing empty "uapi"
directory in versions < 5.3.

* gnu/packages/commencement.scm (rsync-boot0): Remove variable.
(linux-libre-headers-boot0)[native-inputs]: Remove RSYNC-BOOT0.
* gnu/packages/linux.scm (make-linux-libre-headers*)[native-inputs]: Remove
RSYNC.
[arguments]: For newer kernel versions, run "make headers" instead of
"make headers_check" before installing.  Use FIND-FILES and INSTALL-FILE
instead of calling "make headers_install".  Remove ".install" files workaround.
This commit is contained in:
Marius Bakke 2021-05-02 19:13:23 +02:00
parent d6104e3b85
commit 0e2251fcf8
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
2 changed files with 21 additions and 32 deletions

View file

@ -50,7 +50,6 @@
#:use-module (gnu packages shells) #:use-module (gnu packages shells)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages rsync)
#:use-module (gnu packages xml) #:use-module (gnu packages xml)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
@ -2916,15 +2915,6 @@ exec " gcc "/bin/" program
#:guile ,%bootstrap-guile #:guile ,%bootstrap-guile
#:tests? #f)))) #:tests? #f))))
(define rsync-boot0
(package
(inherit rsync)
(native-inputs `(("perl" ,perl-boot0)))
(inputs (%boot0-inputs))
(arguments
`(#:implicit-inputs? #f
#:guile ,%bootstrap-guile))))
(define-syntax define/system-dependent (define-syntax define/system-dependent
(lambda (s) (lambda (s)
"Bind IDENTIFIER to EXP, where the value of EXP is known to depend on "Bind IDENTIFIER to EXP, where the value of EXP is known to depend on
@ -2960,9 +2950,6 @@ memoized as a function of '%current-system'."
;; Flex and Bison are required since version 4.16. ;; Flex and Bison are required since version 4.16.
("flex" ,flex-boot0) ("flex" ,flex-boot0)
("bison" ,bison-boot0) ("bison" ,bison-boot0)
;; Rsync is required since version 5.3.
("rsync" ,rsync-boot0)
,@(%boot0-inputs))))) ,@(%boot0-inputs)))))
(define with-boot0 (define with-boot0

View file

@ -141,7 +141,6 @@
#:use-module (gnu packages xdisorg) #:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
#:use-module (gnu packages groff) #:use-module (gnu packages groff)
#:use-module (gnu packages rsync)
#:use-module (gnu packages selinux) #:use-module (gnu packages selinux)
#:use-module (gnu packages swig) #:use-module (gnu packages swig)
#:use-module (guix build-system cmake) #:use-module (guix build-system cmake)
@ -534,14 +533,12 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
,@(if (version>=? version "4.16") ,@(if (version>=? version "4.16")
`(("flex" ,flex) `(("flex" ,flex)
("bison" ,bison)) ("bison" ,bison))
'())
,@(if (version>=? version "5.3")
`(("rsync" ,rsync))
'()))) '())))
(arguments (arguments
`(#:modules ((guix build gnu-build-system) `(#:modules ((guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-1)) (srfi srfi-1)
(ice-9 match))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure)
@ -552,32 +549,37 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
(%current-system)))) (%current-system))))
(defconfig ,(system->defconfig (defconfig ,(system->defconfig
(or (%current-target-system) (or (%current-target-system)
(%current-system))))) (%current-system))))
(make-target ,(if (version>=? version "5.3")
"headers"
"headers_check")))
(setenv "ARCH" arch) (setenv "ARCH" arch)
(format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
(invoke "make" defconfig) (invoke "make" defconfig)
(invoke "make" "mrproper" "headers_check")))) (invoke "make" "mrproper" make-target))))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(invoke "make"
(string-append "INSTALL_HDR_PATH=" out) ;; Mimic the quiet_cmd_headers_install target to avoid a
"headers_install") ;; dependency on rsync.
(for-each (lambda (file)
(let ((destination (string-append
out "/include/"
;; Drop the 'usr/include' prefix.
(match (string-split file #\/)
((_ _ path ...)
(string-join path "/"))))))
(format #t "`~a' -> `~a'~%" file destination)
(install-file file (dirname destination))))
(find-files "usr/include" "\\.h$"))
(mkdir (string-append out "/include/config")) (mkdir (string-append out "/include/config"))
(call-with-output-file (call-with-output-file
(string-append out (string-append out
"/include/config/kernel.release") "/include/config/kernel.release")
(lambda (p) (lambda (p)
(format p "~a-default~%" ,version))) (format p "~a-default~%" ,version)))))))
;; Remove the '.install' and '..install.cmd' files; the
;; latter contains store paths, which pulls in bootstrap
;; binaries in the build environment, and prevents bit
;; reproducibility for the bootstrap binaries.
(for-each delete-file (find-files out "\\.install"))
#t))))
#:allowed-references () #:allowed-references ()
#:tests? #f)) #:tests? #f))
(home-page "https://www.gnu.org/software/linux-libre/") (home-page "https://www.gnu.org/software/linux-libre/")