From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7n50-00067U-4H for guix-patches@gnu.org; Wed, 03 Oct 2018 15:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7n4x-0004rF-UU for guix-patches@gnu.org; Wed, 03 Oct 2018 15:45:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60053) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7n4x-0004qG-5j for guix-patches@gnu.org; Wed, 03 Oct 2018 15:45:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g7n4w-0002ry-Tm for guix-patches@gnu.org; Wed, 03 Oct 2018 15:45:02 -0400 Subject: [bug#32923] [PATCH 3/3] gnu: Add arduino-makefile. Resent-Message-ID: From: Danny Milosavljevic Date: Wed, 3 Oct 2018 21:44:13 +0200 Message-Id: <20181003194413.3696-3-dannym@scratchpost.org> In-Reply-To: <20181003194413.3696-1-dannym@scratchpost.org> References: <20181003194205.3627-1-dannym@scratchpost.org> <20181003194413.3696-1-dannym@scratchpost.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 32923@debbugs.gnu.org * gnu/packages/arduino.scm (arduino-makefile): Add variable. --- gnu/packages/arduino.scm | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/gnu/packages/arduino.scm b/gnu/packages/arduino.scm index 369ca68a7..f976a197e 100644 --- a/gnu/packages/arduino.scm +++ b/gnu/packages/arduino.scm @@ -122,3 +122,86 @@ (replace 'install ,(arduino-installer "libraries")))))) ;; Note: Some parts are BSD and ASL-2.0 licensed. (license (list license:lgpl2.1+ license:gpl3+)))) + +(define-public arduino-makefile + (package + (name "arduino-makefile") + (version "1.6.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sudar/Arduino-Makefile.git") + (commit version))) + (sha256 + (base32 + "0flpl97d2231gp51n3y4qvf3y1l8xzafi1sgpwc305vwc2h4dl2x")) + (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" + (("# => 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 = " + (assoc-ref %build-inputs "avrdude") + "\n")) + (("# => ARDMK_DIR.*") + (string-append "ARDMK_DIR = " + (assoc-ref %outputs "out") + "/share/arduino\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-gcc "/bin/avr-objcopy\n")) + (("OBJDUMP_NAME[ ]*=.*") + (string-append "OBJDUMP_NAME = " avr-gcc "/bin/avr-objdump\n")) + (("AR_NAME[ ]*=.*") + (string-append "AR_NAME = " avr-gcc "/bin/avr-ar\n")) + (("SIZE_NAME[ ]*=.*") + (string-append "SIZE_NAME = " avr-gcc "/bin/avr-size\n")) + (("NM_NAME[ ]*=.*") + (string-append "NM_NAME = " 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" "chipKIT.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-arduino")) + (mkdir-p out-man) + (copy-file "ard-reset-arduino.1" + (string-append out-man "/ard-reset-arduino.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") + (license license:lgpl2.1)))