summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/libg15')
-rw-r--r--dev-libs/libg15/Manifest1
-rw-r--r--dev-libs/libg15/files/g15tools.patch100
-rw-r--r--dev-libs/libg15/libg15-1.2.7-r1.ebuild30
-rw-r--r--dev-libs/libg15/libg15-9999.ebuild52
-rw-r--r--dev-libs/libg15/metadata.xml14
5 files changed, 197 insertions, 0 deletions
diff --git a/dev-libs/libg15/Manifest b/dev-libs/libg15/Manifest
new file mode 100644
index 00000000000..130c17285a2
--- /dev/null
+++ b/dev-libs/libg15/Manifest
@@ -0,0 +1 @@
+DIST libg15-1.2.7.tar.bz2 232475 SHA256 132febe27e66fd9ee1cb7675ef2b0d99b5a404c28923494ff995012b847179d6 SHA512 ddffb38f5c3d9ce0cb90b0375c2f5d317a7bb3889fe59d56932a0889c6e15bc2f1e590757d3182eddf7c5bd3101303b332b18fbd37247c20f66e1be256aa93c0 WHIRLPOOL a3335bafffaefa5fb0af3e6a5f3ad25d66ef012395da5cfca204b5cb6ca7ca5559b4a1f90435eecbf3cf2c3c42304590476a5570288be01d6067cf0b01883405
diff --git a/dev-libs/libg15/files/g15tools.patch b/dev-libs/libg15/files/g15tools.patch
new file mode 100644
index 00000000000..960d3fea29d
--- /dev/null
+++ b/dev-libs/libg15/files/g15tools.patch
@@ -0,0 +1,100 @@
+Patch from upstream bug tracker:
+http://sourceforge.net/tracker/?func=detail&aid=3336448&group_id=167869&atid=844658
+
+As only part of G510 support was merged to upstream. Does NOT apply & compile
+on top of 1.2.7-r1.
+
+diff -aNru trunk/libg15/libg15.c mod/libg15/libg15.c
+--- trunk/libg15/libg15.c 2011-03-31 23:33:44.000000000 +0000
++++ mod/libg15/libg15.c 2011-06-26 07:08:21.000000000 +0000
+@@ -1029,6 +1029,76 @@
+ }
+ }
+
++// Logitech G510 Media Keys implementation. Unknown if this will work for other
++// models. Using the backlight key as a modifier. The assumption is you would
++// normally not be holding down the backlight key while pressing G-keys.
++static void processKeyEvent2Byte(unsigned int *pressed_keys, unsigned char *buffer)
++{
++ // Key modifier
++ *pressed_keys |= G15_KEY_LIGHT;
++
++ // XF86AudioPlay
++ if (*pressed_keys & G15_KEY_G1)
++ *pressed_keys -= G15_KEY_G1;
++
++ // XF86AudioStop
++ if (*pressed_keys & G15_KEY_G2)
++ *pressed_keys -= G15_KEY_G2;
++
++ // XF86AudioPrev
++ if (*pressed_keys & G15_KEY_G3)
++ *pressed_keys -= G15_KEY_G3;
++
++ // XF86AudioNext
++ if (*pressed_keys & G15_KEY_G4)
++ *pressed_keys -= G15_KEY_G4;
++
++ // XF86AudioMute
++ if (*pressed_keys & G15_KEY_G5)
++ *pressed_keys -= G15_KEY_G5;
++
++ // XF86AudioRaiseVolume
++ if (*pressed_keys & G15_KEY_G6)
++ *pressed_keys -= G15_KEY_G6;
++
++ // XF86AudioLowerVolume
++ if (*pressed_keys & G15_KEY_G7)
++ *pressed_keys -= G15_KEY_G7;
++
++ g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x\n", buffer[0], buffer[1]);
++
++ if (buffer[0] == 0x02)
++ {
++ // XF86AudioPlay
++ if (buffer[1] & 0x08)
++ *pressed_keys |= G15_KEY_G1;
++
++ // XF86AudioStop
++ if (buffer[1] & 0x04)
++ *pressed_keys |= G15_KEY_G2;
++
++ // XF86AudioPrev
++ if (buffer[1] & 0x02)
++ *pressed_keys |= G15_KEY_G3;
++
++ // XF86AudioNext
++ if (buffer[1] & 0x01)
++ *pressed_keys |= G15_KEY_G4;
++
++ // XF86AudioMute
++ if (buffer[1] & 0x16)
++ *pressed_keys |= G15_KEY_G5;
++
++ // XF86AudioRaiseVolume
++ if (buffer[1] & 0x32)
++ *pressed_keys |= G15_KEY_G6;
++
++ // XF86AudioLowerVolume
++ if (buffer[1] & 0x64)
++ *pressed_keys |= G15_KEY_G7;
++ }
++}
++
+ int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
+ {
+ unsigned char buffer[G15_KEY_READ_LENGTH];
+@@ -1063,6 +1133,13 @@
+ case 9:
+ processKeyEvent9Byte(pressed_keys, buffer);
+ return G15_NO_ERROR;
++ case 2:
++ if (g15DeviceCapabilities() & G15_DEVICE_G510)
++ {
++ processKeyEvent2Byte(pressed_keys, buffer);
++ return G15_NO_ERROR;
++ }
++ // Deliberate fallthrough
+ default:
+ return handle_usb_errors("Keyboard Read", ret); /* allow the app to deal with errors */
+ }
diff --git a/dev-libs/libg15/libg15-1.2.7-r1.ebuild b/dev-libs/libg15/libg15-1.2.7-r1.ebuild
new file mode 100644
index 00000000000..b190db85345
--- /dev/null
+++ b/dev-libs/libg15/libg15-1.2.7-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="The libg15 library gives low-level access to the Logitech G15 keyboard"
+HOMEPAGE="http://g15tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/g15tools/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE=""
+
+DEPEND="=virtual/libusb-0*"
+RDEPEND=${DEPEND}
+
+DOCS=( AUTHORS README ChangeLog )
+
+src_configure() {
+ econf \
+ --disable-static
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-libs/libg15/libg15-9999.ebuild b/dev-libs/libg15/libg15-9999.ebuild
new file mode 100644
index 00000000000..ac52a432297
--- /dev/null
+++ b/dev-libs/libg15/libg15-9999.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+ESVN_PROJECT=g15tools/trunk
+ESVN_REPO_URI="https://g15tools.svn.sourceforge.net/svnroot/${ESVN_PROJECT}/${PN}"
+
+inherit subversion base eutils autotools
+
+DESCRIPTION="The libg15 library gives low-level access to the Logitech G15 keyboard"
+HOMEPAGE="http://g15tools.sourceforge.net/"
+[[ $PV = *9999* ]] || SRC_URI="mirror://sourceforge/g15tools/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND="=virtual/libusb-0*"
+RDEPEND=${DEPEND}
+
+DOCS=( AUTHORS README ChangeLog )
+
+PATCHES=( "${FILESDIR}"/g15tools.patch )
+
+src_unpack() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_src_unpack
+ fi
+}
+
+src_prepare() {
+ if [[ ${PV} = *9999* ]]; then
+ subversion_wc_info
+ fi
+ base_src_prepare
+ if [[ ${PV} = *9999* ]]; then
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ --disable-static
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/dev-libs/libg15/metadata.xml b/dev-libs/libg15/metadata.xml
new file mode 100644
index 00000000000..968a455eb0a
--- /dev/null
+++ b/dev-libs/libg15/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">g15tools</remote-id>
+ </upstream>
+</pkgmetadata>