summaryrefslogtreecommitdiff
path: root/lang/python/python-evdev/Makefile
blob: b9d14e887d2b504a3f32909ff29ced942810e22e (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Copyright (C) 2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=python-evdev
PKG_VERSION:=1.1.2
PKG_RELEASE:=1

PKG_LICENSE:=BSD-3-Clause
PKG_MAINTAINER:=Paulo Costa <me@paulo.costa.nom.br>, Alexandru Ardelean <ardeleanalex@gmail.com>

PKG_SOURCE:=evdev-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/e/evdev
PKG_HASH:=2dd67291be20e70643e8ef6f2381efc10e0c6e44a32abb3c1db74996ea3b0351

PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk
include ../python-package.mk
include ../python3-package.mk

PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)

define Package/python-evdev/Default
  SUBMENU:=Python
  SECTION:=lang
  CATEGORY:=Languages
  URL:=https://github.com/gvalkov/python-evdev
endef

define Package/python-evdev
$(call Package/python-evdev/Default)
  TITLE:=python-evdev
  DEPENDS:= \
     +PACKAGE_python-evdev:python-light \
     +PACKAGE_python-evdev:python-ctypes
  VARIANT:=python
endef

define Package/python3-evdev
$(call Package/python-evdev/Default)
  TITLE:=python3-evdev
  DEPENDS:= \
      +PACKAGE_python3-evdev:python3-light \
      +PACKAGE_python3-evdev:python3-ctypes
  VARIANT:=python3
endef


define Package/python-evdev/description
	Bindings to the Linux input handling subsystem
endef

define Package/python3-evdev/description
$(call Package/python-evdev/description)
.
(Variant for Python3)
endef

define PyBuild/Compile
	$(call Build/Compile/PyMod,, build \
		build_ecodes  --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
		build_ext \
		install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
endef

define Py3Build/Compile
	$(call Build/Compile/Py3Mod,, build \
		build_ecodes  --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
		build_ext \
		install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
endef

$(eval $(call PyPackage,python-evdev))
$(eval $(call BuildPackage,python-evdev))
$(eval $(call Py3Package,python3-evdev))
$(eval $(call BuildPackage,python3-evdev))