gnu: openssl: Use 'target-*' predicates from (guix utils).

* gnu/packages/tls.scm (target->openssl-target): Rewrite in terms of the
'target-*' predicates.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Vivien Kraus 2022-07-19 20:09:14 +02:00 committed by Ludovic Courtès
parent 94e0fb1eb7
commit a5a88b0248
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -376,33 +376,44 @@ (define (target->openssl-target target)
;; Keep this code outside the build code, ;; Keep this code outside the build code,
;; such that new targets can be added ;; such that new targets can be added
;; without causing rebuilds for other targets. ;; without causing rebuilds for other targets.
(cond ((string-prefix? "i586" target) (if (target-mingw? target)
"hurd-x86") (string-append
((string-suffix? "mingw32" target) "mingw"
(string-append (if (target-x86-64? target)
"mingw" "64"
(if (string-prefix? "x86_64" target) ""))
"64" (let ((kernel
""))) (cond ((target-hurd? target)
((string-prefix? "i686" target) "hurd")
"linux-x86") ((target-linux? target)
((string-prefix? "x86_64" target) "linux")
"linux-x86_64") (else
((string-prefix? "mips64el" target) (error "unsupported openssl target kernel"))))
"linux-mips64") (arch
((string-prefix? "arm" target) (cond
"linux-armv4") ((target-x86-32? target)
((string-prefix? "aarch64" target) "x86")
"linux-aarch64") ((target-x86-64? target)
((string-prefix? "powerpc64le" target) "x86_64")
"linux-ppc64le") ((target-mips64el? target)
((string-prefix? "powerpc64" target) "mips64")
"linux-ppc64") ((target-arm32? target)
((string-prefix? "powerpc" target) "armv4")
"linux-ppc") ((target-aarch64? target)
((string-prefix? "riscv64" target) "aarch64")
;; linux64-riscv64 isn't recognized until 3.0.0. ((target-ppc64le? target)
"linux-generic64"))) "ppc64le")
((target-ppc32? target)
"ppc")
((and (target-powerpc? target)
(target-64bit? target))
"ppc64")
((target-64bit? target)
;; linux64-riscv64 isn't recognized until 3.0.0.
"generic64")
(else
(error "unsupported openssl target architecture")))))
(string-append kernel "-" arch))))
(define-public openssl (define-public openssl
(package (package