You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=python-evdev
  10. PKG_VERSION:=0.7.0
  11. PKG_RELEASE:=1
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_MAINTAINER:=Paulo Costa <me@paulo.costa.nom.br>, Alexandru Ardelean <ardeleanalex@gmail.com>
  14. PKG_SOURCE:=evdev-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=https://pypi.python.org/packages/67/15/eac376f3e1fc1960a54439c21459b2582e68340001aff83b4ace9e5bd110
  16. PKG_HASH:=57edafc469a414f58b51af1bfb9ee2babb9f626dd2df530d71c1176871850aa1
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-evdev-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. $(call include_mk, python-package.mk)
  20. $(call include_mk, python3-package.mk)
  21. PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
  22. define Package/python-evdev/Default
  23. SUBMENU:=Python
  24. SECTION:=lang
  25. CATEGORY:=Languages
  26. URL:=https://github.com/gvalkov/python-evdev
  27. endef
  28. define Package/python-evdev
  29. $(call Package/python-evdev/Default)
  30. TITLE:=python-evdev
  31. DEPENDS:= \
  32. +PACKAGE_python-evdev:python-light \
  33. +PACKAGE_python-evdev:python-ctypes
  34. VARIANT:=python
  35. endef
  36. define Package/python3-evdev
  37. $(call Package/python-evdev/Default)
  38. TITLE:=python3-evdev
  39. DEPENDS:= \
  40. +PACKAGE_python3-evdev:python3-light \
  41. +PACKAGE_python3-evdev:python3-ctypes
  42. VARIANT:=python3
  43. endef
  44. define Package/python-evdev/description
  45. Bindings to the Linux input handling subsystem
  46. endef
  47. define Package/python3-evdev/description
  48. $(call Package/python-evdev/description)
  49. .
  50. (Variant for Python3)
  51. endef
  52. define PyBuild/Compile
  53. $(call Build/Compile/PyMod,, build \
  54. build_ecodes --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
  55. build_ext \
  56. install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
  57. endef
  58. define Py3Build/Compile
  59. $(call Build/Compile/Py3Mod,, build \
  60. build_ecodes --evdev-headers="$(LINUX_DIR)/include/uapi/linux/input.h:$(LINUX_DIR)/include/uapi/linux/input-event-codes.h" \
  61. build_ext \
  62. install --root="$(PKG_INSTALL_DIR)" --prefix="/usr")
  63. endef
  64. $(eval $(call PyPackage,python-evdev))
  65. $(eval $(call BuildPackage,python-evdev))
  66. $(eval $(call Py3Package,python3-evdev))
  67. $(eval $(call BuildPackage,python3-evdev))