diff options
author | Evgeny Shvits | 2020-06-06 19:48:55 +0300 |
---|---|---|
committer | Evgeny Shvits | 2020-06-06 19:48:55 +0300 |
commit | a6fae6c03f375fa448d796647f9e14c51e28c3a2 (patch) | |
tree | bfa9e10435fb577fc41f04616a7f57adf33522e3 | |
parent | 832bd98a841943d731e26180f88d73b18493e6c5 (diff) | |
download | aur-a6fae6c03f375fa448d796647f9e14c51e28c3a2.tar.gz |
PATCH: fix ch341funcs.c for new libusb and add extern in *readbuf
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 16 | ||||
-rw-r--r-- | extern_readbuf.patch | 13 | ||||
-rw-r--r-- | libusb_set_option.patch | 18 |
4 files changed, 49 insertions, 4 deletions
@@ -1,14 +1,18 @@ pkgbase = ch341eepromtool pkgdesc = An i2c serial EEPROM programming tool for the WCH CH341A pkgver = 0.5 - pkgrel = 2 + pkgrel = 3 url = https://github.com/stefanct/ch341eepromtool arch = i686 arch = x86_64 license = GPL3 depends = libusb>=1 source = git+https://github.com/stefanct/ch341eepromtool.git#commit=6b41e07 + source = libusb_set_option.patch + source = extern_readbuf.patch md5sums = SKIP + md5sums = 9c2db0e0c9e72be4d9d8e6544e75c34b + md5sums = 5409cb99d67bbe4decab130e4c688c74 pkgname = ch341eepromtool @@ -2,15 +2,25 @@ pkgname=ch341eepromtool pkgver=0.5 -pkgrel=2 +pkgrel=3 _git_commit="6b41e07" pkgdesc="An i2c serial EEPROM programming tool for the WCH CH341A" arch=('i686' 'x86_64') url="https://github.com/stefanct/ch341eepromtool" license=('GPL3') depends=('libusb>=1') -source=("git+https://github.com/stefanct/ch341eepromtool.git#commit=${_git_commit}") -md5sums=('SKIP') +source=("git+https://github.com/stefanct/ch341eepromtool.git#commit=${_git_commit}" + "libusb_set_option.patch" + "extern_readbuf.patch") +md5sums=('SKIP' + '9c2db0e0c9e72be4d9d8e6544e75c34b' + '5409cb99d67bbe4decab130e4c688c74') + +prepare() { + cd "${srcdir}/${pkgname}" + patch -p1 --input="${srcdir}/libusb_set_option.patch" + patch -p1 --input="${srcdir}/extern_readbuf.patch" +} build() { cd "${srcdir}/${pkgname}" diff --git a/extern_readbuf.patch b/extern_readbuf.patch new file mode 100644 index 000000000000..c0cdebf212cb --- /dev/null +++ b/extern_readbuf.patch @@ -0,0 +1,13 @@ +diff --git a/ch341funcs.c b/ch341funcs.c +index 3bed06b..55ba7cf 100644 +--- a/ch341funcs.c ++++ b/ch341funcs.c +@@ -30,7 +30,7 @@ extern FILE *debugout, *verbout; + uint32_t getnextpkt; // set by the callback function + uint32_t syncackpkt; // synch / ack flag used by BULK OUT cb function + uint16_t byteoffset; +-uint8_t *readbuf; ++extern uint8_t *readbuf; + + // -------------------------------------------------------------------------- + // ch341configure() diff --git a/libusb_set_option.patch b/libusb_set_option.patch new file mode 100644 index 000000000000..c0020538c91c --- /dev/null +++ b/libusb_set_option.patch @@ -0,0 +1,18 @@ +diff --git a/ch341funcs.c b/ch341funcs.c +index 23c5236..3bed06b 100644 +--- a/ch341funcs.c ++++ b/ch341funcs.c +@@ -58,8 +58,12 @@ struct libusb_device_handle *ch341configure(uint16_t vid, uint16_t pid) { + fprintf(stderr, "Couldnt initialise libusb\n"); + return NULL; + } +- ++ ++#if LIBUSB_API_VERSION < 0x01000106 + libusb_set_debug(NULL, 3); // maximum debug logging level ++#else ++ libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, 3); ++#endif + + fprintf(verbout, "Searching USB buses for WCH CH341a i2c EEPROM programmer [%04x:%04x]\n", + USB_LOCK_VENDOR, USB_LOCK_PRODUCT); |