From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH v6 2/2] gnu: Add arduino-makefile. Date: Thu, 01 Sep 2016 16:57:32 +0200 Message-ID: <87oa47acrn.fsf@elephly.net> References: <20160830190155.11668-1-dannym@scratchpost.org> <20160830190155.11668-3-dannym@scratchpost.org> <8737lkbtao.fsf@elephly.net> <20160831223457.236a77d9@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfTR2-00007m-W0 for guix-devel@gnu.org; Thu, 01 Sep 2016 10:57:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfTQz-0007L3-RU for guix-devel@gnu.org; Thu, 01 Sep 2016 10:57:44 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfTQz-0007Kn-I0 for guix-devel@gnu.org; Thu, 01 Sep 2016 10:57:41 -0400 In-reply-to: <20160831223457.236a77d9@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: Danny Milosavljevic Cc: guix-devel@gnu.org Danny Milosavljevic writes: > Hi Ricardo, > > On Wed, 31 Aug 2016 22:02:55 +0200 > Ricardo Wurmus wrote: >> > + (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")) >> >> This looks unnecessary. When “python-wrapper” is among the inputs the >> shebang would be replaced automatically. > > It's impossible for anyone to reliably detect the major Python version that > the script expects. > > Therefore, this clarifies that we need Python3 for it. > The shebang will then be automatically updated correctly. I don’t understand this. When the “python-wrapper” package is an input it will be the only package providing a “python” executable, so the shebang patcher will replace “#!/usr/bin/env python” with “#!/gnu/store/…-python-3…/bin/python”. There’s nothing ambiguous about this. >> > + (substitute* "Arduino.mk" >> > + (("# => ARDUINO_DIR.*") >> > + (string-append "ARDUINO_DIR = " >> > + (assoc-ref %build-inputs "arduino-libraries") >> >> Could you use “inputs” instead of “%build-inputs” here? > > Yes. What's the difference? We prefer to use a properly bound “inputs” over the magical “%build-inputs”. “%build-inputs” can be used in the specification of #:make-flags where “inputs” cannot be bound. >> > + ; What about ld ? >> >> What about it? :) > > I don't know. Seems to work without it but it just irks me. > There's no variable for ld's name in the makefile. > >> I’m a little confused about this. Why is avrdude among the inputs? Why >> python-pyserial? Nothing is built here. You just copy the files. > > It's supposed to be something like an arduino-toolchain. You just install it > and it will pull the compiler, flasher etc and use it for your projects > automagically as long as they "include Arduino.mk". Then shouldn’t the inputs be propagated? As the build artifacts of this package retain no reference to these regular inputs it’s almost the same as not specifying them in the first place. >> > + ;(supported-systems '("avr")) >> >> This should be removed. > > As I said I'm not a fan of obfuscating what system this is for. > It is *good* for maintenance to have little hints of what to expect. > > If it worked usefully, I'd even make the (supported-system '("avr")) active! This is not what “supported-systems” is used for. This field is used to tell the build machines in the build farm not to bother building packages that are not supported on the current architecture. The software provided by this package does not “run” on AVRs. (It doesn’t run at all.) It is used on any host system to build software for AVRs. That’s very different from what the “supported-systems” field describes. ~~ Ricardo