pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/libhidapi Import libhidapi-0.7.0 as comms/libhid...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a92c22bbe6e1
branches:  trunk
changeset: 649500:a92c22bbe6e1
user:      rodent <rodent%pkgsrc.org@localhost>
date:      Fri Apr 03 22:29:12 2015 +0000

description:
Import libhidapi-0.7.0 as comms/libhidapi.

HIDAPI is a multi-platform library which allows an application to interface
with USB and Bluetooth HID-Class devices on Windows, Linux, and Mac OS X.
On Windows, a DLL is built.  On other platforms (and optionally on Windows),
the single source file can simply be dropped into a target application.

HIDAPI has four back-ends:
        * Windows (using hid.dll)
        * Linux/hidraw (using the Kernel's hidraw driver)
        * Linux/libusb (using libusb-1.0)
        * Mac (using IOHidManager)

This package includes only the libusb backend.

diffstat:

 comms/libhidapi/DESCR                            |  12 ++++++
 comms/libhidapi/Makefile                         |  27 ++++++++++++++
 comms/libhidapi/PLIST                            |   5 ++
 comms/libhidapi/buildlink3.mk                    |  12 ++++++
 comms/libhidapi/distinfo                         |   7 +++
 comms/libhidapi/patches/patch-Makefile           |  44 ++++++++++++++++++++++++
 comms/libhidapi/patches/patch-linux_hid-libusb.c |  15 ++++++++
 7 files changed, 122 insertions(+), 0 deletions(-)

diffs (150 lines):

diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/DESCR     Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,12 @@
+HIDAPI is a multi-platform library which allows an application to interface
+with USB and Bluetooth HID-Class devices on Windows, Linux, and Mac OS X.
+On Windows, a DLL is built.  On other platforms (and optionally on Windows),
+the single source file can simply be dropped into a target application.
+
+HIDAPI has four back-ends:
+       * Windows (using hid.dll)
+       * Linux/hidraw (using the Kernel's hidraw driver)
+       * Linux/libusb (using libusb-1.0)
+       * Mac (using IOHidManager)
+
+This package includes only the libusb backend.
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/Makefile  Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2015/04/03 22:29:12 rodent Exp $
+
+GITHUB_PROJECT=        hidapi
+GITHUB_TAG=    ${GITHUB_PROJECT}-0.7.0
+DISTNAME=      ${GITHUB_TAG}
+PKGNAME=       lib${DISTNAME}
+CATEGORIES=    comms devel
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=signal11/}
+
+MAINTAINER=    nathanialsloss%yahoo.com.au@localhost
+HOMEPAGE=      http://www.signal11.us/oss/hidapi/
+COMMENT=       Library for comunicating with bluetooth and usb hid devices
+LICENSE=       gnu-gpl-v3 OR modified-bsd
+
+USE_LANGUAGES= c c++
+USE_TOOLS+=    gmake pkg-config
+
+NO_CONFIGURE=          yes
+WRKSRC=                        ${WRKDIR}/hidapi-${DISTNAME}
+INSTALLATION_DIRS+=    include/hidapi lib
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+CFLAGS+=               -fPIC
+
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/PLIST     Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2015/04/03 22:29:12 rodent Exp $
+include/hidapi/hidapi.h
+lib/libhidapi.so
+lib/libhidapi.so.0
+lib/libhidapi.so.${PKGVERSION}
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/buildlink3.mk     Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2015/04/03 22:29:12 rodent Exp $
+
+BUILDLINK_TREE+=       libhidapi
+
+.if !defined(LIBHIDAPI_BUILDLINK3_MK)
+LIBHIDAPI_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libhidapi+=      libhidapi>=0.7.0
+BUILDLINK_PKGSRCDIR.libhidapi?=        ../../comms/libhidapi
+.endif
+
+BUILDLINK_TREE+=       -libhidapi
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/distinfo  Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2015/04/03 22:29:12 rodent Exp $
+
+SHA1 (hidapi-0.7.0.tar.gz) = caed4fd63098293fec487e8673ea992d35db04ba
+RMD160 (hidapi-0.7.0.tar.gz) = 02ccd173c547cda5e65144eea331d608a5aff414
+Size (hidapi-0.7.0.tar.gz) = 1618395 bytes
+SHA1 (patch-Makefile) = 9cc8e81d22a05a1132cf35c3d62656202e0788b9
+SHA1 (patch-linux_hid-libusb.c) = 908032c29cbdb0e4aef0eaa370d840a8a8696eea
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/patches/patch-Makefile    Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-Makefile,v 1.1 2015/04/03 22:29:12 rodent Exp $
+
+Makefile for libhidapi.so
+
+--- Makefile.orig      2014-01-08 11:11:31.000000000 +0000
++++ Makefile
+@@ -0,0 +1,37 @@
++###########################################
++# Simple Makefile for HIDAPI test program
++#
++# Alan Ott
++# Signal 11 Software
++# 2010-06-01
++###########################################
++
++all: libhidapi.so.0.7.0
++
++CC       ?= gcc
++CFLAGS   ?= -Wall -g
++
++CXX      ?= g++
++CXXFLAGS ?= -Wall -g
++
++COBJS     = linux/hid-libusb.o
++OBJS      = $(COBJS)
++LIBS      = `pkg-config libusb-1.0 --libs`
++INCLUDES ?= -Ihidapi `pkg-config libusb-1.0 --cflags`
++
++
++libhidapi.so.0.7.0: $(OBJS)
++      $(CC) $(CFLAGS) -shared $(LDFLAGS) $^ $(LIBS) -o libhidapi.so.0.7.0
++
++$(COBJS): %.o: %.c
++      $(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
++
++install:
++      ${BSD_INSTALL_DATA} hidapi/* $(DESTDIR)$(PREFIX)/include/hidapi
++      ${BSD_INSTALL_LIB} libhidapi.so.0.7.0 $(DESTDIR)$(PREFIX)/lib
++      ln -s libhidapi.so.0.7.0 $(DESTDIR)$(PREFIX)/lib/libhidapi.so.0
++      ln -s libhidapi.so.0.7.0 $(DESTDIR)$(PREFIX)/lib/libhidapi.so
++clean:
++      rm -f $(OBJS) libhidapi.so.0.7.0
++
++.PHONY: clean
diff -r bfe45571a7ea -r a92c22bbe6e1 comms/libhidapi/patches/patch-linux_hid-libusb.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/libhidapi/patches/patch-linux_hid-libusb.c  Fri Apr 03 22:29:12 2015 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-linux_hid-libusb.c,v 1.1 2015/04/03 22:29:12 rodent Exp $
+
+inptr has to be type casted for iconv on NetBSD.
+
+--- linux/hid-libusb.c.orig    2011-10-26 00:58:17.000000000 +0000
++++ linux/hid-libusb.c
+@@ -351,7 +351,7 @@ static wchar_t *get_usb_string(libusb_de
+       inbytes = len-2;
+       outptr = (char*) wbuf;
+       outbytes = sizeof(wbuf);
+-      res = iconv(ic, &inptr, &inbytes, &outptr, &outbytes);
++      res = iconv(ic, (const char **) &inptr, &inbytes, &outptr, &outbytes);
+       if (res == (size_t)-1)
+               goto err;
+ 



Home | Main Index | Thread Index | Old Index