From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: [PATCH 5/5] gnu: Add arduino-makefile. Date: Tue, 16 Aug 2016 20:36:32 +0200 Message-ID: <20160816183632.30820-6-dannym@scratchpost.org> References: <20160816183632.30820-1-dannym@scratchpost.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.9.1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZjEE-0000Qr-1t for guix-devel@gnu.org; Tue, 16 Aug 2016 14:36:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZjEC-0005N5-Of for guix-devel@gnu.org; Tue, 16 Aug 2016 14:36:45 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:45018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZjEC-0005Mt-EE for guix-devel@gnu.org; Tue, 16 Aug 2016 14:36:44 -0400 In-Reply-To: <20160816183632.30820-1-dannym@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org This is a multi-part message in MIME format. --------------2.9.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: quoted-printable * gnu/packages/arduino.scm (arduino-makefile): New variable. --- gnu/packages/arduino.scm | 83 ++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 file changed, 83 insertions(+) --------------2.9.1 Content-Type: text/x-patch; name="0005-gnu-Add-arduino-makefile.patch" Content-Disposition: attachment; filename="0005-gnu-Add-arduino-makefile.patch" Content-Transfer-Encoding: quoted-printable diff --git a/gnu/packages/arduino.scm b/gnu/packages/arduino.scm index 675df80..34f0251 100644 --- a/gnu/packages/arduino.scm +++ b/gnu/packages/arduino.scm @@ -106,3 +106,86 @@ (chdir "libraries"))) (replace 'install ,(arduino-installer "libraries")))))) (license license:lgpl2.1))) ; FIXME check apache license etc + +(define-public arduino-makefile ; really something like arduino-toolchai= n... + (package + (name "arduino-makefile") + (version "1.5.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/sudar/Arduino-Make= file/" + "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-toolchain-5"))) + (substitute* "bin/ard-reset-arduino" + (("#!/usr/bin/env python") "#!/usr/bin/python3")) + (substitute* "Arduino.mk" + (("# =3D> ARDUINO_DIR.*") + (string-append "ARDUINO_DIR =3D " + (assoc-ref %build-inputs "arduino-libr= aries") + "/share/arduino\n")) + ; ; defaults to "hardware/tools/avr" + (("# =3D> AVR_TOOLS_DIR.*") + (string-append "AVR_TOOLS_DIR =3D " + (assoc-ref %build-inputs "avrdude") + "\n")) + (("# =3D> ARDMK_DIR.*") + (string-append "ARDMK_DIR =3D " + (assoc-ref %outputs "out") + "/share/arduino\n")) + (("CC_NAME[ ]*=3D.*") + (string-append "CC_NAME =3D " avr-gcc "/bin/avr-gcc\n= ")) + (("CXX_NAME[ ]*=3D.*") + (string-append "CXX_NAME =3D " avr-gcc "/bin/avr-g++\= n")) + (("OBJCOPY_NAME[ ]*=3D.*") + (string-append "OBJCOPY_NAME =3D " avr-gcc "/bin/avr-= objcopy\n")) + (("OBJDUMP_NAME[ ]*=3D.*") + (string-append "OBJDUMP_NAME =3D " avr-gcc "/bin/avr-= objdump\n")) + (("AR_NAME[ ]*=3D.*") + (string-append "AR_NAME =3D " avr-gcc "/bin/avr-ar\n"= )) + (("SIZE_NAME[ ]*=3D.*") + (string-append "SIZE_NAME =3D " avr-gcc "/bin/avr-siz= e\n")) + (("NM_NAME[ ]*=3D.*") + (string-append "NM_NAME =3D " avr-gcc "/bin/avr-nm\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"))) + (mkdir-p out-mk) + (for-each (lambda (name) + (copy-file name (string-append out-mk "/= " name))) + '("Arduino.mk" "arduino-mk-vars.md" "chipK= IT.mk" "Common.mk")) + (mkdir-p out-doc) + (copy-recursively "examples" out-doc) + (mkdir-p out-bin) + (copy-file "bin/ard-reset-arduino" + (string-append out-bin "/ard-reset-arduin= o")) + (mkdir-p out-man) + (copy-file "ard-reset-arduino.1" + (string-append out-man "/ard-reset-arduin= o.1")))))))) + (inputs + `(("python" ,python) + ("python-pyserial" ,python-pyserial) + ("arduino-libraries" ,arduino-libraries) + ("avrdude" ,avrdude) + ("avr-toolchain-5" ,avr-toolchain-5))) + (synopsis "Arduino Makefile Include Files") + (description "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))) --------------2.9.1--