guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#32923] [PATCH 0/3] Add Arduino basics.


From: Maxim Cournoyer
Subject: [bug#32923] [PATCH 0/3] Add Arduino basics.
Date: Fri, 01 Sep 2023 14:46:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> * gnu/packages/arduino.scm (arduino-installer): New procedure.
> (arduino-hardware): New variable.
> ---
>  gnu/packages/arduino.scm | 106 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 106 insertions(+)
>  create mode 100644 gnu/packages/arduino.scm

[...]

> +(define-public arduino-hardware
> +  (package
> +    (name "arduino-hardware")
> +    (version "1.8.7")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/arduino/Arduino.git";)
> +                    (commit version)))
> +              (sha256
> +               (base32
> +                "0cp502jf3xsrisadkrmxzylds48x60vparxm5lfcrzw27hw0qxgq"))
> +              (modules '((guix build utils)))
> +              (snippet
> +               '(begin
> +                  ;; Delete bundled jar archives.
> +                  (for-each delete-file (find-files "." "\\.jar$"))
> +                  #t))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f                      ; No tests exist
> +       #:modules ((guix build utils) (ice-9 match)
> +                  (guix build gnu-build-system))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (delete 'build)
> +         (add-after 'unpack 'prepare-dependencies
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             ;; This is intended to just prepare arduino inputs where its
> +             ;; build system expects them.
> +             (for-each (match-lambda
> +                         ((key . value)
> +                          (let* ((out-dir (assoc-ref outputs "out"))
> +                                 (destination-dir
> +                                  (string-append out-dir "/share/arduino")))
> +                            (if (string-prefix? "arduino-" key)
> +                                (let* ((basename
> +                                        (string-drop key
> +                                                     (string-length 
> "arduino-")))
> +                                       (target-outdir (assoc-ref inputs key))
> +                                       (target-dir
> +                                        (string-append target-outdir
> +                                                       "/share/arduino"))
> +                                       (target (string-append target-dir
> +                                                              "/" basename))
> +                                       (destination
> +                                        (string-append destination-dir "/"
> +                                                       basename)))
> +                                  (mkdir-p destination-dir)
> +                                  (symlink target destination)
> +                                  #t)))))
> +                       inputs)
> +             #t))

The prepare-dependecies phase appears to expect "arduino-" prefixed
input labels, but there are no inputs specified, so it seems it'd be
useful?  Am I missing something?

-- 
Thanks,
Maxim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]