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.

67 lines
2.1 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.10.1
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/libusb/hidapi/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
  13. PKG_HASH:=f71dd8a1f46979c17ee521bc2117573872bbf040f8a4750e492271fc141f2644
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Paul Fertser <fercerpav@gmail.com>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_LICENSE_FILES:=LICENSE-bsd.txt
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/nls.mk
  23. define Package/hidapi
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. DEPENDS:=+libusb-1.0 +librt +libudev $(ICONV_DEPENDS)
  27. TITLE:=Library to talk to HID devices
  28. URL:=https://github.com/libusb/hidapi
  29. endef
  30. define Package/hidapi/description
  31. HIDAPI is a multi-platform library which allows an application to interface
  32. with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and Mac
  33. OS X. HIDAPI can be either built as a shared library (.so or .dll) or
  34. can be embedded directly into a target application by adding a single source
  35. file (per platform) and a single header.
  36. endef
  37. CONFIGURE_ARGS += \
  38. --disable-static
  39. TARGET_LDFLAGS += -liconv
  40. define Build/InstallDev
  41. $(INSTALL_DIR) $(1)/usr/include/hidapi
  42. $(CP) $(PKG_INSTALL_DIR)/usr/include/hidapi/hidapi.h $(1)/usr/include/hidapi/
  43. $(INSTALL_DIR) $(1)/usr/lib
  44. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhidapi-hidraw.so* $(1)/usr/lib/
  45. $(CP) $(PKG_INSTALL_DIR)/usr/lib//libhidapi-libusb.so* $(1)/usr/lib/
  46. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  47. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hidapi-libusb.pc $(1)/usr/lib/pkgconfig/
  48. endef
  49. define Package/hidapi/install
  50. $(INSTALL_DIR) $(1)/usr/lib
  51. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhidapi-hidraw.so.* $(1)/usr/lib/
  52. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhidapi-libusb.so.* $(1)/usr/lib/
  53. endef
  54. $(eval $(call BuildPackage,hidapi))