1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

- Update to 0.9.0 .

- Add devinput driver (/dev/input/eventX, -H devinput) in preparation
  for upcoming webcamd update that will support it.
- Fix build with clang, and a few bugs it found too.
This commit is contained in:
Juergen Lock 2011-06-28 18:12:32 +00:00
parent ccc6f00702
commit 89b53c9312
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=276586
7 changed files with 137 additions and 7 deletions

View File

@ -6,29 +6,33 @@
#
PORTNAME= lirc
PORTVERSION= 0.9.0p1
PORTREVISION= 7
PORTVERSION= 0.9.0
PORTEPOCH= 1
CATEGORIES= comms
MASTER_SITES= http://lirc.org/software/snapshots/
MASTER_SITES= SF/${PORTNAME}/LIRC/${PORTVERSION}
DISTNAME= ${PORTNAME}-${PORTVERSION:S/p1/-pre1/}
MAINTAINER= nox@FreeBSD.org
COMMENT= Linux Infrared Remote Control
BUILD_DEPENDS= v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
USE_AUTOTOOLS= libtool automake autoheader aclocal autoconf
ACLOCAL_ARGS= -I "${ACLOCAL_DIR}" -I ${LOCALBASE}/share/aclocal
USE_BZIP2= yes
USE_GMAKE= yes
USE_XORG= x11
USE_PYTHON= yes
USE_CSTD= gnu89
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
MAKE_JOBS_SAFE= yes
CONFIGURE_ARGS= --enable-sandboxed --with-devdir=/var/run/lirc
CONFIGURE_ARGS= --enable-sandboxed --with-devdir=/var/run/lirc \
--sysconfdir=${PREFIX}/etc
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
OPTIONS= MINIMAL "Build with minmal dependencies" Off \
DEBUG "Build debug version" Off

View File

@ -1,2 +1,2 @@
SHA256 (lirc-0.9.0-pre1.tar.bz2) = 6724514d76077cc087bd4e12d880744442223e7e4ecfd0aa515c1610bc13b5f1
SIZE (lirc-0.9.0-pre1.tar.bz2) = 837920
SHA256 (lirc-0.9.0.tar.bz2) = 6323afae6ad498d4369675f77ec3dbb680fe661bea586aa296e67f2e2daba4ff
SIZE (lirc-0.9.0.tar.bz2) = 857286

View File

@ -556,3 +556,10 @@ end remote
# also support by default remotes coming with MCE USB receivers
include "%%EXAMPLESDIR%%/remotes/mceusb/lircd.conf.mceusb"
# ..and the devinput driver that can be used with the updated webcamd
# by setting the following in rc.conf(5):
#
# lircd_flags="-H devinput"
# lircd_device="/dev/input/event0"
include "%%EXAMPLESDIR%%/remotes/devinput/lircd.conf.devinput"

View File

@ -0,0 +1,36 @@
--- daemons/dump_config.c.orig
+++ daemons/dump_config.c
@@ -120,11 +120,11 @@ void fprint_remote_head(FILE * f, struct
if (!is_raw(rem)) {
if (rem->pre_data_bits > 0) {
fprintf(f, " pre_data_bits %d\n", rem->pre_data_bits);
- fprintf(f, " pre_data 0x%llX\n", rem->pre_data);
+ fprintf(f, " pre_data 0x%llX\n", (unsigned long long)rem->pre_data);
}
if (rem->post_data_bits > 0) {
fprintf(f, " post_data_bits %d\n", rem->post_data_bits);
- fprintf(f, " post_data 0x%llX\n", rem->post_data);
+ fprintf(f, " post_data 0x%llX\n", (unsigned long long)rem->post_data);
}
if (rem->pre_p != 0 && rem->pre_s != 0) {
fprintf(f, " pre %5u %5u\n", (__u32) rem->pre_p, (__u32) rem->pre_s);
@@ -151,15 +151,15 @@ void fprint_remote_head(FILE * f, struct
if (rem->min_code_repeat > 0) {
fprintf(f, " min_code_repeat %d\n", rem->min_code_repeat);
}
- fprintf(f, " toggle_bit_mask 0x%llX\n", rem->toggle_bit_mask);
+ fprintf(f, " toggle_bit_mask 0x%llX\n", (unsigned long long)rem->toggle_bit_mask);
if (has_toggle_mask(rem)) {
- fprintf(f, " toggle_mask 0x%llX\n", rem->toggle_mask);
+ fprintf(f, " toggle_mask 0x%llX\n", (unsigned long long)rem->toggle_mask);
}
if (rem->rc6_mask != 0) {
- fprintf(f, " rc6_mask 0x%llX\n", rem->rc6_mask);
+ fprintf(f, " rc6_mask 0x%llX\n", (unsigned long long)rem->rc6_mask);
}
if (has_ignore_mask(rem)) {
- fprintf(f, " ignore_mask 0x%llX\n", rem->ignore_mask);
+ fprintf(f, " ignore_mask 0x%llX\n", (unsigned long long)rem->ignore_mask);
}
if (is_serial(rem)) {
fprintf(f, " baud %d\n", rem->baud);

View File

@ -0,0 +1,52 @@
--- daemons/hw_devinput.c.orig
+++ daemons/hw_devinput.c
@@ -376,9 +376,15 @@ int devinput_decode(struct ir_remote *re
return 1;
}
+/* simulate key repeat if receiving the same scancode again */
+#define RPT_SCAN
+
char *devinput_rec(struct ir_remote *remotes)
{
struct input_event event;
+#ifdef RPT_SCAN
+ static struct input_event rptevent, scancodeevent;
+#endif
int rd;
ir_code value;
@@ -399,6 +405,23 @@ char *devinput_rec(struct ir_remote *rem
LOGPRINTF(1, "time %ld.%06ld type %d code %d value %d", event.time.tv_sec, event.time.tv_usec, event.type,
event.code, event.value);
+#ifdef RPT_SCAN
+ repeat_state = RPT_UNKNOWN;
+ if (event.type == EV_KEY)
+ rptevent = event;
+ else if (event.type == EV_MSC && event.code == MSC_SCAN) {
+ if (scancodeevent.type == EV_MSC &&
+ event.value == scancodeevent.value) {
+ if (rptevent.type == EV_KEY && rptevent.value != 0) {
+ event = rptevent;
+ event.value = 2;
+ repeat_state = RPT_YES;
+ }
+ } else if (rptevent.type == EV_KEY && rptevent.value == 0) {
+ scancodeevent = event;
+ }
+ }
+#endif
value = (unsigned)event.value;
#ifdef EV_SW
if (value == 2 && (event.type == EV_KEY || event.type == EV_SW)) {
@@ -418,6 +441,9 @@ char *devinput_rec(struct ir_remote *rem
if (event.value == 2) {
repeat_state = RPT_YES;
} else {
+#ifdef RPT_SCAN
+ if (repeat_state == RPT_UNKNOWN)
+#endif
repeat_state = RPT_NO;
}
} else {

View File

@ -0,0 +1,11 @@
--- daemons/ir_remote.c.orig
+++ daemons/ir_remote.c
@@ -490,7 +490,7 @@ int write_message(char *buffer, size_t s
{
int len;
- len = snprintf(buffer, size, "%016llx %02x %s%s %s\n", code, reps, button_name, button_suffix, remote_name);
+ len = snprintf(buffer, size, "%016llx %02x %s%s %s\n", (unsigned long long)code, reps, button_name, button_suffix, remote_name);
return len;
}

View File

@ -0,0 +1,20 @@
--- daemons/lircd.c.orig
+++ daemons/lircd.c
@@ -1318,7 +1318,7 @@ int send_remote(int fd, char *message, s
codes = remote->codes;
while (codes->name != NULL) {
- len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", codes->code, codes->name);
+ len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", (unsigned long long)codes->code, codes->name);
if (len >= PACKET_SIZE + 1) {
len = sprintf(buffer, "code_too_long\n");
}
@@ -1338,7 +1338,7 @@ int send_name(int fd, char *message, str
(write_socket_len(fd, protocol_string[P_BEGIN]) && write_socket_len(fd, message)
&& write_socket_len(fd, protocol_string[P_SUCCESS]) && write_socket_len(fd, protocol_string[P_DATA])))
return (0);
- len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", code->code, code->name);
+ len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", (unsigned long long)code->code, code->name);
if (len >= PACKET_SIZE + 1) {
len = sprintf(buffer, "1\ncode_too_long\n");
}