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.

78 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2015 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. PKG_NAME:=hidapi
  9. PKG_VERSION:=0.8.0-rc1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/signal11/hidapi.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=hidapi-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MIRROR_HASH:=95b39035f94c35b0c360ec2e02a01fe25e971490135d7137f163974d4a88471f
  17. PKG_LICENSE:=BSD-3-Clause
  18. PKG_LICENSE_FILES:=LICENSE-bsd.txt
  19. PKG_MAINTAINER:=Paul Fertser <fercerpav@gmail.com>
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/nls.mk
  22. define Package/hidapi
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. DEPENDS:=+libusb-1.0 +librt $(ICONV_DEPENDS)
  26. TITLE:=Library to talk to HID devices
  27. URL:=http://www.signal11.us/oss/hidapi/
  28. endef
  29. define Package/hidapi/description
  30. HIDAPI is a multi-platform library which allows an application to interface
  31. with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and Mac
  32. OS X. HIDAPI can be either built as a shared library (.so or .dll) or
  33. can be embedded directly into a target application by adding a single source
  34. file (per platform) and a single header.
  35. endef
  36. define Build/Configure
  37. endef
  38. MAKE_PATH=libusb
  39. MAKE_FLAGS+=-f Makefile.linux
  40. TARGET_CFLAGS+=$(FPIC)
  41. define Build/Compile
  42. $(call Build/Compile/Default, libhidapi-libusb.so)
  43. mv $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so \
  44. $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so.0
  45. ln -s libhidapi-libusb.so.0 $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so
  46. sed 's^@prefix@^/usr^; \
  47. s^@exec_prefix@^/usr^; \
  48. s^@libdir@^$$$${exec_prefix}/lib^; \
  49. s^@includedir@^$$$${prefix}/include^' \
  50. < $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc.in \
  51. > $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc
  52. endef
  53. define Build/InstallDev
  54. $(INSTALL_DIR) $(1)/usr/include/hidapi
  55. $(CP) $(PKG_BUILD_DIR)/hidapi/hidapi.h $(1)/usr/include/hidapi/
  56. $(INSTALL_DIR) $(1)/usr/lib
  57. $(CP) $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so* $(1)/usr/lib/
  58. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  59. $(CP) $(PKG_BUILD_DIR)/pc/hidapi-libusb.pc $(1)/usr/lib/pkgconfig/
  60. endef
  61. define Package/hidapi/install
  62. $(INSTALL_DIR) $(1)/usr/lib
  63. $(CP) $(PKG_BUILD_DIR)/libusb/libhidapi-libusb.so* $(1)/usr/lib/
  64. endef
  65. $(eval $(call BuildPackage,hidapi))