From patchwork Tue Jul 19 18:37:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 40733 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7E84227BBEA; Tue, 19 Jul 2022 19:38:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D515727BBE9 for ; Tue, 19 Jul 2022 19:38:09 +0100 (BST) Received: from localhost ([::1]:37400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDs6i-0006KB-Vy for patchwork@mira.cbaines.net; Tue, 19 Jul 2022 14:38:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDs6c-0006K0-NZ for guix-patches@gnu.org; Tue, 19 Jul 2022 14:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDs6c-0006zI-F1 for guix-patches@gnu.org; Tue, 19 Jul 2022 14:38:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDs6c-0006lg-4j for guix-patches@gnu.org; Tue, 19 Jul 2022 14:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56505] Use the target predicates from (guix utils) References: <660bab87fb7ccee6177be413b72bea7e40463354.camel@planete-kraus.eu> In-Reply-To: <660bab87fb7ccee6177be413b72bea7e40463354.camel@planete-kraus.eu> Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Jul 2022 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56505 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56505@debbugs.gnu.org Received: via spool by 56505-submit@debbugs.gnu.org id=B56505.165825583825959 (code B ref 56505); Tue, 19 Jul 2022 18:38:02 +0000 Received: (at 56505) by debbugs.gnu.org; 19 Jul 2022 18:37:18 +0000 Received: from localhost ([127.0.0.1]:55137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDs5t-0006kd-Ca for submit@debbugs.gnu.org; Tue, 19 Jul 2022 14:37:17 -0400 Received: from planete-kraus.eu ([89.234.140.182]:50934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDs5q-0006kS-TW for 56505@debbugs.gnu.org; Tue, 19 Jul 2022 14:37:16 -0400 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 5fa30a00 for <56505@debbugs.gnu.org>; Tue, 19 Jul 2022 18:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:subject:from:to:date:content-type:mime-version; s= dkim; bh=HouoqG2cEXmu85Y58/f6yNDCTdI=; b=jNPl9dHdOWGey7p9kJmYQPW Z4aMWV6GnO/UjM1BYnXeh+iGaL4ZqTO7GRlaR0C6dfekpAlRkA8fBWez6yJVpMwJ ehj5Iif1wZ2BQjNSIaGqcsIEKvzGxyq19lyknmBIBnx50ddt3dlyQPyzVY5Bs/NQ usmLIS5BXerr6rEwicIo= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 458777c0 (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO) for <56505@debbugs.gnu.org>; Tue, 19 Jul 2022 18:37:09 +0000 (UTC) Message-ID: <70b76f171502fc7122dbfd120093660616632980.camel@planete-kraus.eu> Date: Tue, 19 Jul 2022 20:37:08 +0200 User-Agent: Evolution 3.42.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus X-getmail-retrieved-from-mailbox: Patches Dear guix, antipode on #guix told me that these archaic tests to determine the openssl target should be replaced with the new target predicates in (guix utils), and that the kernel and the architecture should be dealt with independently. However, it seems that mingw targets do not use the same scheme, so I had to keep that special case. I had to introduce a new predicate for mips64el. As far as I understand, this is also a 64-bit target, so it should also be detected by target-64bit?, but fortunately this is already the case, so I don’t have to change target-64bit?. I don’t think there are other predicates that I should change, but I may be wrong. What do you think? Best regards, Vivien From ae3bffd19c2887342e28372c3c613e998eb21840 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Tue, 19 Jul 2022 20:09:14 +0200 Subject: [PATCH v2 3/3] gnu: openssl: use target predicates from (guix utils) for openssl. --- 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 b838e75b5c..a32031acb8 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -359,33 +359,44 @@ (define (target->openssl-target 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 -- 2.36.1