summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2010-11-29 01:14:25 +0000
committerAlexey Shvetsov <alexxy@gentoo.org>2010-11-29 01:14:25 +0000
commit13a7679a83da99646463f648b221f2035b0f8e2d (patch)
tree42d0dca933a11f1da4d949e269efef26a68bb262 /app-laptop/tp_smapi
parentversion bump (diff)
downloadgentoo-2-13a7679a83da99646463f648b221f2035b0f8e2d.tar.gz
gentoo-2-13a7679a83da99646463f648b221f2035b0f8e2d.tar.bz2
gentoo-2-13a7679a83da99646463f648b221f2035b0f8e2d.zip
[app-laptop/tp_smapi] Fix bugs #294251 #346493
(Portage version: 2.2.0_alpha6/cvs/Linux x86_64)
Diffstat (limited to 'app-laptop/tp_smapi')
-rw-r--r--app-laptop/tp_smapi/ChangeLog10
-rw-r--r--app-laptop/tp_smapi/files/fix_header_check.patch19
-rw-r--r--app-laptop/tp_smapi/files/tp_smapi-0.40-2.6.37.patch30
-rw-r--r--app-laptop/tp_smapi/tp_smapi-0.40-r1.ebuild64
4 files changed, 121 insertions, 2 deletions
diff --git a/app-laptop/tp_smapi/ChangeLog b/app-laptop/tp_smapi/ChangeLog
index 1dded5932c3f..d7ce9f7a9535 100644
--- a/app-laptop/tp_smapi/ChangeLog
+++ b/app-laptop/tp_smapi/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-laptop/tp_smapi
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/ChangeLog,v 1.34 2009/12/01 18:51:39 fauli Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/ChangeLog,v 1.35 2010/11/29 01:14:25 alexxy Exp $
+
+*tp_smapi-0.40-r1 (29 Nov 2010)
+
+ 29 Nov 2010; Alexey Shvetsov <alexxy@gentoo.org> +tp_smapi-0.40-r1.ebuild,
+ +files/tp_smapi-0.40-2.6.37.patch, +files/fix_header_check.patch:
+ Fix bugs #294251 #346493
01 Dec 2009; Christian Faulhammer <fauli@gentoo.org> tp_smapi-0.40.ebuild:
stable x86, bug 289124
diff --git a/app-laptop/tp_smapi/files/fix_header_check.patch b/app-laptop/tp_smapi/files/fix_header_check.patch
new file mode 100644
index 000000000000..97b656961166
--- /dev/null
+++ b/app-laptop/tp_smapi/files/fix_header_check.patch
@@ -0,0 +1,19 @@
+*** Makefile.orig Mon Nov 23 08:55:42 2009
+--- Makefile Mon Nov 23 08:57:48 2009
+***************
+*** 27,33 ****
+
+ DEBUG := 0
+
+! ifneq ($(shell [ -f $(KBUILD)/include/linux/aio_abi.h ] && echo 1),1)
+ $(warning Building tp_smapi requires Linux kernel 2.6.19 or newer, and matching kernel headers.)
+ $(warning You may need to override the following Make variables:)
+ $(warning . KVER=$(KVER))
+--- 27,33 ----
+
+ DEBUG := 0
+
+! ifneq ($(shell [ -f $(KSRC)/include/linux/aio_abi.h ] && echo 1),1)
+ $(warning Building tp_smapi requires Linux kernel 2.6.19 or newer, and matching kernel headers.)
+ $(warning You may need to override the following Make variables:)
+ $(warning . KVER=$(KVER))
diff --git a/app-laptop/tp_smapi/files/tp_smapi-0.40-2.6.37.patch b/app-laptop/tp_smapi/files/tp_smapi-0.40-2.6.37.patch
new file mode 100644
index 000000000000..60f05997a1d4
--- /dev/null
+++ b/app-laptop/tp_smapi/files/tp_smapi-0.40-2.6.37.patch
@@ -0,0 +1,30 @@
+diff -urN tp_smapi-0.40.orig/thinkpad_ec.c tp_smapi-0.40/thinkpad_ec.c
+--- tp_smapi-0.40.orig/thinkpad_ec.c 2008-12-16 08:03:06.000000000 +0300
++++ tp_smapi-0.40/thinkpad_ec.c 2010-11-22 18:16:54.000000000 +0300
+@@ -88,7 +88,11 @@
+ #define TPC_PREFETCH_JUNK (INITIAL_JIFFIES+1) /* Ignore prefetch */
+
+ /* Locking: */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(thinkpad_ec_mutex);
++#else
++static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
++#endif
+
+ /* Kludge in case the ACPI DSDT reserves the ports we need. */
+ static int force_io; /* Willing to do IO to ports we couldn't reserve? */
+diff -urN tp_smapi-0.40.orig/tp_smapi.c tp_smapi-0.40/tp_smapi.c
+--- tp_smapi-0.40.orig/tp_smapi.c 2008-12-16 08:03:06.000000000 +0300
++++ tp_smapi-0.40/tp_smapi.c 2010-11-22 18:17:29.000000000 +0300
+@@ -109,7 +109,11 @@
+ #define SMAPI_PORT2 0x4F /* fixed port, meaning unclear */
+ static unsigned short smapi_port; /* APM control port, normally 0xB2 */
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
+ static DECLARE_MUTEX(smapi_mutex);
++#else
++static DEFINE_SEMAPHORE(smapi_mutex);
++#endif
+
+ /**
+ * find_smapi_port - read SMAPI port from NVRAM
diff --git a/app-laptop/tp_smapi/tp_smapi-0.40-r1.ebuild b/app-laptop/tp_smapi/tp_smapi-0.40-r1.ebuild
new file mode 100644
index 000000000000..30607ce4604c
--- /dev/null
+++ b/app-laptop/tp_smapi/tp_smapi-0.40-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-laptop/tp_smapi/tp_smapi-0.40-r1.ebuild,v 1.1 2010/11/29 01:14:25 alexxy Exp $
+
+EAPI="3"
+
+inherit eutils linux-mod
+
+DESCRIPTION="IBM ThinkPad SMAPI BIOS driver"
+HOMEPAGE="http://tpctl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/tpctl/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="hdaps"
+
+RESTRICT="userpriv"
+
+# We need dmideode if the kernel does not support DMI_DEV_TYPE_OEM_STRING
+# in dmi.h
+DEPEND="sys-apps/dmidecode"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ if kernel_is lt 2 6 19; then
+ eerror
+ eerror "${P} requires Linux kernel 2.6.19 or above."
+ eerror
+ die "Unsupported kernel version"
+ fi
+
+ MODULE_NAMES="thinkpad_ec(extra:) tp_smapi(extra:)"
+ BUILD_PARAMS="KSRC=${KV_DIR} KBUILD=${KV_OUT_DIR}"
+ BUILD_TARGETS="default"
+
+ if use hdaps; then
+
+ CONFIG_CHECK="~INPUT_UINPUT"
+ WARNING_INPUT_UINPUT="Your kernel needs uinput for the hdaps module to perform better"
+ linux-info_pkg_setup
+
+ MODULE_NAMES="${MODULE_NAMES} hdaps(extra:)"
+ BUILD_PARAMS="${BUILD_PARAMS} HDAPS=1"
+
+ CONFIG_CHECK="!SENSORS_HDAPS"
+ ERROR_SENSORS_HDAPS="${P} with USE=hdaps conflicts with in-kernel HDAPS (CONFIG_SENSORS_HDAPS)"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-2.6.37.patch"
+ epatch "${FILESDIR}"/fix_header_check.patch
+ linux-mod_src_prepare
+}
+
+src_install() {
+ linux-mod_src_install
+ dodoc CHANGES README
+}