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