aboutsummaryrefslogtreecommitdiff
blob: 91e00805ff3c62760127bb590f7fb6b380d589e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..11} )
inherit linux-info python-single-r1

DESCRIPTION="Feature-rich configurable Asus NumPad drivers"
HOMEPAGE="https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver"

if [[ ${PV} == "9999" ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver"
else
	COMMIT="a2bada610ebb3fc002fceb53ddf93bc799241867"
	SRC_URI="https://github.com/mohamed-badaoui/asus-touchpad-numpad-driver/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
	S="${WORKDIR}/${PN}-${COMMIT}"
	KEYWORDS="~amd64"
fi

LICENSE="GPL-3"
SLOT="0"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="
	dev-libs/libevdev
	sys-apps/i2c-tools
	$(python_gen_cond_dep '
		dev-python/python-evdev[${PYTHON_USEDEP}]
		dev-python/numpy[${PYTHON_USEDEP}]
		dev-python/python-libevdev[${PYTHON_USEDEP}]
	')
"
RDEPEND="
	${DEPEND}
	${PYTHON_DEPS}
"

src_install() {
	exeinto /usr/libexec/${PN}
	doexe asus_touchpad.py
	insinto /usr/libexec/${PN}
	doins -r numpad_layouts

	python_fix_shebang "${ED}/usr/libexec/${PN}/asus_touchpad.py"

	python_optimize "${ED}/usr/libexec/${PN}"

	dosym ../libexec/${PN}/asus_touchpad.py /usr/bin/asus_touchpad
}