#1019578 arduino-mk: should not depend on arduino

#1019578#5
Date:
2022-09-12 13:18:58 UTC
From:
To:
Dear Maintainer,

The arduino package provides an IDE that can be used to build Arduino
programs and upload them to their target boards. The arduino-mk package
provides an alternative, command-line way of doing the same, which is
*extremely lightweight*, and thus very suitable for lightweight
environments such as headless single-board computers, CI runners, Docker
images, etc.

On version 1.5.2-2.1, arduino-mk added arduino as a dependency. On a
headless Bullseye, this pulls more than 100 packages that are not useful
in this context, including a whole X11 stack and lots of Java stuff.
That is hundreds of megabytes we have no use for. Doing so defeats one
of the main appeals of arduino-mk.

I have read the bug #981300 "arduino-mk: needs to depend on arduino
2:1.8.13+dfsg1-1" but, while that discussion addresses a real issue, I
believe it reaches the wrong solution. As far as I can tell, depending
on arduino brings only two benefits:

 1. it pulls the dependencies on arduino-core-avr and avrdude

 2. it gets us the 15-byte file /usr/share/arduino/lib/version.txt

Point 1 could be achieved by having arduino-mk depend directly on
arduino-core-avr and avrdude. Point 2 could be achieved by having
Arduino.mk search for a version number in a file shipped by
arduino-core-avr. It turns out the version of the core is more relevant
than the version of the (unused) IDE. I suggest either:

 - Shipping a version.txt file in arduino-core-avr, and having
   Arduino.mk read that rather than the one shipped by arduino.

 - Having Arduino.mk read the version information from platform.txt,
   e.g. by grepping for /^version=/.

Best regards,

Edgar Bonet.