From patchwork Tue Nov 28 11:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Pierre De Jesus DIAZ X-Patchwork-Id: 56889 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 92F2127BBEC; Tue, 28 Nov 2023 11:36:25 +0000 (GMT) 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 B6E1427BBE2 for ; Tue, 28 Nov 2023 11:36:24 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7wNj-0005ZT-H7; Tue, 28 Nov 2023 06:35:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7wNh-0005Yo-R4 for guix-patches@gnu.org; Tue, 28 Nov 2023 06:35:57 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7wNh-00080X-7H; Tue, 28 Nov 2023 06:35:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r7wNn-0003I2-8y; Tue, 28 Nov 2023 06:36:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH v1 04/22] guix: Add target-avr?. References: <20230929091333.7623-1-jean@foundationdevices.com> In-Reply-To: <20230929091333.7623-1-jean@foundationdevices.com> Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 28 Nov 2023 11:36:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 66263@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.170117136012615 (code B ref 66263); Tue, 28 Nov 2023 11:36:03 +0000 Received: (at 66263) by debbugs.gnu.org; 28 Nov 2023 11:36:00 +0000 Received: from localhost ([127.0.0.1]:45584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wNj-0003HJ-GD for submit@debbugs.gnu.org; Tue, 28 Nov 2023 06:36:00 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:46506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7wNf-0003Gp-Ex for 66263@debbugs.gnu.org; Tue, 28 Nov 2023 06:35:57 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40b4e35ecf1so3191415e9.1 for <66263@debbugs.gnu.org>; Tue, 28 Nov 2023 03:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1701171342; x=1701776142; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=44Ab1r0HluOT0NzTEbsO3YijmQP9WMEGcE9zmX5m1qo=; b=V3mm+FL4IHOVJqMITZK/mcqsh9NE94q5RR/En21uAlCncZngHRp8dE7gf7PF2sI0Cy JgKEU3bXeQMTmfB9QXTkEKDaWpLHlRrcNj/Viz1kI1DVuf2k71FleVXeckF1k9Ljj+8i VyUByD402W4sfRcjrV9iH3VqBDOqIvpmFb2HlkbaSF5K44f+5+f7NbAmJFCB3Ki3vdB4 Vjgt7Ngy6X6Gk/GSgiJTiTosarHorPvL5ydgf6zLCufOslit+m+rrSwlM3drdIhStizG MUwTwjgvhmQ9UnyHmR61p9V3HN8aUG/n3k/dd48ZislUW7j7OaMbu/gRYHCXawx3LXXJ hmwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701171342; x=1701776142; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=44Ab1r0HluOT0NzTEbsO3YijmQP9WMEGcE9zmX5m1qo=; b=TnhrG9iwTJUGRboZsSASFHjK/EFT/nfb4bPlUEhomzpNT0i25CjW4utkzDUW/k2b+c kneimFxRivpqmJQR3imb7u18lcS+/1Hz2JYGaFU6iqmnT+xGydwz33t4YFuDXIYqjMNn HMvW5mz/MCwqyiQn2OuiG9S0fXTrBFbEIbDtUNiPue7mKOls/t7EcOxGygM/xwMpw+uc hizeTSDf44vSucQaSigIFAMFUFjV5bG7Ds7jSitktJgbBbqPNRmZh7YXHGxrHTmFNYQl KantBYUwU9RKg5A5Nh9nihU/XUhplBMqCOORjdvCqrYVXBx9rJWcWavS2RttirYOH3Tl 4Q4Q== X-Gm-Message-State: AOJu0Yzb6NoyZs4ARYqWPxvBpTdDfD1CNET7LTQy9xX9rRqdZ26UiONJ zaMFFi3y3ni/ra2uyuCI1HMxMDjmCv2CR15gZzk= X-Google-Smtp-Source: AGHT+IEY9i/q7GGWa1pBz08hDYwR+YFLxg98XKKxb8r4WnAkaWj1kuRtDuiOwgddPa0DkaGajtxdxQ== X-Received: by 2002:a05:600c:46d3:b0:405:1bbd:aa9c with SMTP id q19-20020a05600c46d300b004051bbdaa9cmr10083313wmo.34.1701171342583; Tue, 28 Nov 2023 03:35:42 -0800 (PST) Received: from jeandudey.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id f7-20020a05600c154700b0040b4cb14d40sm1848769wmg.19.2023.11.28.03.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 03:35:42 -0800 (PST) Date: Tue, 28 Nov 2023 12:34:47 +0100 Message-ID: <20231128113510.11214-4-jean@foundationdevices.com> X-Mailer: git-send-email 2.41.0 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: , Reply-to: Jean-Pierre De Jesus DIAZ X-ACL-Warn: , Jean-Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean-Pierre De Jesus DIAZ via Guix-patches via From: Jean-Pierre De Jesus DIAZ Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/utils.scm (target-avr?): New procedure. * tests/utils.scm: Add tests for target-avr? procedure. Change-Id: Iaa0fa97a2b6bc45d45f907f43157f1548a0ba3fa --- guix/utils.scm | 6 ++++++ tests/utils.scm | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm index 7a42b49df2..8e71f97e1c 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2023 Philip McGrath ;;; Copyright © 2023 Janneke Nieuwenhuizen ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2023 Foundation Devices, Inc. ;;; ;;; This file is part of GNU Guix. ;;; @@ -99,6 +100,7 @@ (define-module (guix utils) target-arm32? target-aarch64? target-arm? + target-avr? target-ppc32? target-ppc64le? target-powerpc? @@ -724,6 +726,10 @@ (define* (target-arm? #:optional (target (or (%current-target-system) (%current-system)))) (or (target-arm32? target) (target-aarch64? target))) +(define* (target-avr? #:optional (target (%current-target-system))) + "Is the architecture of TARGET a variant of Microchip's AVR architecture?" + (or (string=? target "avr") (string-prefix? "avr-" target))) + (define* (target-ppc32? #:optional (target (or (%current-target-system) (%current-system)))) (string-prefix? "powerpc-" target)) diff --git a/tests/utils.scm b/tests/utils.scm index 648e91f242..5664165c85 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 Mathieu Lirzin ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2023 Foundation Devices, Inc. ;;; ;;; This file is part of GNU Guix. ;;; @@ -329,6 +330,17 @@ (define (test-compression/decompression method run?) ;; However, it isn't 32-bit. ,(format #f "x86_~a-linux-gnu" (expt 2 109))))) +(test-equal "target-avr?" + '(#t #t #t #f #f) + (map target-avr? + '("avr" "avr-unknown-none" + ;; In addition LLVM also uses this form. + "avr-unknown-unknown" + ;; The AVR32 architecture also was made by Atmel/Microchip but it + ;; does not resemble the AVR family, they aren't compatible in any + ;; way. + "avr32" "avr32-unknown-none"))) + (test-end) (false-if-exception (delete-file temp-file))