[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
15/20: openssl: Extract logic for computing CONFIGURE_TARGET_ARCH.
From: |
guix-commits |
Subject: |
15/20: openssl: Extract logic for computing CONFIGURE_TARGET_ARCH. |
Date: |
Mon, 12 Jul 2021 11:15:44 -0400 (EDT) |
mothacehe pushed a commit to branch wip-meson
in repository guix.
commit 1d204af2d0c918a21a2cee45a20b595d81ff1cd7
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jul 11 13:47:18 2021 +0200
openssl: Extract logic for computing CONFIGURE_TARGET_ARCH.
By computing this value outside the build code, new targets
can be added without causing rebuilds for other targets.
* gnu/packages/tls.scm
(target->openssl-target): New procedure.
(openssl)[arguments]<#:phases>{set-cross-compile}: Use it.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
gnu/packages/tls.scm | 46 +++++++++++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 6cebc1d..8c7bba0 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -311,6 +311,31 @@ required structures.")
(define-public guile3.0-gnutls
(deprecated-package "guile3.0-gnutls" gnutls))
+(define (target->openssl-target target)
+ "Return the value to set CONFIGURE_TARGET_ARCH to when cross-compiling
+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-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")))
+
(define-public openssl
(package
(name "openssl")
@@ -349,25 +374,8 @@ required structures.")
(lambda* (#:key target #:allow-other-keys)
(setenv "CROSS_COMPILE" (string-append target "-"))
(setenv "CONFIGURE_TARGET_ARCH"
- (cond
- ((string-prefix? "i586" target)
- "hurd-x86")
- ((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"))))))
+ #$(target->openssl-target
+ (%current-target-system))))))
#~())
(replace 'configure
(lambda _
- 04/20: net-base: Don't cross-compile., (continued)
- 04/20: net-base: Don't cross-compile., guix-commits, 2021/07/12
- 11/20: openssl: Make the #:phases argument a G-expression., guix-commits, 2021/07/12
- 02/20: utils: Define a target-x86-32? and target-x86-64? predicate., guix-commits, 2021/07/12
- 16/20: glib: Use a correct python in scripts when cross-compiling., guix-commits, 2021/07/12
- 20/20: meson: Support cross-compilation., guix-commits, 2021/07/12
- 06/20: libgpg-error: Remove trailing #f from phases., guix-commits, 2021/07/12
- 08/20: libgpg-error: Fix cross-compilation error., guix-commits, 2021/07/12
- 18/20: glib: Look up "tzdata" in 'native-inputs', not 'inputs'., guix-commits, 2021/07/12
- 10/20: openssl: Remove trailing #t from phases., guix-commits, 2021/07/12
- 17/20: glib: Verify the cross-compiled python is used in installed scripts., guix-commits, 2021/07/12
- 15/20: openssl: Extract logic for computing CONFIGURE_TARGET_ARCH.,
guix-commits <=
- 07/20: libgpg-error: Prevent silent miscompilation some systems., guix-commits, 2021/07/12
- 09/20: python: Fix reference to input when cross-compiling., guix-commits, 2021/07/12
- 13/20: openssl: Move documentation instead of copying and deleting it., guix-commits, 2021/07/12
- 14/20: openssl: Move all man pages to separate output, not only man3., guix-commits, 2021/07/12
- 01/20: utils: Define target-linux? predicate., guix-commits, 2021/07/12
- 12/20: openssl: Use G-exp machinery for referring to outputs., guix-commits, 2021/07/12
- 03/20: packages: Define this-package-input and this-package-native-input., guix-commits, 2021/07/12
- 05/20: tzdata: Don't bother with cross-compiling., guix-commits, 2021/07/12
- 19/20: libelf: Update configure script and config.guess and config.sub., guix-commits, 2021/07/12