summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2012-12-15 17:08:49 +0000
committerPacho Ramos <pacho@gentoo.org>2012-12-15 17:08:49 +0000
commitc2449a859af3bf39d850bfbaf84627fb48a0b8f3 (patch)
tree0c3ae314fee895ec066498d0e058a2f60828c1f3 /app-laptop
parentMake USE=systemd a global USE flag. (diff)
downloadgentoo-2-c2449a859af3bf39d850bfbaf84627fb48a0b8f3.tar.gz
gentoo-2-c2449a859af3bf39d850bfbaf84627fb48a0b8f3.tar.bz2
gentoo-2-c2449a859af3bf39d850bfbaf84627fb48a0b8f3.zip
Fix brightness set on t61, #221955 by Jacek
(Portage version: 2.1.11.37/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Diffstat (limited to 'app-laptop')
-rw-r--r--app-laptop/tpb/ChangeLog8
-rw-r--r--app-laptop/tpb/files/tpb-0.6.4-nvram.patch34
-rw-r--r--app-laptop/tpb/tpb-0.6.4-r1.ebuild39
3 files changed, 80 insertions, 1 deletions
diff --git a/app-laptop/tpb/ChangeLog b/app-laptop/tpb/ChangeLog
index 0b56c146848b..2916fb66dca1 100644
--- a/app-laptop/tpb/ChangeLog
+++ b/app-laptop/tpb/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-laptop/tpb
# Copyright 2000-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpb/ChangeLog,v 1.20 2012/11/18 10:53:53 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpb/ChangeLog,v 1.21 2012/12/15 17:08:49 pacho Exp $
+
+*tpb-0.6.4-r1 (15 Dec 2012)
+
+ 15 Dec 2012; Pacho Ramos <pacho@gentoo.org> +files/tpb-0.6.4-nvram.patch,
+ +tpb-0.6.4-r1.ebuild:
+ Fix brightness set on t61, #221955 by Jacek
18 Nov 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml:
Drop mobile herd as talked in gentoo-dev ML
diff --git a/app-laptop/tpb/files/tpb-0.6.4-nvram.patch b/app-laptop/tpb/files/tpb-0.6.4-nvram.patch
new file mode 100644
index 000000000000..1ead9cbe5929
--- /dev/null
+++ b/app-laptop/tpb/files/tpb-0.6.4-nvram.patch
@@ -0,0 +1,34 @@
+diff -Naur tpb-0.6.4-org/src/tpb.c tpb-0.6.4/src/tpb.c
+--- tpb-0.6.4-org/src/tpb.c 2005-07-18 16:15:59.000000000 +0200
++++ tpb-0.6.4/src/tpb.c 2008-05-13 15:15:34.000000000 +0200
+@@ -523,10 +523,10 @@
+ /* determine the state of the brightness buttons {{{ */
+ if(thinkpad_state.brightness_level != last_thinkpad_state.brightness_level) {
+ if(cfg.verbose == STATE_ON) {
+- printf(_("Brightness changed: Level %d\n"), thinkpad_state.brightness_level * 100 / 7);
++ printf(_("Brightness changed: Level %d\n"), thinkpad_state.brightness_level * 100 / 15);
+ }
+ if(cfg.callback != NULL) {
+- snprintf(callback_cmd, sizeof(callback_cmd), "%s brightness %d", cfg.callback, thinkpad_state.brightness_level * 100 / 7);
++ snprintf(callback_cmd, sizeof(callback_cmd), "%s brightness %d", cfg.callback, thinkpad_state.brightness_level * 100 / 15);
+ if(fork_app(callback_cmd) != 0) {
+ _exit(0);
+ }
+@@ -537,7 +537,7 @@
+ if(osd_ptr != NULL &&
+ ((cfg.osd == STATE_OFF && cfg.osdbrightness == STATE_ON) || (cfg.osd == STATE_ON && cfg.osdbrightness != STATE_OFF))) {
+ xosd_display(osd_ptr, 0, XOSD_string, _("Brightness"));
+- xosd_display(osd_ptr, 1, XOSD_percentage, thinkpad_state.brightness_level * 100 / 7);
++ xosd_display(osd_ptr, 1, XOSD_percentage, thinkpad_state.brightness_level * 100 / 15);
+ }
+ }
+ #endif /* HAVE_LIBXOSD */ /* }}} */
+@@ -1031,7 +1031,7 @@
+ thinkpad_state->hibernate_toggle = (thinkpad_state->hibernate_toggle & ~0x01) | (( buffer[0x58] & 0x01) );
+ thinkpad_state->display_state = (( buffer[0x59] & 0x03) );
+ thinkpad_state->expand_toggle = (thinkpad_state->expand_toggle & ~0x01) | (( buffer[0x59] & 0x10) >> 4);
+- thinkpad_state->brightness_level = (( buffer[0x5E] & 0x07) );
++ thinkpad_state->brightness_level = (( buffer[0x5E] & 0x0F) );
+ thinkpad_state->brightness_toggle = (thinkpad_state->brightness_toggle & ~0x01) | (( buffer[0x5E] & 0x20) >> 5);
+ thinkpad_state->volume_level = (( buffer[0x60] & 0x0f) );
+ thinkpad_state->volume_toggle = (thinkpad_state->volume_toggle & ~0x01) | (( buffer[0x60] & 0x80) >> 7);
diff --git a/app-laptop/tpb/tpb-0.6.4-r1.ebuild b/app-laptop/tpb/tpb-0.6.4-r1.ebuild
new file mode 100644
index 000000000000..970623a95a59
--- /dev/null
+++ b/app-laptop/tpb/tpb-0.6.4-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tpb/tpb-0.6.4-r1.ebuild,v 1.1 2012/12/15 17:08:48 pacho Exp $
+
+EAPI=5
+inherit linux-info eutils
+
+DESCRIPTION="IBM ThinkPad buttons utility"
+HOMEPAGE="http://savannah.nongnu.org/projects/tpb/"
+SRC_URI="http://savannah.nongnu.org/download/tpb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 -ppc ~x86"
+IUSE="nls xosd"
+
+RDEPEND="x11-libs/libXt
+ x11-libs/libXext
+ xosd? ( >=x11-libs/xosd-2.2.0 )"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~NVRAM"
+ERROR_NVRAM="${P} requires /dev/nvram support (CONFIG_NVRAM)"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-configure-fix.diff
+ epatch "${FILESDIR}"/${P}-nvram.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable xosd)
+}
+
+src_install() {
+ default
+ dodoc doc/{callback_example.sh,nvram.txt,tpbrc}
+}