arduino/avrdude-build-script

eudev build error on Ubuntu Mate 18.04

QrackEE opened this issue · 0 comments

Running ./package-avrdude.bash I get:

In file included from udev-builtin-keyboard.c:32:0:
keyboard-keys-from-name.h:117:1: error: conflicting types for ‘keyboard_lookup_key’
 keyboard_lookup_key (register const char *str, register size_t len)
 ^~~~~~~~~~~~~~~~~~~
udev-builtin-keyboard.c:31:26: note: previous declaration of ‘keyboard_lookup_key’ was here
 static const struct key *keyboard_lookup_key(const char *str, unsigned len);
                          ^~~~~~~~~~~~~~~~~~~
  CC       udevadm-control.o
  CC       udevadm-monitor.o
Makefile:811: recipe for target 'libudev_core_la-udev-builtin-keyboard.lo' failed
make[4]: *** [libudev_core_la-udev-builtin-keyboard.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/qrackee/workspace.local/avrdude-build-script/eudev-3.1.3/src/udev'

The udev is needed by libhidapi. Searching for the issue I found something on Gentoo forums, which directed me to gperf package (version 3.1 installed from Ubuntu repos). To pass the build process, I manually applied this fix:

  • in libhidapi.build.bash I commented out lines 29, 30 (
# wget https://github.com/gentoo/eudev/archive/v3.1.3.tar.gz
# tar xvf v3.1.3.tar.gz
  • in eudev-3.1.3/src/udev/udev-builtin-keyboard.c I commented out line 31:
// static const struct key *keyboard_lookup_key(const char *str, unsigned len);

I hope it could be solved somehow on repository level, maybe I'll give it a go in some free time, but for now I wanted to share the workaround and bring it up to discussion for better solution.
Also, the wget is conditionless, that means it re-downloads archive every time the script is sourced and creates new file (.1, .2 ...)

Best regards