2 # Copyright (C) 2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
11 PKG_VERSION
:=0.8.0-rc1
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
23 PKG_MAINTAINER
:=Paul Fertser
<fercerpav@gmail.com
>
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/nls.mk
31 DEPENDS
:=+libusb-1.0
+librt
$(ICONV_DEPENDS
)
32 TITLE
:=Library to talk to HID devices
33 URL
:=http
://www.signal11.us
/oss
/hidapi
/
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.
44 define Build
/Configure
48 MAKE_FLAGS
+=-f Makefile.linux
49 TARGET_CFLAGS
+=$(FPIC
)
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
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
/
73 define Package
/hidapi
/install
74 $(INSTALL_DIR
) $(1)/usr
/lib
75 $(CP
) $(PKG_BUILD_DIR
)/libusb
/libhidapi-libusb.so
* $(1)/usr
/lib
/
78 $(eval
$(call BuildPackage
,hidapi
))