aboutsummaryrefslogtreecommitdiffstats
path: root/devel/libpasori
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2009-09-24 21:56:50 +0800
committerpav <pav@FreeBSD.org>2009-09-24 21:56:50 +0800
commit0b0630033fc48476260393bc19c3a2b8637e13a7 (patch)
treea8f4ce1c2361c2f50a10dfa2729bb1c2eb2ea40e /devel/libpasori
parent21f63b21f4eea0f7301b10ebc9b56f1e2dd25dfd (diff)
downloadfreebsd-ports-gnome-0b0630033fc48476260393bc19c3a2b8637e13a7.tar.gz
freebsd-ports-gnome-0b0630033fc48476260393bc19c3a2b8637e13a7.tar.zst
freebsd-ports-gnome-0b0630033fc48476260393bc19c3a2b8637e13a7.zip
- Add local hack to libusb backend too, bump portrevision
- Correct typo PR: ports/139094 Submitted by: Yoshihiko Sarumaru <sarumaru@jp.FreeBSD.org> (maintainer) Feature safe: yes
Diffstat (limited to 'devel/libpasori')
-rw-r--r--devel/libpasori/Makefile6
-rw-r--r--devel/libpasori/files/patch-libpasori_com_libusb.c75
2 files changed, 78 insertions, 3 deletions
diff --git a/devel/libpasori/Makefile b/devel/libpasori/Makefile
index bdba12262ebb..095969f62a78 100644
--- a/devel/libpasori/Makefile
+++ b/devel/libpasori/Makefile
@@ -6,7 +6,7 @@
PORTNAME= libpasori
PORTVERSION= 02
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= ${PORTNAME}/20457
@@ -29,8 +29,8 @@ post-extract:
.else
@${CP} ${FILESDIR}/Makefile.lib.usb20 ${WRKSRC}/lib/Makefile
.endif
- @${CP} ${FILESDIR}/Makefile.lpdump ${WRKSRC}/lptest/Makefile
- @${CP} ${FILESDIR}/Makefile.lptest ${WRKSRC}/lpdump/Makefile
+ @${CP} ${FILESDIR}/Makefile.lpdump ${WRKSRC}/lpdump/Makefile
+ @${CP} ${FILESDIR}/Makefile.lptest ${WRKSRC}/lptest/Makefile
post-install:
@${CAT} ${PKGMESSAGE}
diff --git a/devel/libpasori/files/patch-libpasori_com_libusb.c b/devel/libpasori/files/patch-libpasori_com_libusb.c
new file mode 100644
index 000000000000..0041ab3a6ea0
--- /dev/null
+++ b/devel/libpasori/files/patch-libpasori_com_libusb.c
@@ -0,0 +1,75 @@
+--- src/libpasori_com_libusb.c.orig 2006-03-20 09:12:58.000000000 +0900
++++ src/libpasori_com_libusb.c 2009-03-09 03:11:29.000000000 +0900
+@@ -1,13 +1,14 @@
+ /* libpasori communicate LIBUSB ver. */
+
++#include <stdlib.h>
+ #include "libpasori_liblocal.h"
+-#include <usb.h>
+
+ #define PASORIUSB_VENDOR 0x054c
+-#define PASORIUSB_PRODUCT 0x01bb
++#define PASORIUSB_PRODUCT_RC_S310 0x006c
++#define PASORIUSB_PRODUCT_RC_S320 0x01bb
+
+ void dbg_dump(unsigned char *b,unsigned int size){
+- int i;
++ unsigned int i;
+ if(size > 255) size = 255;
+ for(i=0;i!=size;i++){
+ Log("%02X ",b[i]);
+@@ -25,8 +26,8 @@
+ pasori* pasori_open(char *p){ /* FIXME: unused arg. */
+ struct usb_bus *bus;
+ struct usb_device *dev;
+- pasori *pp;
+- pp = (pasori *)malloc(sizeof(pasori));
++ pasori *pp = NULL;
++ (void)p;
+ usb_init();
+ #ifdef DEBUG
+ usb_set_debug(255);
+@@ -40,7 +41,8 @@
+ for(dev = bus->devices; dev ; dev = dev->next){
+ Log("check for %04x:%04x\n",dev->descriptor.idVendor,dev->descriptor.idProduct); /* debug */
+ if(dev->descriptor.idVendor == PASORIUSB_VENDOR &&
+- dev->descriptor.idProduct== PASORIUSB_PRODUCT){
++ ((dev->descriptor.idProduct== PASORIUSB_PRODUCT_RC_S310) ||
++ (dev->descriptor.idProduct== PASORIUSB_PRODUCT_RC_S320))){
+ goto finish;
+ }
+ }
+@@ -48,6 +50,7 @@
+ Log("pasori not found in USB BUS");
+ return NULL;
+ finish:
++ pp = (pasori *)malloc(sizeof(pasori));
+ pp->dh = usb_open(dev);
+ pp->dev= dev;
+
+@@ -66,13 +69,13 @@
+ }
+
+ int pasori_send(pasori* pp,uint8* data,uint8 size,int timeout){ /* FIXME: ignore timeout */
+- uint8 msg[256];
+ uint8 resp[256];
+ signed int i;
++ (void)timeout;
+ Log("(send) send:");
+ dbg_dump(data,size);
+- i = usb_control_msg(pp->dh,USB_TYPE_VENDOR,0,0,0,data,size,400);
+- i = usb_interrupt_read(pp->dh,0x81,resp,256,400);
++ i = usb_control_msg(pp->dh,USB_TYPE_VENDOR,0,0,0,(char*)data,size,400);
++ i = usb_interrupt_read(pp->dh,0x81,(char*)resp,256,400);
+ /* printf("i = %d",i); */ /* debug */
+ if(i<0) return 1; /* FIXME:HANDLE INVALID RESPONSES */
+ if(i!=6) return 1;
+@@ -88,7 +91,7 @@
+
+ int pasori_recv(pasori* pp,uint8* data,uint8 size,int timeout){
+ signed int i;
+- i = usb_interrupt_read(pp->dh,0x81,data,size,timeout);
++ i = usb_interrupt_read(pp->dh,0x81,(char*)data,size,timeout);
+ if(i>0){
+ Log("(recv) recv:");
+ dbg_dump(data,i);