On 2025-03-21, Vagrant Cascadian wrote:
> Maybe somewhere in make-linux-libre* it could have a sanity check
> comparing "supported-systems" against the %current-target-system and
> %current-system?

This more-or-less does what I want:

(use-modules (guix platform))
(use-modules (guix packages))
(use-modules (gnu packages linux))

(define arch "arm64")

(define supported-systems
  (package-supported-systems linux-libre-arm64-generic))

(define linux-supported-systems
  (map (lambda (s)
         (platform-linux-architecture (lookup-platform-by-target-or-system s)))
       supported-systems))

(if (member arch linux-supported-systems)
    (display arch)
    (display "BAD"))

Manually adjusting arch to various values...


But I fail in adding it as a phase to make-linux-libre*, as
supported-supported systems is just defined as #f:

          (add-before 'unpack 'check-valid-arch
            (lambda* (#:key supported-systems #:allow-other-keys)
              (let ((arch #$(platform-linux-architecture
                             (lookup-platform-by-target-or-system
                              (or (%current-target-system)
                                  (%current-system))))))
                (if (member arch
                            (map (lambda (s)
                                   (platform-linux-architecture
                                    (lookup-platform-by-target-or-system s)))
                                 supported-systems))
                    (#true)
                    (#false)
                    ))))
                    
Also not sure if #true or #false will allow the build to continue or
fail the build here... but I am mostly generating syntax errors and
tracebacks.


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to