- Update to 0.2.1
PR: ports/172703 Submitted by: Kai Wang <kaiwang27@gmail.com> (maintainer) Feature safe: yes
This commit is contained in:
parent
9704a7a516
commit
af16dbd73f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=306286
11 changed files with 50 additions and 124 deletions
|
@ -1,13 +1,8 @@
|
|||
# New ports collection makefile for: uhidd
|
||||
# Date created: 2009-08-07
|
||||
# Whom: Kai Wang <kaiwang27@gmail.com>
|
||||
#
|
||||
# Created by: Kai Wang <kaiwang27@gmail.com>
|
||||
# $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 <bsd.port.pre.mk>
|
||||
|
||||
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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,17 +1,10 @@
|
|||
--- uhidd/parser.y~
|
||||
+++ uhidd/parser.y
|
||||
@@ -32,13 +32,13 @@
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
|
||||
--- 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;
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
|
@ -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
|
||||
|
||||
%%
|
||||
|
|
@ -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";
|
||||
+ };
|
|
@ -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.
|
||||
*/
|
13
sysutils/uhidd/files/patch-uhidd-usb_hid_usage
Normal file
13
sysutils/uhidd/files/patch-uhidd-usb_hid_usage
Normal file
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue