Added a pre-release as it contains a lot of fixes, thanks to mcummings for noticing...
authorMatthias Schwarzott <zzam@gentoo.org>
Wed, 3 Jan 2007 18:17:15 +0000 (18:17 +0000)
committerMatthias Schwarzott <zzam@gentoo.org>
Wed, 3 Jan 2007 18:17:15 +0000 (18:17 +0000)
Package-Manager: portage-2.1.2_rc4-r5

app-misc/lirc/ChangeLog
app-misc/lirc/Manifest
app-misc/lirc/files/digest-lirc-0.8.1_pre5 [new file with mode: 0644]
app-misc/lirc/files/lirc-0.8.1-atiusb-xbox.diff [new file with mode: 0644]
app-misc/lirc/files/lirc-0.8.1-imon-pad2keys.patch [new file with mode: 0644]
app-misc/lirc/lirc-0.8.1_pre5.ebuild [new file with mode: 0644]

index ee3de822ebfefbce704351fa38ba33d802493dae..aca2aa6c8f1d3c696eb846ada9d4e052a191cb32 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for app-misc/lirc
-# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.121 2006/12/14 10:31:58 zzam Exp $
+# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.122 2007/01/03 18:17:15 zzam Exp $
+
+*lirc-0.8.1_pre5 (03 Jan 2007)
+
+  03 Jan 2007; Matthias Schwarzott <zzam@gentoo.org>
+  +files/lirc-0.8.1-atiusb-xbox.diff, +files/lirc-0.8.1-imon-pad2keys.patch,
+  +lirc-0.8.1_pre5.ebuild:
+  Added a pre-release as it contains a lot of fixes, thanks to mcummings for
+  noticing. Use newer xbox-patch that can unconditionally be applied.
 
   14 Dec 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.7.2.ebuild,
   lirc-0.8.0-r1.ebuild, lirc-0.8.0-r5.ebuild, lirc-0.8.0-r8.ebuild:
index 9b39bdcf46732426c5dec79fa8af4d6a2f2a3f7b..bf2dde445fd68a3d502cf14a1284623cabddb327 100644 (file)
@@ -49,6 +49,14 @@ AUX lirc-0.8.0pre4-xbox-remote.diff 7615 RMD160 400e3a965cc4164a6cd63c8a05f36df5
 MD5 9dc55ee44bfdff1a3e82c2e04fbb01a4 files/lirc-0.8.0pre4-xbox-remote.diff 7615
 RMD160 400e3a965cc4164a6cd63c8a05f36df558d8eac7 files/lirc-0.8.0pre4-xbox-remote.diff 7615
 SHA256 db84d35610fe2429f9e27bc4bb24dabe1210b63afa48d76bd460d94e405904ca files/lirc-0.8.0pre4-xbox-remote.diff 7615
+AUX lirc-0.8.1-atiusb-xbox.diff 5633 RMD160 f6de358e0ab550c262dd2bf9baf24a6a0a68377c SHA1 2ff583642375db16b80184e94d83f2c9c725fd2d SHA256 963d3dbbea9dee8b407fca859bc5f15aef24f69e5ab3fea6dccfe60d11c4d7f6
+MD5 5d5566c664779e89ee0ec33370911616 files/lirc-0.8.1-atiusb-xbox.diff 5633
+RMD160 f6de358e0ab550c262dd2bf9baf24a6a0a68377c files/lirc-0.8.1-atiusb-xbox.diff 5633
+SHA256 963d3dbbea9dee8b407fca859bc5f15aef24f69e5ab3fea6dccfe60d11c4d7f6 files/lirc-0.8.1-atiusb-xbox.diff 5633
+AUX lirc-0.8.1-imon-pad2keys.patch 8123 RMD160 1dba2af99821ec73b5bc38b9f6733bf3e8aa02d2 SHA1 f2ace7648fb42da07fd60611887317370684b7ed SHA256 d1fd6ba55335f4185f00bec901117fd4cce03ad0541a539cdd78618b060f7cbc
+MD5 393407e55668d762ad0812c1f17a7dfa files/lirc-0.8.1-imon-pad2keys.patch 8123
+RMD160 1dba2af99821ec73b5bc38b9f6733bf3e8aa02d2 files/lirc-0.8.1-imon-pad2keys.patch 8123
+SHA256 d1fd6ba55335f4185f00bec901117fd4cce03ad0541a539cdd78618b060f7cbc files/lirc-0.8.1-imon-pad2keys.patch 8123
 AUX lirc-remotewonderplus.patch 876 RMD160 5fa5bd312f60ec900a38b189134627f2c27449bc SHA1 b13a5c024b0eb6f9b65cb1a795c618832aad39e3 SHA256 12e296b694fa9f3889d191756cd9c3846822ca7e653ee3e26c00bf7bf5a73a88
 MD5 e68a17220295d3c72d78c9e78d9ec9b0 files/lirc-remotewonderplus.patch 876
 RMD160 5fa5bd312f60ec900a38b189134627f2c27449bc files/lirc-remotewonderplus.patch 876
