New package: dfu-programmer 0.7.2

This commit is contained in:
fauxpark
2020-08-11 09:55:38 +10:00
parent 6720d21ac9
commit 4b8b3fbfb3
2 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
--- a/configure.ac
+++ b/configure.ac
@@ -41,9 +41,9 @@
dnl Fallback to the old libusb
dnl libusb >= 0.1.8 is required, as we need usb_interrupt_read()
AS_ECHO("using libusb");
- AC_CHECK_HEADER(usb.h,
- AC_CHECK_LIB(usb, usb_interrupt_read,
- [LIBS="$LIBS -lusb"
+ AC_CHECK_HEADER(lusb0_usb.h,
+ AC_CHECK_LIB(usb0, usb_interrupt_read,
+ [LIBS="$LIBS -lusb0"
HAVE_USB=yes]))
fi
--- a/src/dfu-device.h
+++ b/src/dfu-device.h
@@ -8,7 +8,7 @@
#ifdef HAVE_LIBUSB_1_0
#include <libusb.h>
#else
-#include <usb.h>
+#include <lusb0_usb.h>
#endif
// Atmel device classes are now defined with one bit per class.
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -29,7 +29,7 @@
#ifdef HAVE_LIBUSB_1_0
#include <libusb.h>
#else
-#include <usb.h>
+#include <lusb0_usb.h>
#endif
#include <errno.h>
#include "dfu.h"
--- a/src/dfu.h
+++ b/src/dfu.h
@@ -27,7 +27,7 @@
#ifdef HAVE_LIBUSB_1_0
#include <libusb.h>
#else
-#include <usb.h>
+#include <lusb0_usb.h>
#endif
#include <stdint.h>
#include <stddef.h>
--- a/src/main.c
+++ b/src/main.c
@@ -26,7 +26,7 @@
#ifdef HAVE_LIBUSB_1_0
#include <libusb.h>
#else
-#include <usb.h>
+#include <lusb0_usb.h>
#endif
#include "config.h"

View File

@@ -0,0 +1,41 @@
# Maintainer: fauxpark <fauxpark@gmail.com>
_realname=dfu-programmer
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=0.7.2
pkgrel=1
pkgdesc='Device firmware update based USB programmer for Atmel chips (mingw-w64)'
arch=('any')
license=('GPL')
url='https://github.com/dfu-programmer/dfu-programmer'
makedepends=("${MINGW_PACKAGE_PREFIX}-libusb-win32")
source=(
"https://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/${pkgver}/dfu-programmer-${pkgver}.tar.gz"
01-use-libusb-win32.patch
)
sha256sums=(
'1db4d36b1aedab2adc976e8faa5495df3cf82dc4bf883633dc6ba71f7c4af995'
'7c8d27dbc8b24aefa54514594711301852741021623b25af136271d767a0fdc8'
)
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
patch -p1 -i ../01-use-libusb-win32.patch
}
build() {
cd ${srcdir}/${_realname}-${pkgver}
./bootstrap.sh
./configure \
--prefix=${MINGW_PREFIX} \
--disable-libusb_1_0
}
package() {
cd ${srcdir}/${_realname}-${pkgver}
make DESTDIR="$pkgdir" install
}