i am in the process of packaging uf2 when i stumble into a kind-of-weird
bug.

building the definition below (in bootloaders.scm) on top of
fbf8b81971475ee712338f1c955be6ac44099fac fails in the build phase

> error: [Errno 2] No such file or directory: 
> '/tmp/guix-build-python2-2.7.18.drv-0/Python-2.7.18/Modules/_ctypes/libffi'

--8<---------------cut here---------------start------------->8---
(define-public uf2-samdx1
  (let* ((commit "a3395d547b0bbe92676214be68e5cec1a2dbba1b")
         (revision "0")
         (board "trellis_m4"
                ;"pewpew_m4";"metro_m0"
                ;"dadamachines-automat"
          )
         (triplet "arm-linux-gnueabihf")
         (native-build? (lambda _
                          (or (not triplet) ;disable cross-compilation
                              (string=? (%current-system)
                                        (gnu-triplet->nix-system triplet))))))
    (package
      (name "uf2-samdx1")
      (version (git-version "3.4.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/Microsoft/uf2-samdx1";)
                      (commit commit)
                      (recursive? #t)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "11gn8aq9i20pl55bcpxw6ba0wl1a7n8qz25ibv18kl0dc4d18rrh"))))
      (build-system gnu-build-system)
      (arguments
       (list #:target (and (not (native-build?)) triplet)
             #:make-flags
             #~(list (string-append "BOARD=" #$board)
                     #$@(if (not (native-build?))
                            (list (string-append "CROSS_COMPILE=" triplet
                                                 ;;"-" ; final dash necessary?
                                                 ))
                            '()))
             #:phases #~(modify-phases %standard-phases
                          (add-after 'configure 'patch-makefile
                            (lambda _
                              (substitute* "Makefile"
                                          (("^UF2_VERSION_BASE.*")
                                           (string-append "UF2_VERSION_BASE = " 
#$version "-guix")))))
                          (delete 'configure)
                          (add-before 'build 'create-version-header
                            (lambda* (#:key inputs outputs #:allow-other-keys)
                              (let ((dir (string-append "build/" #$board)))
                                (mkdir-p dir)
                                (with-output-to-file (string-append dir 
"/uf2_version.h")
                                  (lambda _
                                    (display
                                     (format #f "#define UF2_VERSION_BASE 
\"v~a-guix\""
                                             #$version))))))))))
      (inputs (list ;python-wrapper
               python-2
                    ))
      (native-inputs (list (make-arm-none-eabi-toolchain-12.3.rel1)
                           (make-newlib-nano-arm-none-eabi-12.3.rel1)))
      (home-page "https://github.com/Microsoft/uf2";)
      (synopsis "Embedded bootloader")
      (description "UF2, aka. USB Flashing Format allows to flash embedded
devices through dragging and dropping of uf2 files onto flash drives.")
      (license license:expat))))
--8<---------------cut here---------------end--------------->8---

what puzzles me:
 - the commands executed by the build phase / through the makefile are
 all arm-linux-gnueabihf-gcc invocations
 - python2 builds just fine
 - without the python2 input the build phase goes further (until some
 arm-none-eabi-objcopy invocation) but fails due to "make: python2: No
 such file or directory"

is this a known issue?  are there workarounds?  what am i missing?

TIA
gabber

Reply via email to