blob: cbba67bedf75d7254daaf2ce4da0926ca944cd68 [file] [log] [blame]
Nick Sandersb9d582a2011-02-08 16:39:31 -08001# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5EAPI="2"
6inherit eutils cros-binary
7
8# Synaptics touchpad generic eclass.
9IUSE="is_touchpad ps_touchpad"
10
Puneet Kumar4fc15c52011-02-25 18:59:10 -080011RDEPEND="x11-base/xorg-server"
Nick Sandersb9d582a2011-02-08 16:39:31 -080012DEPEND="${RDEPEND}"
13
14CROS_BINARY_INSTALL_FLAGS="--strip-components=1"
15
Dave Parker4a6dd3e2011-04-04 18:28:16 -070016# @ECLASS-VARIABLE: SYNAPTICS_TOUCHPAD_PN
17# @DESCRIPTION: The packagename used as part of the binary tarball filename.
18: ${SYNAPTICS_TOUCHPAD_PN:=${PN}}
19
Nick Sandersb9d582a2011-02-08 16:39:31 -080020export_uri() {
21 local XORG_VERSION_STRING
22 local XORG_VERSION
23 local X_VERSION
24
25 XORG_VERSION_STRING=$(grep "XORG_VERSION_CURRENT" "$ROOT/usr/include/xorg/xorg-server.h")
26 XORG_VERSION_STRING=${XORG_VERSION_STRING/#\#define*XORG_VERSION_CURRENT}
27 XORG_VERSION=$(($XORG_VERSION_STRING))
28 if [ $XORG_VERSION -ge 10903000 ]; then
29 X_VERSION=1.9
30 else
31 X_VERSION=1.7
32 fi
Dave Parker4a6dd3e2011-04-04 18:28:16 -070033 CROS_BINARY_URI="ssh://synaptics-private@git.chromium.org:6222/home/synaptics-private/${CATEGORY}/${SYNAPTICS_TOUCHPAD_PN}/${SYNAPTICS_TOUCHPAD_PN}-xorg-${X_VERSION}-${PV}-${PR}.tar.gz"
Nick Sandersb9d582a2011-02-08 16:39:31 -080034}
35
36function synaptics-touchpad_src_unpack() {
37 export_uri
38 cros-binary_src_unpack
39}
40
41function synaptics-touchpad_src_install() {
42 # Currently you must have files/* in each ebuild that inherits
43 # from here. These files will go away soon after they are pushed
44 # into the synaptics tarball.
45 export_uri
46 cros-binary_src_install
Nick Sandersb9d582a2011-02-08 16:39:31 -080047
Puneet Kumarb2c43cc2011-02-23 19:32:38 -080048 install --mode=0755 "${FILESDIR}/tpcontrol_syncontrol" "${D}/opt/Synaptics/bin"
Nick Sandersb9d582a2011-02-08 16:39:31 -080049
50 # link the appropriate config files for the type of trackpad
51 if use is_touchpad && use ps_touchpad; then
52 die "Specify only one type of touchpad"
53 elif use is_touchpad; then
54 dosym HKLM_Kernel_IS /opt/Synaptics/HKLM_Kernel || die
55 dosym HKLM_User_IS /opt/Synaptics/HKLM_User || die
56 elif use ps_touchpad; then
57 dosym HKLM_Kernel_PS /opt/Synaptics/HKLM_Kernel || die
58 dosym HKLM_User_PS /opt/Synaptics/HKLM_User || die
59 else
60 die "Type of touchpad not specified"
61 fi
62
63}
64