[bug#36477,v3,43/48] utils: Use target-arm64? and target-arm? helpers.
diff mbox series

Message ID 20190902153333.11190-44-m.othacehe@gmail.com
State New
Headers show
Series
  • Add --target support to guix system
Related show

Commit Message

Mathieu Othacehe Sept. 2, 2019, 3:33 p.m. UTC
* guix/utils.scm (target-arm64?, target-arm?): New exported procedures.
---
 guix/utils.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Ludovic Courtès Sept. 4, 2019, 12:32 p.m. UTC | #1
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * guix/utils.scm (target-arm64?, target-arm?): New exported procedures.
> ---
>  guix/utils.scm | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/guix/utils.scm b/guix/utils.scm
> index f480c3291f..3eb156ad4e 100644
> --- a/guix/utils.scm
> +++ b/guix/utils.scm
> @@ -78,6 +78,8 @@
>              package-name->name+version
>              target-mingw?
>              target-arm32?
> +            target-arm64?
> +            target-arm?
>              target-64bit?
>              version-compare
>              version>?
> @@ -493,6 +495,12 @@ a character other than '@'."
>  (define (target-arm32?)
>    (string-prefix? "arm" (or (%current-target-system) (%current-system))))
>  
> +(define (target-arm64?)
> +  (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))

I’d call it ‘target-aarch64?’ because that’s what it’s called upstream,
and that’s also the name we use elsewhere in Guix.  WDYT?

Apart from that LGTM!

Ludo’.
Mathieu Othacehe Oct. 2, 2019, 9:25 a.m. UTC | #2
Hey,

> I’d call it ‘target-aarch64?’ because that’s what it’s called upstream,
> and that’s also the name we use elsewhere in Guix.  WDYT?

Yes I renamed it to target-aarch64? in v4.

Mathieu

Patch
diff mbox series

diff --git a/guix/utils.scm b/guix/utils.scm
index f480c3291f..3eb156ad4e 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -78,6 +78,8 @@ 
             package-name->name+version
             target-mingw?
             target-arm32?
+            target-arm64?
+            target-arm?
             target-64bit?
             version-compare
             version>?
@@ -493,6 +495,12 @@  a character other than '@'."
 (define (target-arm32?)
   (string-prefix? "arm" (or (%current-target-system) (%current-system))))
 
+(define (target-arm64?)
+  (string-prefix? "aarch64" (or (%current-target-system) (%current-system))))
+
+(define (target-arm?)
+  (or (target-arm32?) (target-arm64?)))
+
 (define (target-64bit?)
   (let ((system (or (%current-target-system) (%current-system))))
     (any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))))