From 2a9a4fb8b7ae519a7d28a1e6b96e0a0a5aed3201 Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis Date: Mon, 29 Sep 2014 13:27:30 +0300 Subject: [PATCH] gnu: Add dfu-programmer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/flashing-tools.scm (dfu-programmer): New variable. * gnu/packages/patches/dfu-programmer-fix-libusb.patch: New patch. * gnu-system.am (dist_patch_DATA): Add it. Signed-off-by: Ludovic Courtès --- gnu-system.am | 1 + gnu/packages/flashing-tools.scm | 23 ++++++++ .../patches/dfu-programmer-fix-libusb.patch | 57 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 gnu/packages/patches/dfu-programmer-fix-libusb.patch diff --git a/gnu-system.am b/gnu-system.am index 642751c9ea..94d86246c9 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -319,6 +319,7 @@ dist_patch_DATA = \ gnu/packages/patches/cursynth-wave-rand.patch \ gnu/packages/patches/dbus-localstatedir.patch \ gnu/packages/patches/diffutils-gets-undeclared.patch \ + gnu/packages/patches/dfu-programmer-fix-libusb.patch \ gnu/packages/patches/doxygen-test.patch \ gnu/packages/patches/doxygen-tmake.patch \ gnu/packages/patches/duplicity-piped-password.patch \ diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm index d2f1b469b6..648430ad5a 100644 --- a/gnu/packages/flashing-tools.scm +++ b/gnu/packages/flashing-tools.scm @@ -104,3 +104,26 @@ (define-public avrdude EEPROM contents of AVR microcontrollers using the in-system programming technique (ISP).") (license gpl2+))) + +(define-public dfu-programmer + (package + (name "dfu-programmer") + (version "0.7.0") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/dfu-programmer/dfu-programmer-" + version ".tar.gz")) + (sha256 + (base32 + "17lglglk5xrqd2n0impg5bkq4j96qc51cw3kzcghzmzmn6fvg3gf")) + (patches (list (search-patch "dfu-programmer-fix-libusb.patch"))))) + (build-system gnu-build-system) + (inputs + `(("libusb" ,libusb))) + (home-page "http://dfu-programmer.github.io/") + (synopsis "Device firmware update programmer for Atmel chips") + (description + "Dfu-programmer is a multi-platform command-line programmer for Atmel +(8051, AVR, XMEGA & AVR32) chips with a USB bootloader supporting ISP") + (license gpl2+))) diff --git a/gnu/packages/patches/dfu-programmer-fix-libusb.patch b/gnu/packages/patches/dfu-programmer-fix-libusb.patch new file mode 100644 index 0000000000..e9e21f3880 --- /dev/null +++ b/gnu/packages/patches/dfu-programmer-fix-libusb.patch @@ -0,0 +1,57 @@ +Dfu-programmer cannot cannot find libusb. This patch fixes that. + +diff --git a/src/dfu-device.h b/src/dfu-device.h +index bbdfa99..31af0e8 100644 +--- a/src/dfu-device.h ++++ b/src/dfu-device.h +@@ -6,7 +6,7 @@ + #endif + #include + #ifdef HAVE_LIBUSB_1_0 +-#include ++#include + #else + #include + #endif + +diff --git a/src/main.c b/src/main.c +index ef2aa16..dcc3636 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -24,7 +24,7 @@ + #include + #include + #ifdef HAVE_LIBUSB_1_0 +-#include ++#include + #else + #include + #endif + +diff --git a/src/dfu.c b/src/dfu.c +index 7dbcc57..952e896 100644 +--- a/src/dfu.c ++++ b/src/dfu.c +@@ -27,7 +27,7 @@ + #include + #include + #ifdef HAVE_LIBUSB_1_0 +-#include ++#include + #else + #include + #endif + +diff --git a/src/dfu.h b/src/dfu.h +index 2a159e8..63510f2 100644 +--- a/src/dfu.h ++++ b/src/dfu.h +@@ -25,7 +25,7 @@ + # include + #endif + #ifdef HAVE_LIBUSB_1_0 +-#include ++#include + #else + #include + #endif