gnu: selinux.scm: Use cc-for-target.

* gnu/packages/selinux.scm (libsepol, checkpolicy, policycoreutils)
[arguments]: Don't hardcode gcc.
This commit is contained in:
Efraim Flashner 2021-04-12 12:09:29 +03:00
parent 545aeb708a
commit a55f64917d
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -63,19 +63,14 @@ (define-public libsepol
`(#:tests? #f ; tests require checkpolicy, which requires libsepol `(#:tests? #f ; tests require checkpolicy, which requires libsepol
#:test-target "test" #:test-target "test"
#:make-flags #:make-flags
(let ((out (assoc-ref %outputs "out")) (let ((out (assoc-ref %outputs "out")))
(target ,(%current-target-system)))
(list (string-append "PREFIX=" out) (list (string-append "PREFIX=" out)
(string-append "SHLIBDIR=" out "/lib") (string-append "SHLIBDIR=" out "/lib")
(string-append "MAN3DIR=" out "/share/man/man3") (string-append "MAN3DIR=" out "/share/man/man3")
(string-append "MAN5DIR=" out "/share/man/man5") (string-append "MAN5DIR=" out "/share/man/man5")
(string-append "MAN8DIR=" out "/share/man/man8") (string-append "MAN8DIR=" out "/share/man/man8")
(string-append "LDFLAGS=-Wl,-rpath=" out "/lib") (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
(string-append "CC=" (string-append "CC=" ,(cc-for-target))))
(if target
(string-append (assoc-ref %build-inputs "cross-gcc")
"/bin/" target "-gcc")
"gcc"))))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure)
@ -105,17 +100,12 @@ (define-public checkpolicy
(arguments (arguments
`(#:tests? #f ; there is no check target `(#:tests? #f ; there is no check target
#:make-flags #:make-flags
(let ((out (assoc-ref %outputs "out")) (let ((out (assoc-ref %outputs "out")))
(target ,(%current-target-system)))
(list (string-append "PREFIX=" out) (list (string-append "PREFIX=" out)
(string-append "LIBSEPOLA=" (string-append "LIBSEPOLA="
(assoc-ref %build-inputs "libsepol") (assoc-ref %build-inputs "libsepol")
"/lib/libsepol.a") "/lib/libsepol.a")
(string-append "CC=" (string-append "CC=" ,(cc-for-target))))
(if target
(string-append (assoc-ref %build-inputs "cross-gcc")
"/bin/" target "-gcc")
"gcc"))))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure)
@ -376,7 +366,7 @@ (define-public policycoreutils
`(#:test-target "test" `(#:test-target "test"
#:make-flags #:make-flags
(let ((out (assoc-ref %outputs "out"))) (let ((out (assoc-ref %outputs "out")))
(list "CC=gcc" (list (string-append "CC=" ,(cc-for-target))
(string-append "PREFIX=" out) (string-append "PREFIX=" out)
(string-append "LOCALEDIR=" out "/share/locale") (string-append "LOCALEDIR=" out "/share/locale")
(string-append "BASHCOMPLETIONDIR=" out (string-append "BASHCOMPLETIONDIR=" out