guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: guix-commits
Subject: 09/09: gnu: openssl: Use 'target-*' predicates from (guix utils).
Date: Thu, 4 Aug 2022 18:16:09 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit a5a88b0248f3ca70db30605c0c2aa93bb360d8ad
Author: Vivien Kraus <vivien@planete-kraus.eu>
AuthorDate: Tue Jul 19 20:09:14 2022 +0200

    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>
---
 gnu/packages/tls.scm | 65 ++++++++++++++++++++++++++++++----------------------
 1 file changed, 38 insertions(+), 27 deletions(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index a310899b27..1e527ecce2 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -376,33 +376,44 @@ OpenSSL for TARGET."
   ;; Keep this code outside the build code,
   ;; such that new targets can be added
   ;; without causing rebuilds for other targets.
-  (cond ((string-prefix? "i586" target)
-         "hurd-x86")
-        ((string-suffix? "mingw32" target)
-         (string-append
-          "mingw"
-          (if (string-prefix? "x86_64" target)
-              "64"
-              "")))
-        ((string-prefix? "i686" target)
-         "linux-x86")
-        ((string-prefix? "x86_64" target)
-         "linux-x86_64")
-        ((string-prefix? "mips64el" target)
-         "linux-mips64")
-        ((string-prefix? "arm" target)
-         "linux-armv4")
-        ((string-prefix? "aarch64" target)
-         "linux-aarch64")
-        ((string-prefix? "powerpc64le" target)
-         "linux-ppc64le")
-        ((string-prefix? "powerpc64" target)
-         "linux-ppc64")
-        ((string-prefix? "powerpc" target)
-         "linux-ppc")
-        ((string-prefix? "riscv64" target)
-         ;; linux64-riscv64 isn't recognized until 3.0.0.
-         "linux-generic64")))
+  (if (target-mingw? target)
+      (string-append
+       "mingw"
+       (if (target-x86-64? target)
+           "64"
+           ""))
+      (let ((kernel
+             (cond ((target-hurd? target)
+                    "hurd")
+                   ((target-linux? target)
+                    "linux")
+                   (else
+                    (error "unsupported openssl target kernel"))))
+            (arch
+             (cond
+              ((target-x86-32? target)
+               "x86")
+              ((target-x86-64? target)
+               "x86_64")
+              ((target-mips64el? target)
+               "mips64")
+              ((target-arm32? target)
+               "armv4")
+              ((target-aarch64? target)
+               "aarch64")
+              ((target-ppc64le? target)
+               "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
   (package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]