Control: tags -1 + patch

Hi,

As I see 3 bugs on this arduino-mk package, the issue is mostly lack of
documentation and gap with expectation.

Of course, we should provide examples which need mo-excuses ;-)
Gere us a patch for it.

In addition to this, let's make 2 key upstream documentation contents
accerssible from the expected location: /usr/share/doc/arduino-mk/*

Since upstream README.md contains too many non-Debian contents, adding
README.Debian which is lightly edited excerpts of the upstream README.md
is a good idea. Also whoever care to use this package needs to be
informed about extremely old version problem for arduino.

  Due to recent changes in the upstream software distribution infrastructure
  of Arduino relying heavily on pre-compiled binary blobs making them DFSG
  non-FREE, Debian Arduino package itself is stack in very old version.  It's
  not as bad as it looks.

  For the use of arduino-mk aimed for the classic 8-bit AVR MCU platform, it is
  fairly usable shape since we use the fairly new version of gcc-avr,
  binutils-avr, avr-libc, and avrdude packages created from the latest original
  upstream.

Also arduino-mk-vars.md should be  accessible there.
(This can't be compressed since it is used by make as message)

If user configure system as described in README.md in ~/.bashrc,
maybe issues such as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856870
may be avoided if upstream code uses  variables `AVRDUDE` and
`AVRDUDE_CONF`.

Also this is the reason I dudn't replace hardcoded ../../ with
/usr/share/arduino since we have $ARDMK_DIR set from ~/.bashec.

I attach my patch.  I hope this helps.

FYI: New upstream version is available: v1.6.0

| @sudar sudar released this on Jul 17, 2017 ยท 105 commits to master since this 
release
|
| This release adds support for Robotis OpenCM boards (contributed by @fuzzyTew)
|
| In addition to that the following changes were also made
|
| Fix: Allowed for SparkFun's weird usb pid/vid submenu shenanigans (issue 
#499). (https://github.com/sej7278)
| Fix: Do not include the Arduino header when calling generate_assembly on .cpp 
files. (https://github.com/Batchyx)
| Fix: Auto-detect F_CPU on Teensy from boards.txt (https://github.com/DaWelter)
| Fix: params typo in PuTTY section (issue #487) (https://github.com/ericdand)
| Fix: Fixed sed expression to properly format show_submenu (issue #488) 
(https://github.com/cbosdo)
| Tweak: Removed tilde from documentation (issue #497). 
(https://github.com/sej7278)
| New: Add support for good old cu as monitor command (issue #492) 
(https://github.com/mwm)
| New: Add a documentation how to setup Makefile for 3rd party boards (issue 
#499). (https://github.com/MilanV)

Osamu
From 1b0fde3cf0081c36a1dbaa71dc6b9c6f3869e5d6 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <[email protected]>
Date: Sun, 12 Apr 2020 21:07:55 +0900
Subject: [PATCH 1/3] Enhance packaging

Docs with focus on Debian
Drop deprecated target (lintian clean)

Signed-off-by: Osamu Aoki <[email protected]>
---
 debian/arduino-mk.README.Debian     | 165 ++++++++++++++++++++++++++++
 debian/arduino-mk.links             |   2 +
 debian/arduino-mk.lintian-overrides |   2 +
 debian/rules                        |   4 +-
 4 files changed, 171 insertions(+), 2 deletions(-)
 create mode 100644 debian/arduino-mk.README.Debian
 create mode 100644 debian/arduino-mk.links
 create mode 100644 debian/arduino-mk.lintian-overrides

diff --git a/debian/arduino-mk.README.Debian b/debian/arduino-mk.README.Debian
new file mode 100644
index 0000000..3153b60
--- /dev/null
+++ b/debian/arduino-mk.README.Debian
@@ -0,0 +1,165 @@
+# A Makefile for Arduino Sketches
+
+This is a very simple Makefile which knows how to build Arduino sketches. It
+defines entire workflows for compiling code, flashing it to Arduino and even
+communicating through Serial monitor. You don't need to change anything in the
+Arduino sketches.
+
+This README.Debian is lightly edited excerpts of the upstream README.md:
+  https://github.com/sudar/Arduino-Makefile/blob/master/README.md
+
+This aims to address ease of use for the new Debian user but may be
+slightly outdated. (created on April/2020)
+
+## Features
+
+- Very robust
+- Highly customizable
+- Supports all official AVR-based Arduino boards
+- Supports chipKIT
+- Supports Teensy 3.x (via Teensyduino)
+- Auto detects serial baud rate and libraries used
+- Support for `*.ino` and `*.pde` sketches as well as raw `*.c` and `*.cpp`
+- Support for Arduino Software versions 1.0.x (Debian package) and
+  1.8.x (upstream releases) versions of Arduino IDE.
+- Automatic dependency tracking. Referred libraries are automatically included
+  in the build process. Changes in `*.h` files lead to recompilation of sources
+  which include them
+
+## Installation
+
+### Through package
+
+```sh
+ $ sudo apt install arduino-mk
+```
+
+### From source
+
+- Check https://github.com/sudar/Arduino-Makefile#from-source
+
+## Requirements
+
+### Arduino IDE
+
+You need to have the Arduino IDE. You can either install it through the
+installer or download the distribution zip file and extract it.
+
+- Debian:   Arduino 1.0.5 based,  installed as system files via `apt ...`
+- Upstream: Arduino 1.8.12 based, installed as user files via `git clone ...`
+
+FYI:
+
+  Due to recent changes in the upstream software distribution infrastructure
+  of Arduino relying heavily on pre-compiled binary blobs making them DFSG
+  non-FREE, Debian Arduino package itself is stack in very old version.  It's
+  not as bad as it looks.
+
+  For the use of arduino-mk aimed for the classic 8-bit AVR MCU platform, it is
+  fairly usable shape since we use the fairly new version of gcc-avr,
+  binutils-avr, avr-libc, and avrdude packages created from the latest original
+  upstream.
+
+### pySerial
+
+Installed by the package dependency
+
+## Usage
+
+Sample makefiles are provided in the `/usr/share/doc/arduino-mk/examples/`
+directory.  E.g. `MakefileExample/Makefile-example.mk` demonstrates
+some of the more advanced options, whilst `Blink/Makefile`
+demonstrates the minimal settings required for various boards like the Uno,
+Nano, Mega, Teensy, ATtiny etc.
+
+You can either declare following variables in your project's makefile or set
+them as environmental variables.
+
+    ARDUINO_DIR โ€“ Directory where Arduino is installed
+    ARDMK_DIR โ€“ Directory where you have copied the makefile
+    AVR_TOOLS_DIR โ€“ Directory where avr tools are installed
+
+Keep in mind, that Arduino 1.5.x+ comes with it's own copy of avr tools which
+you can leverage in your build process here.
+
+To use Debian-provided system installed Arduino 1.0.5, set followings in
+~/.bashrc file:
+	export ARDUINO_DIR=/usr/share/arduino
+	export ARDMK_DIR=/usr/share/arduino
+	export AVR_TOOLS_DIR=/usr/lib/avr
+
+To use Upstream-based user installed Arduino. e.g. 1.8.12, install it to your
+home directory:
+ $ firefox https://www.arduino.cc/download_handler.php?f=/arduino-1.8.12-linux64.tar.xz
+   ...
+ $ tar --xz -xvf  ~/Downloads/arduino-1.8.12-linux64.tar.xz
+
+This creates arduino-1.8.12 directory in the user's home directory.  Then, set
+followings in  ~/.bashrc file:
+	export ARDUINO_DIR=/home/<username>/arduino-1.8.12
+	export ARDMK_DIR=/usr/share/arduino
+	export AVR_TOOLS_DIR=/usr/lib/avr
+
+Example of the project's make file:
+
+```make
+    BOARD_TAG     = mega2560
+    MONITOR_PORT  = /dev/ttyACM0
+```
+
+Usefull Variables:
+
+The list of all variables that can be overridden is available at
+arduino-mk-vars.md file.
+
+- `BOARD_TAG` - Type of board, for a list see boards.txt or `make show_boards`
+- `MONITOR_PORT` - The port where your Arduino is plugged in, usually
+  `/dev/ttyACM0` or `/dev/ttyUSB0` in Linux.
+- `ARDUINO_DIR` - Path to Arduino installation.
+- `ARDMK_DIR`   - Path where the `*.mk` are present. If you installed the
+  package, then it is usually `/usr/share/arduino`
+- `AVR_TOOLS_DIR` - Path where the avr tools chain binaries are present. If you
+  are going to use the binaries that came with Arduino installation, then you
+  don't have to set it. Otherwise set it realtive and not absolute.
+
+## Including Libraries
+
+You can specify space separated list of libraries that are needed for your
+sketch in the variable `ARDUINO_LIBS`.
+
+```make
+	ARDUINO_LIBS = Wire SoftwareSerial
+```
+
+The libraries will be searched for in the following places in the following
+order.
+
+- `/libraries` directory inside your sketchbook directory. Sketchbook directory
+  will be auto detected from your Arduino preference file. You can also manually
+  set it through `ARDUINO_SKETCHBOOK`.
+- `/libraries` directory inside your Arduino directory, which is read from
+  `ARDUINO_DIR`.
+
+The libraries inside user directories will take precedence over libraries
+present in Arduino core directory.
+
+## avrdude
+
+To upload compiled files, `avrdude` is used. This Makefile tries to find
+`avrdude` and it's config (`avrdude.conf`) below `ARDUINO_DIR`. If you like to
+use the one installed on your system instead of the one which came with Arduino,
+you can try to set the variables `AVRDUDE` and `AVRDUDE_CONF`. On a typical
+Linux system these could be set to
+
+```make
+      AVRDUDE      = /usr/bin/avrdude
+      AVRDUDE_CONF = /etc/avrdude.conf
+```
+
+## Teensy 3.x
+
+For Teensy 3.x support you must first install
+[Teensyduino](http://www.pjrc.com/teensy/teensyduino.html).
+
+See examples/BlinkTeensy for example usage.
+
diff --git a/debian/arduino-mk.links b/debian/arduino-mk.links
new file mode 100644
index 0000000..1fb43e6
--- /dev/null
+++ b/debian/arduino-mk.links
@@ -0,0 +1,2 @@
+usr/share/arduino/arduino-mk-vars.md usr/share/doc/arduino-mk/arduino-mk-vars.md
+
diff --git a/debian/arduino-mk.lintian-overrides b/debian/arduino-mk.lintian-overrides
new file mode 100644
index 0000000..e69360c
--- /dev/null
+++ b/debian/arduino-mk.lintian-overrides
@@ -0,0 +1,2 @@
+# This file is used by program to emit message: make help_vars
+arduino-mk: package-contains-documentation-outside-usr-share-doc usr/share/arduino/arduino-mk-vars.md
diff --git a/debian/rules b/debian/rules
index 7f63128..a408e23 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,5 +6,5 @@
 %:
 	dh $@
 
-get-orig-source:
-	uscan --download-current-version --rename
+override_dh_compress:
+	dh_compress -X.md
-- 
2.25.0

>From 4f17c0afdeb925bd044299ac16f1695a8cb2586d Mon Sep 17 00:00:00 2001
From: Osamu Aoki <[email protected]>
Date: Sun, 12 Apr 2020 22:01:05 +0900
Subject: [PATCH 2/3] Use $(ARDMK_DIR) in examples

Signed-off-by: Osamu Aoki <[email protected]>
---
 debian/patches/0001-Use-ARDMK_DIR.patch | 175 ++++++++++++++++++++++++
 debian/patches/series                   |   1 +
 2 files changed, 176 insertions(+)
 create mode 100644 debian/patches/0001-Use-ARDMK_DIR.patch

diff --git a/debian/patches/0001-Use-ARDMK_DIR.patch b/debian/patches/0001-Use-ARDMK_DIR.patch
new file mode 100644
index 0000000..e2fabee
--- /dev/null
+++ b/debian/patches/0001-Use-ARDMK_DIR.patch
@@ -0,0 +1,175 @@
+From 8b0ceaa1a9fa09fb805f32c5677f3dfc40ff5dd5 Mon Sep 17 00:00:00 2001
+From: Osamu Aoki <[email protected]>
+Date: Sun, 12 Apr 2020 21:19:41 +0900
+Subject: [PATCH] Use $(ARDMK_DIR)
+
+Signed-off-by: Osamu Aoki <[email protected]>
+---
+ examples/AnalogInOutSerial/Makefile  | 2 +-
+ examples/Blink/Makefile              | 2 +-
+ examples/BlinkChipKIT/Makefile       | 2 +-
+ examples/BlinkInAVRC/Makefile        | 2 +-
+ examples/BlinkNetworkRPi/Makefile    | 2 +-
+ examples/BlinkTeensy/Makefile        | 2 +-
+ examples/BlinkWithoutDelay/Makefile  | 2 +-
+ examples/Fade/Makefile               | 2 +-
+ examples/HelloWorld/Makefile         | 2 +-
+ examples/SerialPrint/Makefile        | 2 +-
+ examples/TinySoftWareSerial/Makefile | 2 +-
+ examples/WebServer/Makefile          | 2 +-
+ examples/master_reader/Makefile      | 2 +-
+ examples/toneMelody/Makefile         | 2 +-
+ 14 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/examples/AnalogInOutSerial/Makefile b/examples/AnalogInOutSerial/Makefile
+index 3dea6c0..5db75de 100644
+--- a/examples/AnalogInOutSerial/Makefile
++++ b/examples/AnalogInOutSerial/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS =
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/Blink/Makefile b/examples/Blink/Makefile
+index c26b797..4cb953c 100644
+--- a/examples/Blink/Makefile
++++ b/examples/Blink/Makefile
+@@ -1,7 +1,7 @@
+ # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
+ 
+ BOARD_TAG    = uno
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+ 
+ 
+ 
+diff --git a/examples/BlinkChipKIT/Makefile b/examples/BlinkChipKIT/Makefile
+index 87a9f7d..440db29 100644
+--- a/examples/BlinkChipKIT/Makefile
++++ b/examples/BlinkChipKIT/Makefile
+@@ -1,5 +1,5 @@
+ BOARD_TAG    = mega_pic32
+ ARDUINO_LIBS =
+ 
+-include ../../chipKIT.mk
++include $(ARDMK_DIR)/chipKIT.mk
+ 
+diff --git a/examples/BlinkInAVRC/Makefile b/examples/BlinkInAVRC/Makefile
+index a4cd2e4..04049bb 100644
+--- a/examples/BlinkInAVRC/Makefile
++++ b/examples/BlinkInAVRC/Makefile
+@@ -11,6 +11,6 @@ F_CPU = 8000000L
+ ISP_PROG   = stk500v1
+ AVRDUDE_ISP_BAUDRATE = 19200
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+ 
+ # !!! Important. You have to use make ispload to upload when using ISP programmer
+diff --git a/examples/BlinkNetworkRPi/Makefile b/examples/BlinkNetworkRPi/Makefile
+index 15e565e..c119b53 100644
+--- a/examples/BlinkNetworkRPi/Makefile
++++ b/examples/BlinkNetworkRPi/Makefile
+@@ -16,7 +16,7 @@ AVRDUDE_CONF=/usr/local/etc/avrdude.conf
+ FORCE_MONITOR_PORT=true
+ MONITOR_PORT=/dev/spidev0.0
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+ 
+ 
+ # Additional rules to use a remote Raspberry Pi programmer
+diff --git a/examples/BlinkTeensy/Makefile b/examples/BlinkTeensy/Makefile
+index 1d59ef2..be58660 100644
+--- a/examples/BlinkTeensy/Makefile
++++ b/examples/BlinkTeensy/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = teensy31
+ ARDUINO_LIBS =
+ 
+-include ../../Teensy.mk
++include $(ARDMK_DIR)/Teensy.mk
+diff --git a/examples/BlinkWithoutDelay/Makefile b/examples/BlinkWithoutDelay/Makefile
+index 3dea6c0..5db75de 100644
+--- a/examples/BlinkWithoutDelay/Makefile
++++ b/examples/BlinkWithoutDelay/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS =
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/Fade/Makefile b/examples/Fade/Makefile
+index 3dea6c0..5db75de 100644
+--- a/examples/Fade/Makefile
++++ b/examples/Fade/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS =
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/HelloWorld/Makefile b/examples/HelloWorld/Makefile
+index fb94fdd..2730c53 100644
+--- a/examples/HelloWorld/Makefile
++++ b/examples/HelloWorld/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS = LiquidCrystal
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/SerialPrint/Makefile b/examples/SerialPrint/Makefile
+index f9d5cf4..5050232 100644
+--- a/examples/SerialPrint/Makefile
++++ b/examples/SerialPrint/Makefile
+@@ -2,4 +2,4 @@
+ 
+ BOARD_TAG    = uno
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/TinySoftWareSerial/Makefile b/examples/TinySoftWareSerial/Makefile
+index ffe3afc..7c60f3a 100644
+--- a/examples/TinySoftWareSerial/Makefile
++++ b/examples/TinySoftWareSerial/Makefile
+@@ -17,4 +17,4 @@ F_CPU        = 16000000L
+ 
+ ARDUINO_LIBS = SoftwareSerial
+ 
+-include /usr/share/arduino/Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/WebServer/Makefile b/examples/WebServer/Makefile
+index 51b9ac2..83fbd4e 100644
+--- a/examples/WebServer/Makefile
++++ b/examples/WebServer/Makefile
+@@ -3,4 +3,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS = Ethernet SPI
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/master_reader/Makefile b/examples/master_reader/Makefile
+index 3030deb..c650a04 100644
+--- a/examples/master_reader/Makefile
++++ b/examples/master_reader/Makefile
+@@ -3,4 +3,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS = Wire
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+diff --git a/examples/toneMelody/Makefile b/examples/toneMelody/Makefile
+index 3dea6c0..5db75de 100644
+--- a/examples/toneMelody/Makefile
++++ b/examples/toneMelody/Makefile
+@@ -1,4 +1,4 @@
+ BOARD_TAG    = uno
+ ARDUINO_LIBS =
+ 
+-include ../../Arduino.mk
++include $(ARDMK_DIR)/Arduino.mk
+-- 
+2.25.0
+
diff --git a/debian/patches/series b/debian/patches/series
index a2fba86..3d7b6ee 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 python3.patch
+0001-Use-ARDMK_DIR.patch
-- 
2.25.0

-- 
debian-science-maintainers mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to