@@ -82,6 +90,7 @@ DIST lirc-0.7.0-xbox.patch.bz2 10512 RMD160 15ef2e36e781342903bdf6a2bee12e9175ed
 DIST lirc-0.7.0.tar.bz2 464270 RMD160 9ad6467766125642ea862c35900898ba824cea03 SHA1 8eecd1cb42e5e995d5df42ab598a3d2a3b7ab1e0 SHA256 236c1593d9da7c0af544dd456e426bd321f1261c08fa5768cb7290267a7b31bc
 DIST lirc-0.7.2.tar.bz2 496627 RMD160 be686c26c1c407e161771a0267c23f81e4d7cbe4 SHA1 e494bc37f77f135549dcaa87ca4fe86ee43c84cf SHA256 d47f87019631fad8e7c774ea60341bcd62aa371e4828edb7a35866fc948fa56f
 DIST lirc-0.8.0.tar.bz2 514359 RMD160 045c95754820e77891bd0b3baa269ad3f04cba8c SHA1 e4016a038eb4fdc7a1a3b3ff599621e2b41d4b7c SHA256 cc8d7fb41a045278680ea530cffaf05181977f41244b9f0ed64075cd7630b5d2
+DIST lirc-0.8.1pre5.tar.bz2 604662 RMD160 8ddfed06374178e15b8fcd16d79887cce70fb35b SHA1 0dd6f62ecafa69c06088fbe48f9238891827a031 SHA256 0ab1e5a6ba72fe0564ea52cf743aff720333f1eb030b165acc346fe00f2c9050
 EBUILD lirc-0.7.0-r1.ebuild 4631 RMD160 98c340740f689ccc403ee1268dc0a6910e44bc54 SHA1 7f2ecbec27009cbdca5d5e6efd557bab3681a415 SHA256 680c97bb28088630f5895704c8e389968a4c7362afb99db69e4167c4b047dbbc
 MD5 40b73820fc026110d4fac87eb1aed53d lirc-0.7.0-r1.ebuild 4631
 RMD160 98c340740f689ccc403ee1268dc0a6910e44bc54 lirc-0.7.0-r1.ebuild 4631
@@ -102,10 +111,14 @@ EBUILD lirc-0.8.0-r8.ebuild 8424 RMD160 fc8d919fe14f3101de86dd2207875f7455a6d761
 MD5 1e114bc536ab7e8851c2a13cea4d515f lirc-0.8.0-r8.ebuild 8424
 RMD160 fc8d919fe14f3101de86dd2207875f7455a6d761 lirc-0.8.0-r8.ebuild 8424
 SHA256 618b3cdcef724366812cf90ec3fa2f424672c8d43bb4d8156effaba0002be596 lirc-0.8.0-r8.ebuild 8424
-MISC ChangeLog 18914 RMD160 189353b0425830c38db8c6f5f3b1857fd2a81068 SHA1 7ac1aa7bfe9ccea20a3086a5c6438ad246f356a0 SHA256 336c958b196196a9bce6e72be19741a0975e9a599b6f62a4d12cc250546a046e
-MD5 de53d1b902daa66f4fae5f79da064e5d ChangeLog 18914
-RMD160 189353b0425830c38db8c6f5f3b1857fd2a81068 ChangeLog 18914
-SHA256 336c958b196196a9bce6e72be19741a0975e9a599b6f62a4d12cc250546a046e ChangeLog 18914
+EBUILD lirc-0.8.1_pre5.ebuild 7785 RMD160 2396a5cdafab0e00561af48194af08a5e451e19e SHA1 0ee020d3a93278abb3f519a2c4b26585ea24675a SHA256 d203ec30e032449b00adf144472e5e5744f1c5296bde0bffd3e9c420f2593f21
+MD5 3a6ecfa850c9abc2295911d61a93e5ae lirc-0.8.1_pre5.ebuild 7785
+RMD160 2396a5cdafab0e00561af48194af08a5e451e19e lirc-0.8.1_pre5.ebuild 7785
+SHA256 d203ec30e032449b00adf144472e5e5744f1c5296bde0bffd3e9c420f2593f21 lirc-0.8.1_pre5.ebuild 7785
+MISC ChangeLog 19251 RMD160 ec4b6ee28f376c06fce1ab0efd883ec866850ee5 SHA1 1263dfd3fe1b6605c9fe1b825405fcfec8ffecd5 SHA256 a318d4c4e9e77805ab9e8bdbed243e320b9c597c701f095c4770ab219c82a9e7
+MD5 25dd8aaf8caf3f4c6d8a574176242618 ChangeLog 19251
+RMD160 ec4b6ee28f376c06fce1ab0efd883ec866850ee5 ChangeLog 19251
+SHA256 a318d4c4e9e77805ab9e8bdbed243e320b9c597c701f095c4770ab219c82a9e7 ChangeLog 19251
 MISC metadata.xml 252 RMD160 e1c170c221f61fa9787a04feac90fab777639d88 SHA1 9fdd5da8466c39d7ff3b40412c4dfa77dd2446b7 SHA256 4e8b5c34b3e50b781a18c9be9e6199442f1b0299e00d66ba35024f8b743b9c32
 MD5 abf8a9c4b96bc3bb50f04a48349dae34 metadata.xml 252
 RMD160 e1c170c221f61fa9787a04feac90fab777639d88 metadata.xml 252
