all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add dfu-programmer
@ 2014-09-29 10:46 Manolis Ragkousis
  2014-09-29 16:09 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Manolis Ragkousis @ 2014-09-29 10:46 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 43 bytes --]

Another programmer for avr chips.

Manolis

[-- Attachment #2: 0001-gnu-Add-dfu-programmer.patch --]
[-- Type: text/x-patch, Size: 5164 bytes --]

From 8f0da7d367be1995f8980992a647adedd85d2f1c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Mon, 29 Sep 2014 13:27:30 +0300
Subject: [PATCH] gnu: Add dfu-programmer

* gnu/packages/dfu-programmer.scm: New file
* gnu-system.am (GNU_SYSTEM_MODULES): Add dfu-programmer.scm
* gnu/packages/patches/dfu-programmer-fix-libusb.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                                      |  2 +
 gnu/packages/dfu-programmer.scm                    | 48 ++++++++++++++++++
 .../patches/dfu-programmer-fix-libusb.patch        | 57 ++++++++++++++++++++++
 3 files changed, 107 insertions(+)
 create mode 100644 gnu/packages/dfu-programmer.scm
 create mode 100644 gnu/packages/patches/dfu-programmer-fix-libusb.patch

diff --git a/gnu-system.am b/gnu-system.am
index e774f50..a30e7d4 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -71,6 +71,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/datamash.scm			\
   gnu/packages/dc.scm				\
   gnu/packages/dejagnu.scm			\
+  gnu/packages/dfu-programmer.scm		\
   gnu/packages/dictionaries.scm			\
   gnu/packages/disk.scm				\
   gnu/packages/docbook.scm			\
@@ -318,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/emacs-configure-sh.patch			\
diff --git a/gnu/packages/dfu-programmer.scm b/gnu/packages/dfu-programmer.scm
new file mode 100644
index 0000000..e8e69a5
--- /dev/null
+++ b/gnu/packages/dfu-programmer.scm
@@ -0,0 +1,48 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages dfu-programmer)
+  #:use-module (guix licenses)
+  #:use-module (guix download)
+  #:use-module (guix packages)
+  #:use-module (gnu packages)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages libusb))
+
+(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 "Dfu-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 0000000..e9e21f3
--- /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 <stdint.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <stdio.h>
+ #include <string.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <stdlib.h>
+ #include <stddef.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <config.h>
+ #endif
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #endif
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add dfu-programmer
  2014-09-29 10:46 [PATCH] gnu: Add dfu-programmer Manolis Ragkousis
@ 2014-09-29 16:09 ` Ludovic Courtès
  2014-10-01  6:22   ` Manolis Ragkousis
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-09-29 16:09 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> From 8f0da7d367be1995f8980992a647adedd85d2f1c Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Mon, 29 Sep 2014 13:27:30 +0300
> Subject: [PATCH] gnu: Add dfu-programmer
>
> * gnu/packages/dfu-programmer.scm: New file
> * gnu-system.am (GNU_SYSTEM_MODULES): Add dfu-programmer.scm
> * gnu/packages/patches/dfu-programmer-fix-libusb.patch: New patch.
> * gnu-system.am (dist_patch_DATA): Add it.

As discussed on #guix, it might be good to move it to a ‘flashing-tools’
module or something?

> +    (home-page "http://dfu-programmer.github.io/")
> +    (synopsis "Dfu-programmer for Atmel chips")

Rather “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")

Please wrap lines to less than 80 chars.

> +--- a/src/dfu-device.h
> ++++ b/src/dfu-device.h
> +@@ -6,7 +6,7 @@
> + #endif
> + #include <stdint.h>
> + #ifdef HAVE_LIBUSB_1_0
> +-#include <libusb.h>
> ++#include <libusb-1.0/libusb.h>

I think the bug is rather that pkg-config is missing, because libusb.pc
has this line:

  Cflags: -I${includedir}/libusb-1.0

Could you try adding it as a native input and report back?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add dfu-programmer
  2014-09-29 16:09 ` Ludovic Courtès
@ 2014-10-01  6:22   ` Manolis Ragkousis
  2014-10-02  8:47     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Manolis Ragkousis @ 2014-10-01  6:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

On 29 September 2014 19:09, Ludovic Courtès <ludo@gnu.org> wrote:
> As discussed on #guix, it might be good to move it to a ‘flashing-tools’
> module or something?
Done

> Rather “Device firmware update programmer for Atmel chips”.
Done

> Please wrap lines to less than 80 chars.
Done

> I think the bug is rather that pkg-config is missing, because libusb.pc
> has this line:
>
>   Cflags: -I${includedir}/libusb-1.0
>
> Could you try adding it as a native input and report back?

I did but nothing changed, still couldn't find libusb.h .
In their mailing list there was one such problem, for the previous
version, but they didn't suggested any solution on the issue.
http://sourceforge.net/p/dfu-programmer/mailman/message/30507932/

Updated patch.

Manolis

[-- Attachment #2: 0002-gnu-Add-dfu-programmer.patch --]
[-- Type: text/x-patch, Size: 3875 bytes --]

From 7f17acea56a32013574db6b755fc1a2362c1addc Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Mon, 29 Sep 2014 13:27:30 +0300
Subject: [PATCH] gnu: Add dfu-programmer

* 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.
---
 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 642751c..94d8624 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 d2f1b46..648430a 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -104,3 +104,26 @@ programmer devices.")
 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 0000000..e9e21f3
--- /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 <stdint.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <stdio.h>
+ #include <string.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <stdlib.h>
+ #include <stddef.h>
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #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 <config.h>
+ #endif
+ #ifdef HAVE_LIBUSB_1_0
+-#include <libusb.h>
++#include <libusb-1.0/libusb.h>
+ #else
+ #include <usb.h>
+ #endif
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gnu: Add dfu-programmer
  2014-10-01  6:22   ` Manolis Ragkousis
@ 2014-10-02  8:47     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2014-10-02  8:47 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> On 29 September 2014 19:09, Ludovic Courtès <ludo@gnu.org> wrote:

[...]

>> I think the bug is rather that pkg-config is missing, because libusb.pc
>> has this line:
>>
>>   Cflags: -I${includedir}/libusb-1.0
>>
>> Could you try adding it as a native input and report back?
>
> I did but nothing changed, still couldn't find libusb.h .

Indeed, configure.ac doesn’t use the PKG_ macros, but it really should.

> In their mailing list there was one such problem, for the previous
> version, but they didn't suggested any solution on the issue.
> http://sourceforge.net/p/dfu-programmer/mailman/message/30507932/

OK.

> Updated patch.

Pushed, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-02  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-29 10:46 [PATCH] gnu: Add dfu-programmer Manolis Ragkousis
2014-09-29 16:09 ` Ludovic Courtès
2014-10-01  6:22   ` Manolis Ragkousis
2014-10-02  8:47     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.