From af16dbd73fd666a493feee630383aac0567e2a0d Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 22 Oct 2012 20:13:36 +0000 Subject: [PATCH] - Update to 0.2.1 PR: ports/172703 Submitted by: Kai Wang (maintainer) Feature safe: yes --- sysutils/uhidd/Makefile | 51 +++++++------------ sysutils/uhidd/distinfo | 4 +- .../uhidd/files/extra-patch-uhidd-parser.y | 15 ++---- sysutils/uhidd/files/patch-hidump.c | 11 ---- sysutils/uhidd/files/patch-uhidd-lex.l | 19 ------- .../files/patch-uhidd-uhidd-devd.conf.sample | 19 ------- sysutils/uhidd/files/patch-uhidd-uhidd.c | 19 ------- .../uhidd/files/patch-uhidd-usb_hid_usage | 13 +++++ sysutils/uhidd/files/pkg-message.in | 16 ++++-- sysutils/uhidd/files/uhidd.in | 2 +- sysutils/uhidd/pkg-plist | 5 -- 11 files changed, 50 insertions(+), 124 deletions(-) delete mode 100644 sysutils/uhidd/files/patch-hidump.c delete mode 100644 sysutils/uhidd/files/patch-uhidd-lex.l delete mode 100644 sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample delete mode 100644 sysutils/uhidd/files/patch-uhidd-uhidd.c create mode 100644 sysutils/uhidd/files/patch-uhidd-usb_hid_usage diff --git a/sysutils/uhidd/Makefile b/sysutils/uhidd/Makefile index 134d716cf676..e5605e3b884d 100644 --- a/sysutils/uhidd/Makefile +++ b/sysutils/uhidd/Makefile @@ -1,13 +1,8 @@ -# New ports collection makefile for: uhidd -# Date created: 2009-08-07 -# Whom: Kai Wang -# +# Created by: Kai Wang # $FreeBSD$ -# PORTNAME= uhidd -PORTVERSION= 0.2.0 -PORTREVISION= 2 +PORTVERSION= 0.2.1 CATEGORIES= sysutils MASTER_SITES= GOOGLE_CODE \ http://people.freebsd.org/~kaiw/distfiles/ @@ -15,25 +10,24 @@ MASTER_SITES= GOOGLE_CODE \ MAINTAINER= kaiwang27@gmail.com COMMENT= Userland USB HID device driver using libusb20 -NO_PACKAGE= should be recompiled for a particular FreeBSD kernel +BUILD_DEPENDS= cuse4bsd-kmod>=0.1.24:${PORTSDIR}/multimedia/cuse4bsd-kmod +LIB_DEPENDS= cuse4bsd:${PORTSDIR}/multimedia/cuse4bsd-kmod -OPTIONS= DEVD "Install devd files" on - -MAKE_ENV+= SYSDIR=${SYSDIR} -KMODDIR?= /boot/modules -SRC_BASE?= /usr/src -SYSDIR?= ${SRC_BASE}/sys +OPTIONS_DEFINE= DEVD +OPTIONS_DEFAULT= DEVD USE_RC_SUBR= uhidd SUB_FILES= pkg-message -PLIST_SUB= KMODDIR=${KMODDIR} -MAN4= uvhid.4 MAN5= uhidd.conf.5 MAN8= uhidd.8 +LIBDIR= ${PREFIX}/lib + .include +LIBCUSE= ${LIBDIR}/libcuse4bsd.so + .if defined(DEBUG_FLAGS) MAKE_ENV+= DEBUG_FLAGS='${DEBUG_FLAGS}' .endif @@ -44,34 +38,27 @@ IGNORE= does not build with the old USB stack EXTRA_PATCHES+= ${FILESDIR}/extra-patch-uhidd-parser.y .endif -.if !(exists(${SYSDIR}/Makefile) || exists(${SRC_BASE}/sys/Makefile)) -IGNORE= requires kernel source files -.endif - -.if !defined(WITHOUT_DEVD) +.if ${PORT_OPTIONS:MDEVD} PLIST_SUB+= PL_DEVD="" .else PLIST_SUB+= PL_DEVD="@comment " .endif post-patch: .SILENT - ${FIND} ${WRKSRC}/uhidd -type f -exec ${REINPLACE_CMD} \ - 's|/usr/local|${PREFIX}|g' {} + - ${REINPLACE_CMD} 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/uhidd/Makefile + ${FIND} ${WRKSRC}/uhidd -type f -not -name Makefile \ + -exec ${REINPLACE_CMD} 's|/usr/local|${PREFIX}|g' {} + + ${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/uhidd/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/uhidd/uhidd ${PREFIX}/sbin/uhidd - ${INSTALL_KLD} ${WRKSRC}/uvhid/uvhid.ko ${KMODDIR}/uvhid.ko -.if exists(${WRKSRC}/uvhid/uvhid.ko.symbols) - ${INSTALL_KLD} ${WRKSRC}/uvhid/uvhid.ko.symbols ${KMODDIR}/uvhid.ko.symbols -.endif ${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.8 ${PREFIX}/man/man8/uhidd.8 ${INSTALL_MAN} ${WRKSRC}/uhidd/uhidd.conf.5 ${PREFIX}/man/man5/uhidd.conf.5 - ${INSTALL_MAN} ${WRKSRC}/uvhid/uvhid.4 ${PREFIX}/man/man4/uvhid.4 -.if !defined(WITHOUT_DEVD) +.if ${PORT_OPTIONS:MDEVD} ${MKDIR} ${PREFIX}/etc/devd - ${REINPLACE_CMD} -Ee \ - "s%/usr/local%${PREFIX}%" ${WRKSRC}/uhidd/uhidd-devd.conf.sample + ${REINPLACE_CMD} -E \ + -e "s|%%PREFIX%%|${PREFIX}|" \ + -e "s|%%LIBCUSE%%|${LIBCUSE}|" \ + ${WRKSRC}/uhidd/uhidd-devd.conf.sample ${INSTALL_DATA} ${WRKSRC}/uhidd/uhidd-devd.conf.sample ${PREFIX}/etc/devd/ @if [ ! -f ${PREFIX}/etc/devd/uhidd-devd.conf ]; then \ ${CP} -p ${PREFIX}/etc/devd/uhidd-devd.conf.sample \ diff --git a/sysutils/uhidd/distinfo b/sysutils/uhidd/distinfo index c354e0208c8f..7e37b0dff4a8 100644 --- a/sysutils/uhidd/distinfo +++ b/sysutils/uhidd/distinfo @@ -1,2 +1,2 @@ -SHA256 (uhidd-0.2.0.tar.gz) = d447a1e5625f33892d619353b68d4d71151f492be1217443ace06470fadf2952 -SIZE (uhidd-0.2.0.tar.gz) = 54949 +SHA256 (uhidd-0.2.1.tar.gz) = fa049cc93c722411636bf9c475d8da8a0ff519d9e433838e42af63fb64f808e7 +SIZE (uhidd-0.2.1.tar.gz) = 61390 diff --git a/sysutils/uhidd/files/extra-patch-uhidd-parser.y b/sysutils/uhidd/files/extra-patch-uhidd-parser.y index e9d0c71f0d18..6992bc82b3b2 100644 --- a/sysutils/uhidd/files/extra-patch-uhidd-parser.y +++ b/sysutils/uhidd/files/extra-patch-uhidd-parser.y @@ -1,17 +1,10 @@ ---- uhidd/parser.y~ -+++ uhidd/parser.y -@@ -32,13 +32,13 @@ - #include - #include - #include -+#include - #include - #include - +--- uhidd/parser.y.old 2012-10-14 22:33:00.000000000 +0200 ++++ uhidd/parser.y 2012-10-14 22:33:06.000000000 +0200 +@@ -39,7 +39,6 @@ #include "uhidd.h" extern int yylex(void); -extern int yyparse(void); extern int lineno; extern FILE *yyin; - + diff --git a/sysutils/uhidd/files/patch-hidump.c b/sysutils/uhidd/files/patch-hidump.c deleted file mode 100644 index 3a536456e452..000000000000 --- a/sysutils/uhidd/files/patch-hidump.c +++ /dev/null @@ -1,11 +0,0 @@ ---- uhidd/uhidd_hidump.c~ -+++ uhidd/uhidd_hidump.c -@@ -296,7 +296,7 @@ get_unit(int dval, unsigned int sz) - - normal: - for (i = 1; (unsigned int)i < sz * 2; i++) { -- nibble = (dval >> (i * 4)) && 0x0F; -+ nibble = (dval >> (i * 4)) & 0x0F; - if (!nibble) - continue; - if (nibble > 7) diff --git a/sysutils/uhidd/files/patch-uhidd-lex.l b/sysutils/uhidd/files/patch-uhidd-lex.l deleted file mode 100644 index 1feea71aa942..000000000000 --- a/sysutils/uhidd/files/patch-uhidd-lex.l +++ /dev/null @@ -1,19 +0,0 @@ ---- uhidd/lex.l~ -+++ uhidd/lex.l -@@ -34,7 +34,6 @@ - - #include "y.tab.h" - --#define YY_NO_UNPUT - int lineno = 1; - - int yylex(void); -@@ -42,6 +41,8 @@ - %} - - %option noyywrap -+%option nounput -+%option noinput - - %% - diff --git a/sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample b/sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample deleted file mode 100644 index c020dfae1dc5..000000000000 --- a/sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample +++ /dev/null @@ -1,19 +0,0 @@ -Index: sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample -=================================================================== -RCS file: sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample -diff -N sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ sysutils/uhidd/files/patch-uhidd-uhidd-devd.conf.sample 8 Aug 2011 03:25:53 -0000 -@@ -0,0 +1,12 @@ -+--- uhidd/uhidd-devd.conf.sample~ -++++ uhidd/uhidd-devd.conf.sample -+@@ -1,4 +1,6 @@ -+-attach 0 { -+- match "device-name" "ugen[0-9]+.[0-9]+"; -+- action "/usr/local/etc/rc.d/uhidd start /dev/$device-name"; -++notify 0 { -++ match "subsystem" "DEVICE"; -++ match "type" "ATTACH"; -++ match "cdev" "ugen[0-9]+.[0-9]+"; -++ action "/usr/local/etc/rc.d/uhidd start /dev/$cdev"; -+ }; \ No newline at end of file diff --git a/sysutils/uhidd/files/patch-uhidd-uhidd.c b/sysutils/uhidd/files/patch-uhidd-uhidd.c deleted file mode 100644 index e62091b8ba9f..000000000000 --- a/sysutils/uhidd/files/patch-uhidd-uhidd.c +++ /dev/null @@ -1,19 +0,0 @@ ---- uhidd/uhidd.c~ -+++ uhidd/uhidd.c -@@ -313,7 +313,6 @@ - static int - open_device(const char *dev, struct libusb20_device *pdev) - { -- struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; - struct libusb20_config *config; - struct libusb20_interface *iface; - int cndx, e, i; -@@ -334,8 +333,6 @@ open_device(const char *dev, struct libu - return (-1); - } - -- ddesc = libusb20_dev_get_device_desc(pdev); -- - /* - * Iterate each interface. - */ diff --git a/sysutils/uhidd/files/patch-uhidd-usb_hid_usage b/sysutils/uhidd/files/patch-uhidd-usb_hid_usage new file mode 100644 index 000000000000..ebf340e85fb5 --- /dev/null +++ b/sysutils/uhidd/files/patch-uhidd-usb_hid_usage @@ -0,0 +1,13 @@ +--- uhidd/usb_hid_usages.orig 2012-10-21 19:01:23.182592810 +0200 ++++ uhidd/usb_hid_usages 2012-10-21 19:02:36.603616460 +0200 +@@ -1270,8 +1270,8 @@ + 0x48 Top Corner Distortion Balance + 0x4A Bottom Corner Distortion Control + 0x4C Bottom Corner Distortion Balance +- 0x56 Horizontal Moiré +- 0x58 Vertical Moiré ++ 0x56 Horizontal Moire ++ 0x58 Vertical Moire + 0x5E Input Level Select + 0x60 Input Source Select + 0x6C Red Video Black Level diff --git a/sysutils/uhidd/files/pkg-message.in b/sysutils/uhidd/files/pkg-message.in index ee9bdacd3b71..6788efb3eee9 100644 --- a/sysutils/uhidd/files/pkg-message.in +++ b/sysutils/uhidd/files/pkg-message.in @@ -2,15 +2,21 @@ To use uhidd daemon for USB HID devices, depends on which sub class driver you want to attach, to avoid confilicts between the daemon and -the kernel drivers, you need to remove some of these entries 'device -ums', 'device ukbd', or 'device uhid' from your kernel config file and -recompile the kernel. Or if these drivers are loaded as kernel -modules, kldunload those that conflicts. +the kernel drivers, you should either use the command line option '-u' +to instruct the daemon to detach active kernel drivers attached to +a device, or you should remove some of those entries 'device ums', +'device ukbd', or 'device uhid' from your kernel config file and +recompile the kernel. + +Note that if the USB kernel drivers are compiled as kernel modules, +you should also remove the relevant devd(8) rules in /etc/devd/usb.conf +config file, so those modules will not be loaded automatically by devd(8) +when devices are attached. If you want to run uhidd deamon at the startup, add the following lines to /etc/rc.conf: - uhidd_flags="-kmohs" + uhidd_flags="-kmohsu" uhidd_enable="YES" Note that you need to modify the uhidd_flags (command line options) diff --git a/sysutils/uhidd/files/uhidd.in b/sysutils/uhidd/files/uhidd.in index ed478a87564e..1e9cd29753bf 100644 --- a/sysutils/uhidd/files/uhidd.in +++ b/sysutils/uhidd/files/uhidd.in @@ -19,7 +19,7 @@ name="uhidd" rcvar=uhidd_enable command="%%PREFIX%%/sbin/${name}" start_cmd="uhidd_start" -required_modules="uvhid vkbd" +required_modules="vkbd" pidprefix="/var/run/uhidd" load_rc_config $name diff --git a/sysutils/uhidd/pkg-plist b/sysutils/uhidd/pkg-plist index 9d855ad3f972..413311a801ee 100644 --- a/sysutils/uhidd/pkg-plist +++ b/sysutils/uhidd/pkg-plist @@ -2,8 +2,3 @@ %%PL_DEVD%%etc/devd/uhidd-devd.conf.sample %%PL_DEVD%%@exec if [ ! -f %D/etc/devd/uhidd-devd.conf ]; then mkdir -p %B; cp -p %D/%F %B/uhidd-devd.conf; fi sbin/uhidd -@cwd %%KMODDIR%% -uvhid.ko -@rmtry uvhid.ko.symbols -@exec kldxref %D -@unexec kldxref %D