From: Danny Milosavljevic <dannym@scratchpost.org>
To: guix-devel@gnu.org
Subject: [PATCH v2 2/2] gnu: Add arduino-makefile.
Date: Tue, 30 Aug 2016 18:40:37 +0200 [thread overview]
Message-ID: <20160830164037.26621-3-dannym@scratchpost.org> (raw)
In-Reply-To: <20160830164037.26621-1-dannym@scratchpost.org>
* gnu/packages/arduino.scm (arduino-makefile): New variable.
---
gnu/packages/arduino.scm | 81 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/gnu/packages/arduino.scm b/gnu/packages/arduino.scm
index 6649456..0305e51 100644
--- a/gnu/packages/arduino.scm
+++ b/gnu/packages/arduino.scm
@@ -88,3 +88,84 @@ hardware spec files (boards.txt).")
license:asl2.0
license:expat
license:bsd-3))))
+
+(define-public arduino-makefile
+ (package
+ (name "arduino-makefile")
+ (version "1.5.1")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/sudar/Arduino-Makefile/"
+ "archive/" version ".tar.gz"))
+ (sha256
+ (base32
+ "1gqmcg2jg62b915akbkivnqf8sx76gv719vx7azm47szd0w1i94i"))
+ (file-name (string-append name "-" version ".tar.gz"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; no tests exist
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((avr-gcc (assoc-ref inputs "avr-gcc-5"))
+ (avr-binutils (assoc-ref inputs "avr-binutils")))
+ (substitute* "bin/ard-reset-arduino"
+ (("#!/usr/bin/env python") "#!/usr/bin/python3"))
+ (substitute* "Arduino.mk"
+ (("# => ARDUINO_DIR.*")
+ (string-append "ARDUINO_DIR = "
+ (assoc-ref %build-inputs "arduino-libraries")
+ "/share/arduino\n"))
+ ; ; defaults to "hardware/tools/avr"
+ (("# => AVR_TOOLS_DIR.*")
+ (string-append "AVR_TOOLS_DIR = /\n" ; in order to let the user override CC etc.
+ "AVR_TOOLS_PATH = /\n"
+ "AVRDUDE = " (assoc-ref %build-inputs "avrdude") "\n"))
+ (("CC_NAME[ ]*=.*")
+ (string-append "CC_NAME = " avr-gcc "/bin/avr-gcc\n"))
+ (("CXX_NAME[ ]*=.*")
+ (string-append "CXX_NAME = " avr-gcc "/bin/avr-g++\n"))
+ (("OBJCOPY_NAME[ ]*=.*")
+ (string-append "OBJCOPY_NAME = " avr-binutils "/bin/avr-objcopy\n"))
+ (("OBJDUMP_NAME[ ]*=.*")
+ (string-append "OBJDUMP_NAME = " avr-binutils "/bin/avr-objdump\n"))
+ (("AR_NAME[ ]*=.*")
+ (string-append "AR_NAME = " avr-binutils "/bin/avr-ar\n"))
+ (("SIZE_NAME[ ]*=.*")
+ (string-append "SIZE_NAME = " avr-binutils "/bin/avr-size\n"))
+ (("NM_NAME[ ]*=.*")
+ (string-append "NM_NAME = " avr-binutils "/bin/avr-nm\n"))
+ ; What about ld ?
+ (("# => ARDMK_DIR.*")
+ (string-append "ARDMK_DIR = "
+ (assoc-ref %outputs "out")
+ "/share/arduino\n"))))))
+ (delete 'build)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (out-mk (string-append out "/share/arduino"))
+ (out-doc (string-append out "/share/doc"))
+ (out-bin (string-append out "/bin"))
+ (out-man (string-append out "/share/man/man1")))
+ (for-each (lambda (name)
+ (install-file name out-mk))
+ '("Arduino.mk" "arduino-mk-vars.md" "chipKIT.mk" "Common.mk"))
+ (mkdir-p out-doc)
+ (copy-recursively "examples" out-doc)
+ (install-file "bin/ard-reset-arduino" out-bin)
+ (install-file "ard-reset-arduino.1" out-man)))))))
+ (inputs
+ `(("python" ,python)
+ ("python-pyserial" ,python-pyserial)
+ ("arduino-libraries" ,arduino-libraries)
+ ("avrdude" ,avrdude)
+ ("avr-gcc-5" ,avr-gcc-5)
+ ("avr-binutils" ,avr-binutils)))
+ (synopsis "Arduino Makefile Include file")
+ (description "@code{arduino-makefile} allows you to build Arduino sketches using a very tiny Makefile.")
+ (home-page "https://github.com/sudar/Arduino-Makefile")
+ ;(supported-systems '("avr"))
+ (license license:lgpl2.1+)))
prev parent reply other threads:[~2016-08-30 16:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-30 16:40 [PATCH v2 0/2] Add Arduino tools Danny Milosavljevic
2016-08-30 16:40 ` [PATCH v2 1/2] gnu: Add arduino-libraries Danny Milosavljevic
2016-08-30 16:40 ` Danny Milosavljevic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160830164037.26621-3-dannym@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.