@@ -125,10 +138,13 @@ SHA256 e24d5fc3d5ed85823419cd88ebc5dfa9fd7fc924e746daf282885564aa84e8cc files/di
 MD5 17322bfb3604e1c6663bbc5a6fb80e96 files/digest-lirc-0.8.0-r8 235
 RMD160 efdbebbf9c02e761392c245f3ee1df0938778785 files/digest-lirc-0.8.0-r8 235
 SHA256 e24d5fc3d5ed85823419cd88ebc5dfa9fd7fc924e746daf282885564aa84e8cc files/digest-lirc-0.8.0-r8 235
+MD5 1b53084e97254a64934b2b550a30b727 files/digest-lirc-0.8.1_pre5 247
+RMD160 a46b6dbf251dd92d9d79d25129dcb73cddfbf1a6 files/digest-lirc-0.8.1_pre5 247
+SHA256 20ea8ffab57840aa3c314d3834d48c5547b71d95ceacf4043c926711be6cd938 files/digest-lirc-0.8.1_pre5 247
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
+Version: GnuPG v2.0.1 (GNU/Linux)
 
-iD8DBQFFgSg8t2vP6XvVdOcRAk0IAKDL7Pbs8mkzEAB5Z8PdzXX7nfPIxQCeOnEd
-iHiRt8x3TAAMgvNVN9jyXcA=
-=rWWm
+iD8DBQFFm/M1t2vP6XvVdOcRAs7JAKDfFz7GBlV1u3oQuACWGQl6bkkPlQCgmwci
+BeMXRbFAuGDG+dstH10hkeA=
+=Yt26
 -----END PGP SIGNATURE-----
