diff options
author | nox <nox@FreeBSD.org> | 2011-02-27 06:11:54 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2011-02-27 06:11:54 +0800 |
commit | 3586c5685a1b607aaac200e9425cdfc4d56ebee7 (patch) | |
tree | 83d1a9a6529931cfa328c06daef5b74966efdd19 /comms | |
parent | 0d85eeef51e75fe831f3e88397a3180d212ea13e (diff) | |
download | freebsd-ports-gnome-3586c5685a1b607aaac200e9425cdfc4d56ebee7.tar.gz freebsd-ports-gnome-3586c5685a1b607aaac200e9425cdfc4d56ebee7.tar.zst freebsd-ports-gnome-3586c5685a1b607aaac200e9425cdfc4d56ebee7.zip |
- Update comms/lirc to 0.9.0p1_4 in order to be able to use the lirc
support in webcamd svn (for mceusb-based receivers/transmitters and
USB DVB tuner remotes supported by the Linux code), and enable
support for a few more USB devices while we're at it tho of those
only an FTDI-based one was tested:
http://www.huitsing.nl/irftdi/ [1]
- Fix plist for audio/rhythmbox and multimedia/totem and
add missing LIRC_{CFLAGS,LIBS} variables to CONFIGURE_ENV for
multimedia/xine when building them with (optional) lirc support. [2]
- Chase liblirc_client shlib version bump for ports depdending on it
and bump PORTREVISIONs for ports depending on it by default.
Approved by: portmgr (miwi) [2]
Thanks to: Warren Block <wblock@wonkity.com> for testing [1]
Diffstat (limited to 'comms')
-rw-r--r-- | comms/lirc/Makefile | 40 | ||||
-rw-r--r-- | comms/lirc/distinfo | 5 | ||||
-rw-r--r-- | comms/lirc/files/lircd.sh.in | 2 | ||||
-rw-r--r-- | comms/lirc/files/patch-configure | 27 | ||||
-rw-r--r-- | comms/lirc/files/patch-configure.ac | 116 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::Makefile.in | 12 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::hw-types.c | 20 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::hw_default.c | 97 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::hw_hiddev.c | 163 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::hw_srm7500libusb.c | 26 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::lircd.c | 18 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::lircmd.c | 23 | ||||
-rw-r--r-- | comms/lirc/files/patch-daemons::serial.c | 94 | ||||
-rw-r--r-- | comms/lirc/files/patch-drivers::lirc.h | 25 | ||||
-rw-r--r-- | comms/lirc/files/patch-tools::irsend.c | 12 | ||||
-rw-r--r-- | comms/lirc/files/pkg-message.in | 49 | ||||
-rw-r--r-- | comms/lirc/pkg-message | 8 | ||||
-rw-r--r-- | comms/lirc/pkg-plist | 3 | ||||
-rw-r--r-- | comms/py-lirc/Makefile | 4 |
19 files changed, 480 insertions, 264 deletions
diff --git a/comms/lirc/Makefile b/comms/lirc/Makefile index ff22afa01f4d..2c98b66e8b22 100644 --- a/comms/lirc/Makefile +++ b/comms/lirc/Makefile @@ -6,18 +6,21 @@ # PORTNAME= lirc -PORTVERSION= 0.8.0 -PORTREVISION= 2 +PORTVERSION= 0.9.0p1 +PORTREVISION= 4 CATEGORIES= comms -MASTER_SITES= SF/${PORTNAME}/LIRC/${PORTVERSION} +MASTER_SITES= http://lirc.org/software/snapshots/ +DISTNAME= ${PORTNAME}-${PORTVERSION:S/p1/-pre1/} -MAINTAINER= doconnor@gsoft.com.au -COMMENT= Linux Infared Remote Control +MAINTAINER= nox@FreeBSD.org +COMMENT= Linux Infrared Remote Control -USE_AUTOTOOLS= libtool +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 GNU_CONFIGURE= yes USE_LDCONFIG= yes @@ -26,9 +29,13 @@ CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" -OPTIONS= IRMAN "Build with libirman support" On +OPTIONS= MINIMAL "Build with minmal dependencies" Off \ + DEBUG "Build debug version" Off USE_RC_SUBR= lircd.sh +PORTDOCS= html images irxevent.keys lirc.css lirc.hwdb +PORTEXAMPLES= remotes +SUB_FILES= pkg-message .include <bsd.port.pre.mk> @@ -39,11 +46,16 @@ PLIST_SUB+= SMODE2= PLIST_SUB+= SMODE2="@comment " .endif -.if defined(WITH_IRMAN) +.if defined(WITHOUT_MINIMAL) BUILD_DEPENDS+= ${LOCALBASE}/lib/libirman.a:${PORTSDIR}/comms/libirman -CONFIGURE_ARGS+= --with-driver=irman --with-driver=dvico +LIB_DEPENDS+= ftdi.18:${PORTSDIR}/devel/libftdi +CONFIGURE_ARGS+= --with-driver=userspace .else -CONFIGURE_ARGS+= --with-driver=any --with-driver=dvico +CONFIGURE_ARGS+= --with-driver=dvico +.endif + +.if defined(WITH_DEBUG) +CONFIGURE_ARGS+= --enable-debug .endif MAN1= ircat.1 irexec.1 irpty.1 irrecord.1 irsend.1 irw.1 \ @@ -51,6 +63,14 @@ MAN1= ircat.1 irexec.1 irpty.1 irrecord.1 irsend.1 irw.1 \ MAN8= lircd.8 lircmd.8 post-install: +.if !defined(NOPORTDOCS) + @(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} html ${DOCSDIR}/) + @(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} images ${DOCSDIR}/) + @(cd ${WRKSRC}/doc && ${INSTALL_DATA} irxevent.keys lirc.css lirc.hwdb ${DOCSDIR}/) +.endif +.if !defined(NOPORTEXAMPLES) + @(cd ${WRKSRC} && ${COPYTREE_SHARE} remotes ${EXAMPLESDIR}/) +.endif @${MKDIR} /var/run/lirc @${CAT} ${PKGMESSAGE} diff --git a/comms/lirc/distinfo b/comms/lirc/distinfo index 2f75ef7768d3..e2b8bd5de767 100644 --- a/comms/lirc/distinfo +++ b/comms/lirc/distinfo @@ -1,3 +1,2 @@ -MD5 (lirc-0.8.0.tar.bz2) = 0bf28bf82c7766a462f90927b6bf3af1 -SHA256 (lirc-0.8.0.tar.bz2) = cc8d7fb41a045278680ea530cffaf05181977f41244b9f0ed64075cd7630b5d2 -SIZE (lirc-0.8.0.tar.bz2) = 514359 +SHA256 (lirc-0.9.0-pre1.tar.bz2) = 6724514d76077cc087bd4e12d880744442223e7e4ecfd0aa515c1610bc13b5f1 +SIZE (lirc-0.9.0-pre1.tar.bz2) = 837920 diff --git a/comms/lirc/files/lircd.sh.in b/comms/lirc/files/lircd.sh.in index a1241894bb37..c1ade263601c 100644 --- a/comms/lirc/files/lircd.sh.in +++ b/comms/lirc/files/lircd.sh.in @@ -20,7 +20,7 @@ load_rc_config ${name} : ${lircd_device="/dev/lirc0"} procname=%%PREFIX%%/sbin/lircd -pidfile=/var/run/lircd.pid +pidfile=/var/run/lirc/lircd.pid lircd_config="%%PREFIX%%/etc/lircd.conf" required_files=${lircd_config} command="%%PREFIX%%/sbin/lircd" diff --git a/comms/lirc/files/patch-configure b/comms/lirc/files/patch-configure deleted file mode 100644 index a7eda964bbfb..000000000000 --- a/comms/lirc/files/patch-configure +++ /dev/null @@ -1,27 +0,0 @@ ---- configure.orig Sat Jan 21 18:03:45 2006 -+++ configure Wed Nov 15 12:58:20 2006 -@@ -7816,6 +7816,7 @@ - - # use fifo instead of devnode (required on mac os x) - -+use_fifos="yes" - - if test "$use_fifos" = "yes"; then - USE_FIFOS_TRUE= -@@ -9378,6 +9379,8 @@ - { echo "configure: error: *** you need to have the ALSA libraries and drivers - from at least version 1.0.9 for this driver" 1>&2; exit 1; } - ;; -+ any) -+ ;; - *) - { echo "configure: error: *** it is not possible to install the specified driver - on this system" 1>&2; exit 1; } -@@ -9387,6 +9390,7 @@ - - - if test "$lirc_driver" = "none" || \ -+ test "$lirc_driver" = "any" || \ - test "$lirc_driver" = "alsa_usb" || \ - test "$lirc_driver" = "userspace" || \ - test "$lirc_driver" = "atilibusb" || \ diff --git a/comms/lirc/files/patch-configure.ac b/comms/lirc/files/patch-configure.ac new file mode 100644 index 000000000000..4d846e476026 --- /dev/null +++ b/comms/lirc/files/patch-configure.ac @@ -0,0 +1,116 @@ +--- configure.ac.orig ++++ configure.ac +@@ -97,6 +97,14 @@ case "${host_os}" in + devdir_default="/usr/lirc/dev/" + use_fifos="yes" + ;; ++ freebsd*) ++ dnl PortAudio for UNIX OSS ++ portaudio_lib_other="-lm -lpthread ${forkpty}" ++ ++ dnl default devdir ++ devdir_default="/dev" ++ use_fifos="yes" ++ ;; + *) + dnl Unix OSS configuration + +@@ -318,70 +326,22 @@ AH_TEMPLATE([SYSCONFDIR], + AH_TEMPLATE([USE_SYSLOG], + [define if you want to log to syslog instead of logfile]) + +-if test -n "${LIBUSB_CONFIG}"; then ++AC_CHECK_FUNCS(strchrnul strnlen) ++ ++AC_CHECK_HEADER(libusb.h) ++if test "$ac_cv_header_libusb_h" = yes -o -n "${LIBUSB_CONFIG}"; then + AC_DEFINE(HAVE_LIBUSB) + possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)" + fi + +-AC_CHECK_LIB(caraca_client, caraca_init, +- AC_DEFINE(HAVE_LIBCARACA) +- possible_drivers="${possible_drivers} (caraca)" +-) + AC_CHECK_HEADER(ftdi.h, + AC_DEFINE(HAVE_FTDI) + possible_drivers="${possible_drivers} (ftdi)" + ) +-AC_CHECK_HEADER(iguanaIR.h, +- AC_DEFINE(HAVE_IGUANAIR) +- possible_drivers="${possible_drivers} (iguanaIR)" +-) + AC_CHECK_LIB(irman, ir_strerror, + AC_DEFINE(HAVE_LIBIRMAN) + possible_drivers="${possible_drivers} (irman)" + ) +-AC_CHECK_LIB(irman_sw, ir_strerror, +- AC_DEFINE(HAVE_LIBIRMAN_SW) +- possible_drivers="${possible_drivers} (irman_sw)" +-) +-dnl audio driver requires PortAudio library installed and some linker flags +-AC_CHECK_HEADERS(portaudio.h,[ +- AC_CHECK_LIB(portaudio, Pa_Initialize,[ +- AC_DEFINE(HAVE_LIBPORTAUDIO) +- possible_drivers="${possible_drivers} (audio)" +- ],,${portaudio_lib_other} +- )] +-) +-dnl audio_alsa driver requires ALSA library installed and some linker flags +-have_alsa=no +-AC_CHECK_HEADERS(alsa/asoundlib.h,[ +- AC_CHECK_LIB(asound, snd_pcm_open,[ +- AC_DEFINE(HAVE_LIBALSA) +- have_alsa=yes +- possible_drivers="${possible_drivers} (audio_alsa)" +- ],, +- )] +-) +-dnl alsa_usb driver requires an ALSA that knows about our hwdep device +-if test "$have_alsa" = "yes"; then +- AC_MSG_CHECKING(for ALSA SB RC hwdep support) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +-#include <alsa/asoundlib.h> +-]], [[ +- if (snd_hwdep_info_get_iface(NULL) == SND_HWDEP_IFACE_SB_RC) {} +-]])],[ +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_ALSA_SB_RC) +- possible_drivers="${possible_drivers} (alsa_usb)" +- ],[ +- AC_MSG_RESULT(no) +- ]) +-fi +-dnl creative_infracd driver requires linux scsi api +-AC_CHECK_HEADERS(scsi/sg.h,[ +- AC_DEFINE(HAVE_SCSI) +- possible_drivers="${possible_drivers} (creative_infracd)" +- ] +-) + dnl dev_input driver requires linux input device api + AC_CHECK_HEADERS(linux/input.h,[ + AC_DEFINE(HAVE_LINUX_DEVINPUT) +@@ -411,17 +371,18 @@ AC_CHECK_HEADERS([linux/hiddev.h],[ + #endif + ] + ) ++dnl FreeBSD usbhid.h - patched daemons/hw_hiddev.c needs testing ++AC_CHECK_HEADERS([usbhid.h],[ ++ dnl possible_drivers="${possible_drivers} (asusdh) (bw6130) (dvico) (macmini)" ++ possible_drivers="${possible_drivers} (bw6130) (dvico)" ++ ], [], [] ++) + dnl dsp driver requires linux soundcard api + AC_CHECK_HEADERS(sys/soundcard.h,[ + AC_DEFINE(HAVE_SOUNDCARD) + possible_drivers="${possible_drivers} (dsp)" + ] + ) +-dnl i2cuser driver requires the Linux I2C API +-AC_CHECK_HEADERS(linux/i2c-dev.h,[ +- possible_drivers="${possible_drivers} (i2cuser)" +- ] +-) + + dnl here we see what driver the user wants. + diff --git a/comms/lirc/files/patch-daemons::Makefile.in b/comms/lirc/files/patch-daemons::Makefile.in index fd8d8553d4a7..b44f5bb128b4 100644 --- a/comms/lirc/files/patch-daemons::Makefile.in +++ b/comms/lirc/files/patch-daemons::Makefile.in @@ -1,11 +1,11 @@ ---- daemons/Makefile.in.orig Sat Mar 10 17:14:33 2007 -+++ daemons/Makefile.in Sat Mar 10 17:14:45 2007 -@@ -919,8 +919,6 @@ +--- daemons/Makefile.in.orig ++++ daemons/Makefile.in +@@ -1108,8 +1108,6 @@ uninstall-am: uninstall-binPROGRAMS unin @SANDBOXED_FALSE@@USE_FIFOS_FALSE@uninstall-local: rmdev install-data-local: -- test "$(lircd_conf)" = "" || test -e $(DESTDIR)$(sysconfdir)/lircd.conf || ($(mkinstalldirs) $(DESTDIR)$(sysconfdir) && $(INSTALL_DATA) $(top_srcdir)/remotes/$(lircd_conf) $(DESTDIR)$(sysconfdir)/lircd.conf) -- test "$(lircmd_conf)" = "" || test -e $(DESTDIR)$(sysconfdir)/lircmd.conf || ($(mkinstalldirs) $(DESTDIR)$(sysconfdir) && $(INSTALL_DATA) $(top_srcdir)/remotes/$(lircmd_conf) $(DESTDIR)$(sysconfdir)/lircmd.conf) +- test "$(lircd_conf)" = "" || test -e $(DESTDIR)$(sysconfdir)/$(PACKAGE)/lircd.conf || ($(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lirc && $(INSTALL_DATA) $(top_srcdir)/remotes/$(lircd_conf) $(DESTDIR)$(sysconfdir)/$(PACKAGE)/lircd.conf) +- test "$(lircmd_conf)" = "" || test -e $(DESTDIR)$(sysconfdir)/$(PACKAGE)/lircmd.conf || ($(mkinstalldirs) $(DESTDIR)$(sysconfdir)/lirc && $(INSTALL_DATA) $(top_srcdir)/remotes/$(lircmd_conf) $(DESTDIR)$(sysconfdir)/$(PACKAGE)/lircmd.conf) mkdev: - test -e $(DESTDIR)$(devdir)/lircd || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lircd p) + test -e $(DESTDIR)$(varrundir)/$(PACKAGE)/lircd || ($(mkinstalldirs) $(DESTDIR)$(varrundir)/lirc && @mknod@ $(DESTDIR)$(varrundir)/$(PACKAGE)/lircd p) diff --git a/comms/lirc/files/patch-daemons::hw-types.c b/comms/lirc/files/patch-daemons::hw-types.c new file mode 100644 index 000000000000..3c6d6d009a5d --- /dev/null +++ b/comms/lirc/files/patch-daemons::hw-types.c @@ -0,0 +1,20 @@ +--- daemons/hw-types.c.orig ++++ daemons/hw-types.c +@@ -105,7 +105,7 @@ struct hardware *hw_list[] = { + &hw_awlibusb, + #endif + &hw_bte, +-#ifdef HAVE_LINUX_HIDDEV_H ++#if defined(HAVE_LINUX_HIDDEV_H) || defined(HAVE_USBHID_H) + &hw_bw6130, + #endif + #ifdef HAVE_LIBUSB +@@ -125,7 +125,7 @@ struct hardware *hw_list[] = { + #ifdef HAVE_SOUNDCARD + &hw_dsp, + #endif +-#ifdef HAVE_LINUX_HIDDEV_H ++#if defined(HAVE_LINUX_HIDDEV_H) || defined(HAVE_USBHID_H) + &hw_dvico, + #endif + &hw_ea65, diff --git a/comms/lirc/files/patch-daemons::hw_default.c b/comms/lirc/files/patch-daemons::hw_default.c new file mode 100644 index 000000000000..762307e8858c --- /dev/null +++ b/comms/lirc/files/patch-daemons::hw_default.c @@ -0,0 +1,97 @@ +--- daemons/hw_default.c.orig ++++ daemons/hw_default.c +@@ -38,6 +38,20 @@ + #include "transmit.h" + #include "hw_default.h" + ++/* ++ * Some(?) versions of the Linux mceusb /dev/lirc0 driver return ++ * trailing spaces while at least irrecord expects spaces at the ++ * beginning of a remote button event. So if DELAYEDSPACE is ++ * defined delay a space until the next pulse if it comes right ++ * after a pulse. ++ * ++ * XXX make this a separate hw_mceusb device? ++ */ ++#define DELAYEDSPACE ++#ifdef DELAYEDSPACE ++#include <errno.h> ++#endif ++ + extern struct ir_remote *repeat_remote; + + static __u32 supported_send_modes[] = { +@@ -81,6 +95,39 @@ struct hardware hw_default = { + + static int write_send_buffer(int lirc); + ++#ifdef DELAYEDSPACE ++static int delayedspace = 100000; ++ ++static int availabledata(void) ++{ ++ fd_set fds; ++ int ret; ++ struct timeval tv; ++ ++ FD_ZERO(&fds); ++ FD_SET(hw.fd, &fds); ++ do { ++ do { ++ tv.tv_sec = 0; ++ tv.tv_usec = 0; ++ ret = select(hw.fd + 1, &fds, NULL, NULL, &tv); ++ } ++ while (ret == -1 && errno == EINTR); ++ if (ret == -1) { ++ logprintf(LOG_ERR, "select() failed\n"); ++ logperror(LOG_ERR, NULL); ++ continue; ++ } ++ } ++ while (ret == -1); ++ ++ if (FD_ISSET(hw.fd, &fds)) { ++ return (1); ++ } ++ return (0); ++} ++#endif ++ + /********************************************************************** + * + * decode stuff +@@ -115,6 +162,13 @@ int default_readdata(lirc_t timeout) + dosigterm(SIGTERM); + } + #else ++#ifdef DELAYEDSPACE ++ if (delayedspace) { ++ data = delayedspace; ++ delayedspace = 0; ++ return data; ++ } ++#endif + ret = read(hw.fd, &data, sizeof(data)); + if (ret != sizeof(data)) { + logprintf(LOG_ERR, "error reading from %s (ret %d, expected %d)", +@@ -125,6 +179,19 @@ int default_readdata(lirc_t timeout) + return 0; + } + ++#ifdef DELAYEDSPACE ++ if (hw.rec_mode == LIRC_MODE_MODE2 && (data & PULSE_BIT) && availabledata() /* waitfordata((long)timeout) */) { ++ ret = read(hw.fd, &delayedspace, sizeof(delayedspace)); ++ if (ret != sizeof(delayedspace)) { ++ logprintf(LOG_ERR, "error reading space from %s (ret %d, expected %d)", ++ hw.device, ret, sizeof(delayedspace)); ++ logperror(LOG_ERR, NULL); ++ default_deinit(); ++ ++ return 0; ++ } ++ } ++#endif + if (data == 0) { + static int data_warning = 1; + diff --git a/comms/lirc/files/patch-daemons::hw_hiddev.c b/comms/lirc/files/patch-daemons::hw_hiddev.c index 741f4f55138e..e887bd1d6081 100644 --- a/comms/lirc/files/patch-daemons::hw_hiddev.c +++ b/comms/lirc/files/patch-daemons::hw_hiddev.c @@ -1,29 +1,42 @@ ---- daemons/hw_hiddev.c.orig Sun Jul 10 18:04:11 2005 -+++ daemons/hw_hiddev.c Thu Nov 23 14:41:52 2006 -@@ -19,14 +19,19 @@ +--- daemons/hw_hiddev.c.orig ++++ daemons/hw_hiddev.c +@@ -22,9 +22,17 @@ #include <stdio.h> #include <sys/fcntl.h> + #include <sys/ioctl.h> ++#include <errno.h> -+#ifdef __FreeBSD__ ++#ifdef HAVE_USBHID_H +#include <usbhid.h> -+#else /* assume Linux */ ++#endif ++#ifdef HAVE_LINUX_TYPES_H #include <linux/types.h> ++#endif ++#ifdef HAVE_LINUX_HIDDEV_H #include <linux/hiddev.h> +#endif #include "hardware.h" #include "ir_remote.h" - #include "lircd.h" - #include "receive.h" -- -+#include <errno.h> -+#include <string.h> +@@ -135,6 +143,7 @@ struct hardware hw_sb0540 = { + }; + #endif - static int hiddev_init(); - static int hiddev_deinit(void); -@@ -103,7 +108,11 @@ ++#ifdef HAVE_LINUX_HIDDEV_H + /* Apple Mac mini USB IR Receiver */ + struct hardware hw_macmini = { + "/dev/usb/hiddev0", /* "device" */ +@@ -152,6 +161,7 @@ struct hardware hw_macmini = { + NULL, /* readdata */ + "macmini" /* name */ + }; ++#endif + + #ifdef HAVE_LINUX_HIDDEV_FLAG_UREF + /* Samsung USB IR Receiver */ +@@ -191,7 +201,11 @@ int hiddev_init() logprintf(LOG_INFO, "initializing '%s'", hw.device); - + if ((hw.fd = open(hw.device, O_RDONLY)) < 0) { - logprintf(LOG_ERR, "unable to open '%s'", hw.device); + logprintf(LOG_ERR, @@ -33,10 +46,10 @@ + errno ); return 0; } - -@@ -143,38 +152,117 @@ - } +@@ -235,8 +249,40 @@ int hiddev_decode(struct ir_remote *remo + return 1; + } +/* + * Read a record from the remote control, decode it and return a @@ -69,34 +82,42 @@ + struct hiddev_event + { + unsigned hid; -+ int16_t value; ++ int32_t value; + }; +#endif struct hiddev_event event; + struct hiddev_event asus_events[8]; int rd; - /* Remotec Mediamaster specific */ - static int wheel_count = 0; - static int x_movement = 0; -+ static int repeat_count = 0; - int y_movement=0; - int x_direction=0; - int y_direction=0; - - LOGPRINTF(1, "hiddev_rec"); - +@@ -253,9 +299,41 @@ char *hiddev_rec(struct ir_remote *remot + + last = end; + gettimeofday(&start, NULL); +#ifdef __FreeBSD__ -+ rd = read(hw.fd, inbuf, sizeof inbuf); -+ if (rd != sizeof inbuf) { -+ logprintf(LOG_ERR, -+ "Really read %d bytes from '%s', expected %d", -+ rd, -+ hw.device, -+ sizeof inbuf ); -+ return 0; ++ if (!strcmp(hw.name, "dvico")) { ++ rd = read(hw.fd, inbuf, sizeof inbuf); ++ if (rd != sizeof inbuf) { ++ logprintf(LOG_ERR, ++ "Really read %d bytes from '%s', expected %d", ++ rd, ++ hw.device, ++ sizeof inbuf ); ++ return 0; ++ } ++ event.hid = 0x10046; /* XXX not in FreeBSD */ ++ event.value = * (int16_t *) (&inbuf [1]); ++ } else { ++ rd = read(hw.fd, &event.value, sizeof event.value); ++ if (rd != sizeof event.value) { ++ logprintf(LOG_ERR, ++ "Really read %d bytes from '%s', expected %d", ++ rd, ++ hw.device, ++ sizeof event.value ); ++ return 0; ++ } ++ event.hid = 0x10046; /* XXX not in FreeBSD */ + } -+ event.hid = 0x10046; /* XXX not in FreeBSD */ -+ event.value = * (int16_t *) (&inbuf [1]); -+ rd = sizeof event; /* to make code happy */ ++ rd = sizeof event; /* to make code happy */ +#else rd = read(hw.fd, &event, sizeof event); +#endif @@ -107,54 +128,22 @@ + rd, + hw.device, + sizeof event ); + logperror(LOG_ERR, NULL); + hiddev_deinit(); return 0; - } +@@ -515,6 +593,7 @@ char *sb0540_rec(struct ir_remote *remot + } + #endif - LOGPRINTF(1, "hid 0x%X value 0x%X", event.hid, event.value); ++#ifdef HAVE_LINUX_HIDDEV_H + /* + * Apple Mac mini USB IR Receiver specific code. + * +@@ -566,6 +645,7 @@ char *macmini_rec(struct ir_remote *remo - pre_code = event.hid; -- main_code = event.value; -- -+ main_code = event.value & 0xffff; /* only 16 bits */ - /* - * This stuff is probably dvico specific. - * I don't have any other hid devices to test... - */ -- if (event.hid == 0x10046) { -- repeat_flag = (main_code & dvico_repeat_mask); -+ if (pre_code == 0x10046) { -+ if (main_code & dvico_repeat_mask) /* repeated press */ -+ repeat_count++; /* count them */ -+ else -+ repeat_count = 0; /* reset */ -+ repeat_flag = repeat_count > 2; /* real repeat flag */ - main_code = (main_code & ~dvico_repeat_mask); -- return decode_all(remotes); -+ /* -+ * Skip this if we're working around the premature -+ * repeat. -+ */ -+ if (repeat_flag || (repeat_count == 0)) -+ { -+ char *foo; -+ -+ foo = decode_all(remotes); -+ /* -+ * XXX Experimental code. Chop off the first 12 -+ * bytes of the hex code, which FreeBSD does not -+ * provide, and which I suspect nobody cares -+ * about. -+ * -+ * For some reason, we can get NULL back here, -+ * so we need to check for that before returning -+ * address 0xc. -+ */ -+ if (foo) -+ foo = &foo [12]; /* chop off the leading chars. */ -+ return foo; -+ } -+ else -+ return 0; /* no data */ - } - /* Remotec Mediamaster specific code */ - /* Y-Coordinate, + return decode_all(remotes); + } ++#endif + + /* + * Samsung/Cypress USB IR Receiver specific code diff --git a/comms/lirc/files/patch-daemons::hw_srm7500libusb.c b/comms/lirc/files/patch-daemons::hw_srm7500libusb.c new file mode 100644 index 000000000000..b9fe11431c2f --- /dev/null +++ b/comms/lirc/files/patch-daemons::hw_srm7500libusb.c @@ -0,0 +1,26 @@ +--- daemons/hw_srm7500libusb.c.orig ++++ daemons/hw_srm7500libusb.c +@@ -54,6 +54,23 @@ + #define USB_TIMEOUT (1000*10) + #define CONTROL_BUFFERSIZE 128 + ++#ifndef HAVE_STRNLEN ++size_t ++strnlen(const char *s, size_t maxlen) ++{ ++ size_t ret = strlen(s); ++ return ret > maxlen ? maxlen : ret; ++} ++#endif ++ ++#ifndef HAVE_STRCHRNUL ++char *strchrnul(const char *s, int ch) ++{ ++ char *ret = strchr(s, ch); ++ return ret == NULL ? ((char *)s) + strlen(s) : ret; ++} ++#endif ++ + static int srm7500_init(); + static int srm7500_deinit(); + static char *srm7500_rec(struct ir_remote *remotes); diff --git a/comms/lirc/files/patch-daemons::lircd.c b/comms/lirc/files/patch-daemons::lircd.c deleted file mode 100644 index 14774ba706d5..000000000000 --- a/comms/lirc/files/patch-daemons::lircd.c +++ /dev/null @@ -1,18 +0,0 @@ ---- daemons/lircd.c.orig Sun Jul 10 18:04:12 2005 -+++ daemons/lircd.c Fri Nov 24 14:21:10 2006 -@@ -755,9 +755,12 @@ - strcpy(serv_addr.sun_path,lircdfile); - if(bind(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr))==-1) - { -- fprintf(stderr,"%s: could not assign address to socket\n", -- progname); -- perror(progname); -+ fprintf(stderr, -+ "%s: could not assign address to socket %s: %s (%d)\n", -+ progname, -+ lircdfile, -+ strerror (errno), -+ errno ); - goto start_server_failed1; - } - diff --git a/comms/lirc/files/patch-daemons::lircmd.c b/comms/lirc/files/patch-daemons::lircmd.c new file mode 100644 index 000000000000..c95f14cdca41 --- /dev/null +++ b/comms/lirc/files/patch-daemons::lircmd.c @@ -0,0 +1,23 @@ +--- daemons/lircmd.c.orig ++++ daemons/lircmd.c +@@ -277,9 +277,9 @@ setup_error: + return -1; + } + ++#ifdef __linux__ + void write_uinput(__u16 type, __u16 code, __s32 value) + { +-#ifdef __linux__ + struct input_event event; + + memset(&event, 0, sizeof(event)); +@@ -299,8 +299,8 @@ void write_uinput(__u16 type, __u16 code + syslog(LOG_ERR, "%m"); + } + } +-#endif + } ++#endif + + void msend(int dx, int dy, int dz, int rep, int buttp, int buttr) + { diff --git a/comms/lirc/files/patch-daemons::serial.c b/comms/lirc/files/patch-daemons::serial.c deleted file mode 100644 index 0189cad8685c..000000000000 --- a/comms/lirc/files/patch-daemons::serial.c +++ /dev/null @@ -1,94 +0,0 @@ ---- daemons/serial.c.orig Mon Mar 7 20:03:48 2005 -+++ daemons/serial.c Sun Aug 21 21:44:26 2005 -@@ -29,6 +29,10 @@ - - #include "lircd.h" - -+#define LOCKDIR "/var/spool/lock" -+ -+static char *lockpath = NULL; -+ - int tty_reset(int fd) - { - struct termios options; -@@ -183,7 +187,7 @@ - int lock; - int len; - -- strcpy(filename,"/var/lock/LCK.."); -+ strcpy(filename,LOCKDIR "/LCK.."); - - last=strrchr(name,'/'); - if(last!=NULL) -@@ -373,63 +377,22 @@ - } - } - } -+ lockpath = strdup(filename); - return(1); - } - - int tty_delete_lock(void) - { -- DIR *dp; -- struct dirent *ep; -- int lock; -- int len; -- char id[20+1],*endptr; -- char filename[FILENAME_MAX+1]; -- long pid; -- int retval=1; -- -- dp=opendir("/var/lock/"); -- if(dp!=NULL) -- { -- while((ep=readdir(dp))) -- { -- strcpy(filename,"/var/lock/"); -- if(strlen(filename)+strlen(ep->d_name)>FILENAME_MAX) -- {retval=0;continue;} -- strcat(filename,ep->d_name); -- lock=open(filename,O_RDONLY); -- if(lock==-1) {retval=0;continue;} -- len=read(lock,id,20); -- close(lock); -- if(len<=0) {retval=0;continue;} -- id[len]=0; -- pid=strtol(id,&endptr,10); -- if(!*id || *endptr!='\n') -- { -- logprintf(LOG_WARNING,"invalid lockfile (%s) " -- "detected",filename); -- retval=0; -- continue; -- } -- if(pid==getpid()) -- { -- if(unlink(filename)==-1) -- { -- logprintf(LOG_ERR,"could not delete " -- "file \"%s\"",filename); -- logperror(LOG_ERR,NULL); -- retval=0; -- continue; -- } -- } -- } -- closedir(dp); -- } -- else -+ if(unlink(lockpath)==-1) - { -- logprintf(LOG_ERR,"could not open directory \"/var/lock/\""); -+ logprintf(LOG_ERR,"could not delete " -+ "file \"%s\"",lockpath); -+ logperror(LOG_ERR,NULL); -+ free(lockpath); - return(0); - } -- return(retval); -+ free(lockpath); -+ return(1); - } - - int tty_set(int fd,int rts,int dtr) diff --git a/comms/lirc/files/patch-drivers::lirc.h b/comms/lirc/files/patch-drivers::lirc.h index 54aec8e91eac..b1eaca0284a9 100644 --- a/comms/lirc/files/patch-drivers::lirc.h +++ b/comms/lirc/files/patch-drivers::lirc.h @@ -1,10 +1,21 @@ ---- drivers/lirc.h.orig Sun Aug 21 21:45:04 2005 -+++ drivers/lirc.h Sun Aug 21 21:45:11 2005 -@@ -8,6 +8,7 @@ +--- drivers/lirc.h.orig ++++ drivers/lirc.h +@@ -9,12 +9,17 @@ + #if defined(__linux__) + #include <linux/types.h> #include <linux/ioctl.h> - #else - #include <sys/types.h> -+#include <sys/ioctl.h> - typedef u_int32_t __u32; +-#elif defined(_NetBSD_) ++#elif defined(_NetBSD_) || defined(__FreeBSD__) + #include <sys/ioctl.h> + #elif defined(_CYGWIN_) + #define __USE_LINUX_IOCTL_DEFS + #include <sys/ioctl.h> #endif ++#ifndef __linux__ ++#include <stdint.h> ++#define __u32 uint32_t ++#define __u64 uint64_t ++#endif + #define PULSE_BIT 0x01000000 + #define PULSE_MASK 0x00FFFFFF diff --git a/comms/lirc/files/patch-tools::irsend.c b/comms/lirc/files/patch-tools::irsend.c new file mode 100644 index 000000000000..96b9dee79361 --- /dev/null +++ b/comms/lirc/files/patch-tools::irsend.c @@ -0,0 +1,12 @@ +--- tools/irsend.c.orig ++++ tools/irsend.c +@@ -40,6 +40,9 @@ + #include <errno.h> + #include <signal.h> + #include <limits.h> ++#ifdef __FreeBSD__ ++#include <netinet/in.h> ++#endif + + #define PACKET_SIZE 256 + /* three seconds */ diff --git a/comms/lirc/files/pkg-message.in b/comms/lirc/files/pkg-message.in new file mode 100644 index 000000000000..883c0d72e820 --- /dev/null +++ b/comms/lirc/files/pkg-message.in @@ -0,0 +1,49 @@ +********************************************************************** +This port does not contain any FreeBSD device drivers for infrared +devices. This port installs the LIRC daemons and tools for interacting +with drivers that support the LIRC device interface. + +You will need to obtain third party device drivers or port the Linux +drivers in ${WRKSRC}/drivers to use the LIRC port. + +Update for 0.9: Known working with this update are FTDI-based USB +IR receivers/transmitters like described here, + + http://www.huitsing.nl/irftdi/ + +and if you use (at the time of writing, support probably will be +committed to the version in ports soon) webcamd svn, + + http://www.selasky.org/hans_petter/video4bsd/ + +then MCE USB based ones driven by the Linux mceusb driver as well +remotes coming with USB DVB tuners that by default work with the +Linux drivers used in webcamd should also work, i.e. if webcamd +creates a /dev/lircX device node check if e.g. + + mode2 -d /dev/lirc0 + +reports pulses and spaces when triggering the remote at the receiver, +if it does you probably will be able to use lirc. + +Some other userland drivers will probably also work (like others +using libusb), they just were not tested. + +The lirc documentation should be accessible at: + + %%LOCALBASE%%/share/doc/lirc/html/index.html + +Some example configs should have been installed here: + + %%LOCALBASE%%/share/examples/lirc/remotes + +USB DVB tuner remotes won't be in there though because the webcamd +svn /dev/lircX support for those is kind of a `hack' that works +different from Linux (emulating rc5-like pulses), but as long as +mode2 sees data (meaning the Linux drivers used by webcamd support +the remote), you should be able to create configs by using irrecord +like described here: + + file://%%LOCALBASE%%/share/doc/lirc/html/help.html#new_remote + +********************************************************************** diff --git a/comms/lirc/pkg-message b/comms/lirc/pkg-message deleted file mode 100644 index f99cb6a78901..000000000000 --- a/comms/lirc/pkg-message +++ /dev/null @@ -1,8 +0,0 @@ -********************************************************************** -This port does not contain any FreeBSD device drivers for infrared -devices. This port installs the LIRC daemons and tools for interacting -with drivers that support the LIRC device interface. - -You will need to obtain third party device drivers or port the Linux -drivers in ${WRKSRC}/drivers to use the LIRC port. -********************************************************************** diff --git a/comms/lirc/pkg-plist b/comms/lirc/pkg-plist index b30e77d6d9f5..2671d5941567 100644 --- a/comms/lirc/pkg-plist +++ b/comms/lirc/pkg-plist @@ -8,12 +8,13 @@ bin/irxevent bin/lircrcd bin/mode2 %%SMODE2%%bin/smode2 +bin/pronto2lirc bin/xmode2 include/lirc/lirc_client.h lib/liblirc_client.a lib/liblirc_client.la lib/liblirc_client.so -lib/liblirc_client.so.1 +lib/liblirc_client.so.2 sbin/lircd sbin/lircmd @dirrm include/lirc diff --git a/comms/py-lirc/Makefile b/comms/py-lirc/Makefile index 04282757edbd..a2ad7f696abd 100644 --- a/comms/py-lirc/Makefile +++ b/comms/py-lirc/Makefile @@ -7,7 +7,7 @@ PORTNAME= lirc PORTVERSION= 0.0.5 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= comms python MASTER_SITES= SF/py${PORTNAME}/py${PORTNAME}/${PORTVERSION} PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -16,7 +16,7 @@ DISTNAME= pylirc-${PORTVERSION} MAINTAINER= lewiz@compsoc.man.ac.uk COMMENT= Lirc support library for Python -LIB_DEPENDS= lirc_client.1:${PORTSDIR}/comms/lirc +LIB_DEPENDS= lirc_client.2:${PORTSDIR}/comms/lirc CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib |