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