From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0BTiFbnQZWXOHgEA9RJhRA:P1 (envelope-from ) for ; Tue, 28 Nov 2023 12:36:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0BTiFbnQZWXOHgEA9RJhRA (envelope-from ) for ; Tue, 28 Nov 2023 12:36:25 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CCAFC60D89 for ; Tue, 28 Nov 2023 12:36:24 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=V3mm+FL4; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701171385; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=44Ab1r0HluOT0NzTEbsO3YijmQP9WMEGcE9zmX5m1qo=; b=mVKFBkV1DU/rTtw8JCvYMHfh+e6FzCOP6r9/WsXnna3CeyFgMq0Tk0me5fTyqt4skDwdcH yaJ+IvnY7RpCi9gAsMVhzkznLxBRw6VYonQEp8JxDWogbcfVfwiFtPYc+0/vwZlK7ubpUc wpNZYtOTvEB20ho2joNE7wpbsAr4wgdTtIEZjNC9rOnDpMubrjAgc9953OpuZ1vr+pt9q5 BpOanXRavffNosQuIQoPwi3R4G9cls541D9vh7IrMH0D/EvfbsqIalMpbq/8Fpqic35JfU zFu/xH2Z0i43TT6pg8ISxM2FGhflpblx9+57L542jh6bqt70z0A5uXLo06rnOw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=foundationdevices.com header.s=google header.b=V3mm+FL4; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701171385; a=rsa-sha256; cv=none; b=VL5sGzU2FXUwTNcEDVw8ttQwXt0vo5WiMSE45w1Y11roJKdfqC12PbApsGuuMw3cSEUTq1 iFlgKxe+dxps82KwGevHeQ3jTchTX0WbHTtUwZ3I4nE4zMZ1Ia0GWMH4lNlCeBqj6gkszL o32LOX5RAsT7/NCHPaw5QJvFeVRplUn8IgqRC7r8YAP2gRPJ1iQbQtG7nvuOwvMVvyQXJF ySORwLVzdmqpSFtibqgG/F1gNgQspNTx16ZIntHwXwnWJPE4EKBYW0I4ITNagNwsZYG/tX F+rbxUtYaYZVI9BBJZqnWBTKleH/VDIRKlodj4P01hw6kXL+BZdO9y1v0tvsuQ== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Jean-Pierre De Jesus DIAZ via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.13 X-Spam-Score: -5.13 X-Migadu-Queue-Id: CCAFC60D89 X-Migadu-Scanner: mx12.migadu.com X-TUID: cEExKjqdFhVg * 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)) -- 2.41.0