hidapi: new package
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>
Mon, 16 Nov 2015 16:54:12 +0000 (16:54 +0000)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 17 Nov 2015 20:49:43 +0000 (21:49 +0100)
[Thomas:
 - use BR2_INIT_SYSTEMD instead of BR2_PACKAGE_SYSTEMD for the
   libgudev handling. This is consistent with what we do in libmbim,
   modem-manager and network-manager. Only udisks is diverging from
   this by using BR2_PACKAGE_SYSTEMD.
 - Fix the license info: it is GPLv3 *or* BSD-3c *or* the specific
   HIDAPI license. Added LICENSE-orig.txt to LICENSE_FILES.]

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/Config.in
package/hidapi/Config.in [new file with mode: 0644]
package/hidapi/hidapi.hash [new file with mode: 0644]
package/hidapi/hidapi.mk [new file with mode: 0644]

index 0a80afb468206b863b2f79d85f689b8841155fcd..39a5af7fb87c2ba53d01cd78cf701b9501846c8a 100644 (file)
@@ -865,6 +865,7 @@ menu "Hardware handling"
        source "package/ccid/Config.in"
        source "package/dtc/Config.in"
        source "package/gnu-efi/Config.in"
+       source "package/hidapi/Config.in"
        source "package/lcdapi/Config.in"
        source "package/libaio/Config.in"
        source "package/libatasmart/Config.in"
diff --git a/package/hidapi/Config.in b/package/hidapi/Config.in
new file mode 100644 (file)
index 0000000..5d025bf
--- /dev/null
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_HIDAPI
+       bool "hidapi"
+       depends on BR2_PACKAGE_HAS_UDEV
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       # When eudev is used as the udev provider, libgudev is
+       # automatically provided as it is part of eudev. However, when
+       # systemd is used as the udev provider, libgudev is not
+       # provided, and needs to be built separately. This is why we
+       # select the libgudev package only if systemd is used.
+       select BR2_PACKAGE_LIBGUDEV if BR2_INIT_SYSTEMD
+       help
+         HIDAPI is a multi-platform library which allows an application
+         to interface with USB and Bluetooth HID-Class devices on
+         Windows, Linux, and Mac OS X.
+
+         http://www.signal11.us/oss/hidapi/
+
+comment "hidapi needs udev /dev management and a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_PACKAGE_HAS_UDEV
diff --git a/package/hidapi/hidapi.hash b/package/hidapi/hidapi.hash
new file mode 100644 (file)
index 0000000..ba00df2
--- /dev/null
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 33e206f5e145fc1bc6aeb55084d71b55d686533d23ad5bb762746ceba81e728b  hidapi-d17db57b9d4354752e0af42f5f33007a42ef2906.tar.gz
diff --git a/package/hidapi/hidapi.mk b/package/hidapi/hidapi.mk
new file mode 100644 (file)
index 0000000..2457554
--- /dev/null
@@ -0,0 +1,28 @@
+################################################################################
+#
+# hidapi
+#
+################################################################################
+
+# Use master version as the current stable is very old and some bugs
+# have been fixed since then.
+HIDAPI_VERSION = d17db57b9d4354752e0af42f5f33007a42ef2906
+HIDAPI_SITE = $(call github,signal11,hidapi,$(HIDAPI_VERSION))
+HIDAPI_INSTALL_STAGING = YES
+# No configure provided, so we need to autoreconf.
+HIDAPI_AUTORECONF = YES
+HIDAPI_LICENSE = GPLv3 or BSD-3c or HIDAPI license
+HIDAPI_LICENSE_FILES = LICENSE.txt LICENSE-gpl3.txt LICENSE-bsd.txt LICENSE-orig.txt
+
+HIDAPI_DEPENDENCIES = libusb
+
+# When eudev is used as the udev provider, libgudev is automatically
+# provided as it is part of eudev. However, when systemd is used as
+# the udev provider, libgudev is not provided, and needs to be built
+# separately. This is why we depend on the libgudev package only if
+# systemd is used.
+ifeq ($(BR2_INIT_SYSTEMD),y)
+HIDAPI_DEPENDENCIES += libgudev
+endif
+
+$(eval $(autotools-package))