diff --git a/app-misc/lirc/files/digest-lirc-0.8.1_pre5 b/app-misc/lirc/files/digest-lirc-0.8.1_pre5
new file mode 100644 (file)
index 0000000..cca23c7
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 9a00b010ef4869173c9f8f91257ffe20 lirc-0.8.1pre5.tar.bz2 604662
+RMD160 8ddfed06374178e15b8fcd16d79887cce70fb35b lirc-0.8.1pre5.tar.bz2 604662
+SHA256 0ab1e5a6ba72fe0564ea52cf743aff720333f1eb030b165acc346fe00f2c9050 lirc-0.8.1pre5.tar.bz2 604662
diff --git a/app-misc/lirc/files/lirc-0.8.1-atiusb-xbox.diff b/app-misc/lirc/files/lirc-0.8.1-atiusb-xbox.diff
new file mode 100644 (file)
index 0000000..515c268
--- /dev/null
@@ -0,0 +1,198 @@
+--- ../../lirc-modules.orig/lirc/drivers/lirc_atiusb/lirc_atiusb.c     2006-09-18 16:39:16.000000000 +0300
++++ drivers/lirc_atiusb/lirc_atiusb.c  2006-12-16 20:46:04.000000000 +0200
+@@ -11,6 +11,10 @@
+  *      "USB StreamZap remote driver" (LIRC)
+  *   Artur Lipowski <alipowski@kki.net.pl>'s 2002
+  *      "lirc_dev" and "lirc_gpio" LIRC modules
++ *   Michael Wojciechowski
++ *      initial xbox support
++ *   Vassilis Virvilis <vasvir@iit.demokritos.gr> 2006
++ *      reworked the patch for lirc submission
+  *
+  * $Id: lirc-0.8.1-atiusb-xbox.diff,v 1.1 2007/01/03 18:17:15 zzam Exp $
+  */
+@@ -64,9 +68,9 @@
+ #define DRIVER_DESC           "USB remote driver for LIRC"
+ #define DRIVER_NAME           "lirc_atiusb"
+-#define CODE_LENGTH           5
+-#define CODE_LENGTH_ATI2      3
+-#define CODE_MIN_LENGTH               3
++#define CODE_LENGTH           code_length[ir->remote_type]
++#define CODE_MIN_LENGTH               code_min_length[ir->remote_type]
++#define DECODE_LENGTH         decode_length[ir->remote_type]
+ #define RW2_MODENAV_KEYCODE   0x3F
+ #define RW2_NULL_MODE         0xFF
+@@ -89,6 +93,14 @@
+               if(debug) printk(KERN_DEBUG fmt, ## args);    \
+       }while(0)
++// ATI, ATI2, XBOX
++static const int code_length[] = {5, 3, 6};
++static const int code_min_length[] = {3, 3, 6};
++static const int decode_length[] = {5, 3, 1};
++// USB_BUFF_LEN must be the maximum value of the code_length array.
++// It is used for static arrays.
++#define USB_BUFF_LEN 6
++
+ static int mask = 0xFFFF;     // channel acceptance bit mask
+ static int unique = 0;                // enable channel-specific codes
+ static int repeat = 10;               // repeat time in 1/100 sec
+@@ -120,6 +132,8 @@
+ #define VENDOR_ATI1           0x0bc7
+ #define VENDOR_ATI2           0x0471
++#define VENDOR_MS1            0x040b
++#define VENDOR_MS2            0x045e
+ static struct usb_device_id usb_remote_table [] = {
+       { USB_DEVICE(VENDOR_ATI1, 0x0002) },    /* X10 USB Firecracker Interface */
+@@ -140,6 +154,8 @@
+       { USB_DEVICE(VENDOR_ATI2, 0x0602) },    /* ATI Remote Wonder 2: Input Device */
+       { USB_DEVICE(VENDOR_ATI2, 0x0603) },    /* ATI Remote Wonder 2: Controller (???) */
++      { USB_DEVICE(VENDOR_MS1, 0x6521) }, /* Gamester Xbox DVD Movie Playback Kit IR */
++      { USB_DEVICE(VENDOR_MS2, 0x0284) }, /* Microsoft Xbox DVD Movie Playback Kit IR */
+       { }                                     /* Terminating entry */
+ };
+@@ -168,7 +184,7 @@
+ #endif
+       /* handle repeats */
+-      unsigned char old[CODE_LENGTH];
++      unsigned char old[USB_BUFF_LEN];
+       unsigned long old_jiffies;
+ };
+@@ -206,7 +222,8 @@
+       /* remote type based on usb_device_id tables */
+       enum {
+               ATI1_COMPATIBLE,
+-              ATI2_COMPATIBLE
++              ATI2_COMPATIBLE,
++              XBOX_COMPATIBLE
+       } remote_type;
+       /* rw2 current mode (mirror's remote's state) */
+@@ -369,13 +386,14 @@
+ static void print_data(struct in_endpt *iep, char *buf, int len)
+ {
+-      char codes[CODE_LENGTH*3 + 1];
++      const int clen = code_length[iep->ir->remote_type];
++      char codes[clen * 3 + 1];
+       int i;
+       if (len <= 0)
+               return;
+-      for (i = 0; i < len && i < CODE_LENGTH; i++) {
++      for (i = 0; i < len && i < clen; i++) {
+               snprintf(codes+i*3, 4, "%02x ", buf[i] & 0xFF);
+       }
+       printk(DRIVER_NAME "[%d]: data received %s (ep=0x%x length=%d)\n",
+@@ -506,7 +524,7 @@
+       int mode, i;
+       char *buf = iep->buf;
+-      if (len != CODE_LENGTH_ATI2) {
++      if (len != CODE_LENGTH) {
+               dprintk(DRIVER_NAME
+                       "[%d]: Huh?  Abnormal length (%d) buffer recieved.\n",
+                       ir->devnum, len);
+@@ -598,6 +616,37 @@
+       return SUCCESS;
+ }
++static int code_check_xbox(struct in_endpt *iep, int len)
++{
++      struct irctl *ir = iep->ir;
++      const int clen = CODE_LENGTH;
++
++      if (len != clen)
++      {
++              dprintk(DRIVER_NAME ": We got %d instead of %d bytes from xbox ir.. ?\n", len, clen);
++              return -1;
++      }
++
++      /* check for repeats */
++      if (memcmp(iep->old, iep->buf, len) == 0) 
++      {
++              if (iep->old_jiffies + repeat_jiffies > jiffies) 
++              {
++                      return -1;
++              }
++      } 
++      else 
++      {
++              // the third byte of xbox ir packet seems to contain key info
++              // the last two bytes are.. some kind of clock?
++              iep->buf[0] = iep->buf[2];
++              memset(iep->buf + 1, 0, len - 1);
++              memcpy(iep->old, iep->buf, len);
++      }
++      iep->old_jiffies = jiffies;
++
++      return SUCCESS;
++}
+ #ifdef KERNEL_2_5
+ static void usb_remote_recv(struct urb *urb, struct pt_regs *regs)
+@@ -606,7 +655,7 @@
+ #endif
+ {
+       struct in_endpt *iep;
+-      int len, result;
++      int len, result = -1;
+       if (!urb)
+               return;
+@@ -630,6 +679,9 @@
+       case SUCCESS:
+               switch (iep->ir->remote_type) {
++              case XBOX_COMPATIBLE:
++                      result = code_check_xbox(iep, len);
++                      break;
+               case ATI2_COMPATIBLE:
+                       result = code_check_ati2(iep, len);
+                       break;
+@@ -946,6 +998,10 @@
+       case VENDOR_ATI2:
+               type = ATI2_COMPATIBLE;
+               break;
++      case VENDOR_MS1:
++      case VENDOR_MS2:
++              type = XBOX_COMPATIBLE;
++              break;
+       default:
+               dprintk(DRIVER_NAME "[%d]: unknown type\n", devnum);
+               return NULL;
+@@ -957,6 +1013,8 @@
+       if ( !(ir = kmalloc(sizeof(*ir), GFP_KERNEL)) ) {
+               mem_failure = 1;
+       } else {
++              // at this stage we cannot use the macro [DE]CODE_LENGTH: ir is not yet setup
++              const int dclen = decode_length[type];
+               memset(ir, 0, sizeof(*ir));
+               /* add this infrared remote struct to remote_list, keeping track of
+                * the number of drivers registered. */
+@@ -968,13 +1026,13 @@
+                       mem_failure = 2;
+               } else if (!(rbuf = kmalloc(sizeof(*rbuf), GFP_KERNEL))) {
+                       mem_failure = 3;
+-              } else if (lirc_buffer_init(rbuf, CODE_LENGTH, 1)) {
++              } else if (lirc_buffer_init(rbuf, dclen, 1)) {
+                       mem_failure = 4;
+               } else {
+                       memset(plugin, 0, sizeof(*plugin));
+                       strcpy(plugin->name, DRIVER_NAME " ");
+                       plugin->minor = -1;
+-                      plugin->code_length = CODE_LENGTH*8;
++                      plugin->code_length = dclen * 8;
+                       plugin->features = LIRC_CAN_REC_LIRCCODE;
+                       plugin->data = ir;
+                       plugin->rbuf = rbuf;
+
diff --git a/app-misc/lirc/files/lirc-0.8.1-imon-pad2keys.patch b/app-misc/lirc/files/lirc-0.8.1-imon-pad2keys.patch
new file mode 100644 (file)
index 0000000..f0b0451
--- /dev/null
@@ -0,0 +1,213 @@
+diff -ruN lirc-0.8.1pre5-orig/drivers/lirc_imon/lirc_imon.c lirc-0.8.1pre5/drivers/lirc_imon/lirc_imon.c
+--- lirc-0.8.1pre5-orig/drivers/lirc_imon/lirc_imon.c  2007-01-03 18:54:57.000000000 +0100
++++ lirc-0.8.1pre5/drivers/lirc_imon/lirc_imon.c       2007-01-03 18:55:03.000000000 +0100
+@@ -64,10 +64,27 @@
+ #include "drivers/lirc_dev/lirc_dev.h"
++// imon pad2keys patch
++//
++// make PAD and mouse buttons available for use with VDR,
++// based on pad-mouse-emu patch from venky's forum
++//
++// M.Brakemeier 2006-03-31
++//
++// generated PAD key codes:
++// Mouse_N                  0x690281B7
++// Mouse_S                  0x688291B7
++// Mouse_W                  0x6A8281B7
++// Mouse_E                  0x688A81B7
++//
++// mouse buttons (non-synthetic):
++// MouseRightClick          0x688481B7
++// MouseLeftClick           0x688301B7
++
+ #define MOD_AUTHOR    "Venky Raju <dev@venky.ws>"
+-#define MOD_DESC      "Driver for Soundgraph iMON MultiMedian IR/VFD"
++#define MOD_DESC      "Driver for Soundgraph iMON MultiMedian IR/VFD w/imon pad2keys patch"
+ #define MOD_NAME      "lirc_imon"
+-#define MOD_VERSION   "0.3"
++#define MOD_VERSION   "0.3p2k"
+ #define VFD_MINOR_BASE        144     /* Same as LCD */
+ #define DEVFS_MODE    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
+@@ -82,6 +99,7 @@
+ #define       TRUE            1
+ #define FALSE         0
++#define CURSOR_LIMIT    16
+ /* ------------------------------------------------------------
+  *                     P R O T O T Y P E S
+@@ -160,6 +178,10 @@
+               atomic_t busy;               /* write in progress         */
+               int status;                  /* status of tx completion   */
+       } tx;
++
++    int key_x;
++    int key_y;
++    int last_count;                      /* number of times pressed   */
+ };
+ #define LOCK_CONTEXT  down (&context ->sem)
+@@ -250,6 +272,7 @@
+ MODULE_AUTHOR (MOD_AUTHOR);
+ MODULE_DESCRIPTION (MOD_DESC);
++MODULE_VERSION(MOD_VERSION);    /* MBr: was missing */
+ MODULE_LICENSE ("GPL");
+ module_param (debug, int, 0);
+ MODULE_PARM_DESC (debug, "Debug messages: 0=no, 1=yes (default: no)");
+@@ -574,6 +597,11 @@
+       context ->rx.initial_space = 1;
+       context ->rx.prev_bit = 0;
++        /* init pad context */
++        context ->key_x = 0;
++        context ->key_y = 0;
++        context ->last_count = 0;
++
+       usb_fill_int_urb (context ->rx_urb, context ->dev,
+               usb_rcvintpipe (context ->dev,
+                               context ->rx_endpoint-> bEndpointAddress),
+@@ -704,6 +732,76 @@
+               /* The signals have been decoded onboard the iMON controller */
++              /* encode mouse pad as key events */
++              /* we like pad events, not mouse button events*/
++              if((buf[0] & 0x40) &&
++                   !(buf[1] & 0x01 || buf[1] >> 2 & 0x01))
++                {
++                    int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6;
++                    int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6;
++
++                    if(buf[0] & 0x02)
++                        rel_x |= ~0x10+1;
++                    if(buf[0] & 0x01)
++                        rel_y |= ~0x10+1;
++
++                    /* keyboard direction key emulation */
++                    if( context->last_count > 32 )
++                    {  /* Hopefully eliminate drift*/
++                        context->last_count=0;
++                        context->key_y=0;
++                        context->key_x=0;
++                    }
++                    context->last_count++;
++
++                    /* limit decoded events */
++                    if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT )
++                    {
++                        if(abs(context->key_y ) > abs(context->key_x))
++                        { /* mouse s/n */
++                            if(context->key_y > 0 && rel_y > 0)
++                            { /* mouse s */
++                                buf[0] = 0x68;
++                                buf[1] = 0x82;
++                                buf[2] = 0x91;
++                            }
++                            else if(context->key_y < 0 && rel_y < 0)
++                            { /* mouse n */
++                                buf[0] = 0x69;
++                                buf[1] = 0x02;
++                                buf[2] = 0x81;
++                            }
++                        }
++                        else
++                        { /* mouse e/w*/
++                            if(context->key_x > 0 && rel_x > 0 )
++                            { /* mouse e */
++                                buf[0] = 0x68;
++                                buf[1] = 0x8A;
++                                buf[2] = 0x81;
++                            }
++                            else if(context->key_x < 0 && rel_x < 0  )
++                            { /* mouse w */
++                                buf[0] = 0x6A;
++                                buf[1] = 0x82;
++                                buf[2] = 0x81;
++                            }
++                        }
++                    }
++                    else
++                    {
++                        context->key_x += rel_x;
++                        context->key_y += rel_y;
++
++                        return; /* discard those key codes */
++                    }
++                }
++
++                /* a key was pressed, reset count */
++                context->key_x = 0;
++                context->key_y = 0;
++                context->last_count = 0;
++
+               lirc_buffer_write_1 (context ->plugin ->rbuf, buf);
+               wake_up (&context ->plugin ->rbuf ->wait_poll);
+               return;
+diff -ruN lirc-0.8.1pre5-orig/remotes/imon/lircd.conf.imon-pad lirc-0.8.1pre5/remotes/imon/lircd.conf.imon-pad
+--- lirc-0.8.1pre5-orig/remotes/imon/lircd.conf.imon-pad       2007-01-03 18:54:57.000000000 +0100
++++ lirc-0.8.1pre5/remotes/imon/lircd.conf.imon-pad    2007-01-03 18:55:03.000000000 +0100
+@@ -1,10 +1,10 @@
+ #
+ # this config file was automatically generated
+-# using lirc-0.7.1pre2(imon) on Tue Mar  1 23:15:44 2005
++# using lirc-0.8.0(imon_pad) on Mon Jan 23 20:22:11 2006
+ #
+-# contributed by Venky Raju
++# contributed by M.Brakemeier
+ #
+-# brand:                       iMON-New
++# brand:                       SoundGraph
+ # model no. of remote control: iMON-PAD
+ # devices being controlled by this remote:
+ #
+@@ -22,12 +22,12 @@
+   min_repeat      1
+   toggle_bit      0
+-
+       begin codes
+           AppExit                  0x288195B7
++        Power                    0x289115B7
+           Record                   0x298115B7
+           Play                     0x2A8115B7
+-          SlowMotion               0x29B195B7
++        Open                     0x29B1D5B7
+           Rewind                   0x2A8195B7
+           Pause                    0x2A9115B7
+           FastForward              0x2B8115B7
+@@ -57,15 +57,15 @@
+           0                        0x2BA595B7
+           ShiftTab                 0x28B515B7
+           Tab                      0x29A115B7
+-          MyMovie                  0x2B8515B7
+-          MyMusic                  0x299195B7
+-          MyPhoto                  0x2BA115B7
+-          MyTV                     0x28A515B7
++        Red                      0x2B8515B7 # MyMovie
++        Green                    0x299195B7 # MyMusic
++        Blue                     0x2BA115B7 # MyPhoto
++        Yellow                   0x28A515B7 # MyTV
+           Bookmark                 0x288515B7
+           Thumbnail                0x2AB715B7
+           AspectRatio              0x29A595B7
+           FullScreen               0x2AA395B7
+-          MyDVD                    0x29A295B7
++        Purple                   0x29A295B7 # MyDVD
+           Menu                     0x2BA385B7
+           Caption                  0x298595B7
+           Language                 0x2B8595B7
+@@ -84,6 +84,10 @@
+           Down                     0x6F9ECBB7
+           Right                    0x69A281B7
++        Mouse_N                  0x690281B7
++        Mouse_S                  0x688291B7
++        Mouse_W                  0x6A8281B7
++        Mouse_E                  0x688A81B7
+       end codes
+ end remote 
diff --git a/app-misc/lirc/lirc-0.8.1_pre5.ebuild b/app-misc/lirc/lirc-0.8.1_pre5.ebuild
new file mode 100644 (file)
index 0000000..794fb16
--- /dev/null
@@ -0,0 +1,300 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.8.1_pre5.ebuild,v 1.1 2007/01/03 18:17:15 zzam Exp $
+
+WANT_AUTOMAKE="latest"
+WANT_AUTOCONF="latest"
+
+inherit eutils linux-mod flag-o-matic autotools
+
+DESCRIPTION="LIRC is a package that allows you to decode and send infra-red \
+       signals of many (but not all) commonly used remote controls."
+HOMEPAGE="http://www.lirc.org"
+
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="debug doc X hardware-carrier transmitter"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+SRC_URI="http://lirc.sourceforge.net/software/snapshots/${P/_pre/pre}.tar.bz2"
+
+S=${WORKDIR}/${P/_pre/pre}
+
+
+IUSE_LIRC_DEVICES_DIRECT="
+       all userspace act200l act220l
+       adaptec alsa_usb animax atilibusb
+       atiusb audio audio_alsa avermedia avermedia_vdomate
+       avermedia98 bestbuy bestbuy2 breakoutbox
+       bte bw6130 caraca chronos cmdir com1 com2 com3 com4
+       cph06x creative creative_infracd
+       devinput digimatrix dsp dvico ea65
+       exaudio flyvideo gvbctv5pci hauppauge
+       hauppauge_dvb hercules_smarttv_stereo
+       igorplugusb imon imon_pad imon_rsc
+       irdeo irdeo_remote irman irreal it87
+       knc_one kworld leadtek_0007 leadtek_0010
+       leadtek_pvr2000 livedrive_midi
+       livedrive_seq logitech lpt1 lpt2 mceusb
+       mceusb2 mediafocusI mouseremote
+       mouseremote_ps2 mp3anywhere nslu2
+       packard_bell parallel pcmak pcmak_usb
+       pctv pixelview_bt878 pixelview_pak
+       pixelview_pro provideo realmagic
+       remotemaster sa1100 sasem serial
+       silitek sir slinke streamzap tekram
+       tekram_bt829 tira tvbox udp uirt2
+       uirt2_raw"
+
+IUSE_LIRC_DEVICES_SPECIAL="
+       imon_pad2keys serial_igor_cesko
+       remote_wonder_plus xboxusb usbirboy inputlirc"
+
+IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}"
+
+
+
+RDEPEND="virtual/libc
+       sys-apps/coreutils
+       X? ( || ( (     x11-libs/libX11
+                       x11-libs/libSM
+                       x11-libs/libICE )
+       virtual/x11 ) )
+       lirc_devices_alsa_usb? ( media-libs/alsa-lib )
+       lirc_devices_audio? ( media-libs/portaudio )
+       lirc_devices_irman? ( media-libs/libirman )"
+
+
+#device-driver which use libusb
+LIBUSB_USED_BY_DEV="
+       all atiusb sasem igorplugusb imon imon_pad imon_pad2keys
+       imon_rsc streamzap mceusb mceusb2 xboxusb"
+
+for dev in ${LIBUSB_USED_BY_DEV}; do
+       RDEPEND="${RDEPEND} lirc_devices_${dev}? ( dev-libs/libusb )"
+done
+
+# adding only compile-time depends
+DEPEND="${RDEPEND}
+       virtual/linux-sources"
+
+
+# adding only run-time depends
+RDEPEND="${RDEPEND}
+       lirc_devices_usbirboy? ( app-misc/usbirboy )
+       lirc_devices_inputlirc? ( app-misc/inputlircd )"
+
+
+
+# add all devices to IUSE
+for dev in ${IUSE_LIRC_DEVICES}; do
+       IUSE="${IUSE} lirc_devices_${dev}"
+done
+
+
+add_device() {
+       : $(( lirc_device_count++ ))
+
+       if [[ ${lirc_device_count} -eq 2 ]]; then
+               ewarn
+               ewarn "When selecting multiple devices for lirc to be supported,"
+               ewarn "it can not be garanteed that the drivers play nice together."
+               ewarn
+               ewarn "If this is not intended, then abort emerge now with Ctrl-C,"
+               ewarn "Set LIRC_DEVICES and restart emerge."
+               ewarn
+               epause
+       fi
+
+
+       local dev="${1}"
+       local desc="device ${dev}"
+       if [[ -n "${2}" ]]; then
+               desc="${2}"
+       fi
+
+       einfo "Compiling support for ${desc}"
+       MY_OPTS="${MY_OPTS} --with-driver=${dev}"
+}
+
+pkg_setup() {
+       linux-mod_pkg_setup
+
+       # set default configure options
+       MY_OPTS=""
+       lirc_driver_count=0
+
+       LIRC_DRIVER_DEVICE="/dev/lirc/0"
+
+       local dev
+
+       if use lirc_devices_all; then
+               # compile in drivers for a lot of devices
+               add_device all "a lot of devices"
+       else
+               # compile in only requested drivers
+               for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do
+                       if use lirc_devices_${dev}; then
+                               add_device ${dev}
+                       fi
+               done
+
+               if use lirc_devices_remote_wonder_plus; then
+                       add_device atiusb "device Remote Wonder Plus (atiusb-based)"
+               fi
+
+               if use lirc_devices_serial_igor_cesko; then
+                       add_device serial "serial with Igor Cesko design"
+                       MY_OPTS="${MY_OPTS} --with-igor"
+               fi
+
+               if use lirc_devices_imon_pad2keys; then
+                       add_device imon_pad "device imon_pad (with converting pad input to keyspresses)"
+               fi
+
+               if use lirc_devices_xboxusb; then
+                       add_device atiusb "device xboxusb"
+               fi
+
+               if use lirc_devices_usbirboy; then
+                       add_device userspace "device usbirboy"
+                       LIRC_DRIVER_DEVICE="/dev/usbirboy"
+               fi
+
+               if [[ "${MY_OPTS}" == "" ]]; then
+                       if [[ "${PROFILE_ARCH}" == "xbox" ]]; then
+                               # on xbox: use special driver
+                               add_device atiusb "device xboxusb"
+                       else
+                               # no driver requested
+                               einfo
+                               einfo "Compiling only the lirc-applications, but no drivers."
+                               einfo "Enable drivers with LIRC_DEVICES if you need them."
+                               MY_OPTS="--with-driver=userspace"
+                       fi
+               fi
+       fi
+
+       use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier"
+       use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter"
+
+
+       if [[ -n "${LIRC_OPTS}" ]] ; then
+               ewarn
+               ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on."
+               ewarn
+               ewarn "Please use LIRC_DEVICES from now on."
+               ewarn "e.g. LIRC_DEVICES=\"serial sir\""
+               ewarn
+               ewarn "Flags are now set per use-flags."
+               ewarn "e.g. transmitter, hardware-carrier"
+
+               local opt
+               local unsupported_opts=""
+
+               # test for allowed options for LIRC_OPTS
+               for opt in ${LIRC_OPTS}; do
+                       case ${opt} in
+                               --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*)
+                                       MY_OPTS="${MY_OPTS} ${opt}"
+                                       ;;
+                               *)
+                                       unsupported_opts="${unsupported_opts} ${opt}"
+                                       ;;
+                       esac
+               done
+               if [[ -n ${unsupported_opts} ]]; then
+                       ewarn "These options are no longer allowed to be set"
+                       ewarn "with LIRC_OPTS: ${unsupported_opts}"
+                       die "LIRC_OPTS is no longer recommended."
+               fi
+       fi
+
+
+       # Setup parameter for linux-mod.eclass
+       MODULE_NAMES="lirc(misc:${S})"
+       BUILD_TARGETS="all"
+
+       ECONF_PARAMS="  --localstatedir=/var
+                               --with-syslog=LOG_DAEMON
+                               --enable-sandboxed
+                           --with-kerneldir=${KV_DIR}
+                               --with-moduledir=/lib/modules/${KV_FULL}/misc
+                           $(use_enable debug)
+                                       $(use_with X)
+                                       ${MY_OPTS}"
+
+       einfo
+       einfo "lirc-configure-opts: ${MY_OPTS}"
+       einfo "Setting default lirc-device to ${LIRC_DRIVER_DEVICE}"
+
+       filter-flags -Wl,-O1
+}
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+
+       # Fix a sandbox violation while checking which cc to use for Kernel 2.6.19
+       # and newer
+       epatch ${FILESDIR}/${PN}-0.8.0-sandbox-fix.diff
+
+       # Rip out dos CRLF
+       edos2unix contrib/lirc.rules
+
+       # Apply patches needed for some special device-types
+       epatch ${FILESDIR}/lirc-0.8.1-atiusb-xbox.diff
+       use lirc_devices_imon_pad2keys && epatch ${FILESDIR}/${PN}-0.8.1-imon-pad2keys.patch
+       use lirc_devices_remote_wonder_plus && epatch ${FILESDIR}/lirc-remotewonderplus.patch
+
+       # remove parallel driver on SMP systems
+       if linux_chkconfig_present SMP ; then
+               sed -i -e "s:lirc_parallel::" drivers/Makefile.in
+       fi
+
+       # respect CFLAGS
+       sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.in
+
+       # setting default device-node
+       sed -i -e '/#define LIRC_DRIVER_DEVICE/d' acconfig.h
+       echo "#define LIRC_DRIVER_DEVICE \"${LIRC_DRIVER_DEVICE}\"" >> acconfig.h
+
+       eautoreconf || die "autoreconf failed"
+}
+
+
+src_install() {
+       make DESTDIR=${D} install || die "make install failed"
+
+       newinitd ${FILESDIR}/lircd lircd
+       newinitd ${FILESDIR}/lircmd lircmd
+       newconfd ${FILESDIR}/lircd.conf lircd
+
+       insinto /etc/modules.d/
+       newins ${FILESDIR}/modulesd.lirc lirc
+
+       newinitd ${FILESDIR}/irexec-initd irexec
+       newconfd ${FILESDIR}/irexec-confd irexec
+
+       insinto /etc/udev/rules.d/;
+       newins ${S}/contrib/lirc.rules 10-lirc.rules
+
+       if use doc ; then
+               dohtml doc/html/*.html
+               insinto /usr/share/doc/${PF}/images
+               doins doc/images/*
+       fi
+}
+
+pkg_preinst() {
+       linux-mod_pkg_preinst
+       [[ -f "${ROOT}/etc/lircd.conf" ]] && cp ${ROOT}/etc/lircd.conf ${IMAGE}/etc
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+       echo
+       einfo "The lirc Linux Infrared Remote Control Package has been"
+       einfo "merged, please read the documentation at http://www.lirc.org"
+       echo
+}
+