mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
committed by
GitHub
parent
c2a79ccf25
commit
fdb8810a33
@@ -1,23 +1,23 @@
|
||||
SUMMARY="Library for Interfacing with HID-Class devices"
|
||||
DESCRIPTION="HIDAPI is a multi-platform library which allows an application to \
|
||||
interface with USB and Bluetooth HID-Class devices on Windows, Linux, and \
|
||||
macOS. While it can be used to communicate with standard HID devices like \
|
||||
keyboards, mice, and Joysticks, it is most useful when used with custom \
|
||||
(Vendor-Defined) HID devices. Many devices do this in order to not require a \
|
||||
custom driver to be written for each platform. HIDAPI is easy to integrate with \
|
||||
the client application, just requiring a single source file to be dropped into \
|
||||
the application. (On Haiku, it only works with USB)."
|
||||
DESCRIPTION="HIDAPI is a multi-platform library which allows an \
|
||||
application to interface with USB and Bluetooth HID-Class devices \
|
||||
on Windows, Linux, FreeBSD, and macOS. HIDAPI can be either built \
|
||||
as a shared library (.so, .dll or .dylib) or can be embedded directly \
|
||||
into a target application by adding a single source file (per platform) \
|
||||
and a single header.
|
||||
|
||||
The HIDAPI library was originally developed by Alan Ott (signal11)."
|
||||
HOMEPAGE="http://www.signal11.us/oss/hidapi/"
|
||||
COPYRIGHT="2010 Alan Ott
|
||||
2011 Signal 11 Software"
|
||||
LICENSE="BSD (3-clause)
|
||||
GNU GPL v3"
|
||||
REVISION="2"
|
||||
srcGitRev="a6a622ffb680c55da0de787ff93b80280498330f"
|
||||
REVISION="1"
|
||||
srcGitRev="24a822c80f95ae1b46a7a3c16008858dc4d8aec8"
|
||||
SOURCE_URI="https://github.com/signal11/hidapi/archive/$srcGitRev.tar.gz"
|
||||
CHECKSUM_SHA256="66f6a023f6ae19405be5010616646e12246c03b200aae72e2c053a224503e481"
|
||||
CHECKSUM_SHA256="d7daee08f3a26da3b552e421c298296f64e036bf52a884494c0d6d5a0e5af288"
|
||||
SOURCE_FILENAME="hidapi-$portVersion-$srcGitRev.tar.gz"
|
||||
SOURCE_DIR="hidapi-$srcGitRev"
|
||||
PATCHES="hidapi-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
@@ -58,7 +58,6 @@ BUILD_PREREQUIRES="
|
||||
|
||||
BUILD()
|
||||
{
|
||||
|
||||
./bootstrap
|
||||
|
||||
runConfigure ./configure \
|
||||
@@ -80,11 +79,3 @@ INSTALL()
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make hidtest
|
||||
|
||||
cd hidtest/.libs
|
||||
LIBRARY_PATH=$sourceDir/libusb/.libs:$LIBRARY_PATH ./hidtest || true
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
From 0e6ebfe2cee9ea675ebc175fb95830cc1ecf5ef8 Mon Sep 17 00:00:00 2001
|
||||
From: CodeforEvolution <themysterymail555@gmail.com>
|
||||
Date: Mon, 26 Dec 2016 16:59:41 +0000
|
||||
Subject: Changes to Build System for Haiku
|
||||
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 196c991..48e522d 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -31,6 +31,10 @@ if OS_KFREEBSD
|
||||
SUBDIRS += libusb
|
||||
endif
|
||||
|
||||
+if OS_HAIKU
|
||||
+SUBDIRS += libusb
|
||||
+endif
|
||||
+
|
||||
if OS_WINDOWS
|
||||
SUBDIRS += windows
|
||||
endif
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c6747f9..dd5249a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -107,6 +107,18 @@ case $host in
|
||||
AC_CHECK_LIB([usb], [libusb_init], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -lusb"], [hidapi_lib_error libusb])
|
||||
echo libs_priv: $LIBS_LIBUSB_PRIVATE
|
||||
;;
|
||||
+*-*-haiku)
|
||||
+ AC_MSG_RESULT([ (Haiku back-end)])
|
||||
+ AC_DEFINE(OS_HAIKU, 1, [Haiku implementation])
|
||||
+ AC_SUBST(OS_HAIKU)
|
||||
+ backend="libusb"
|
||||
+ os="haiku"
|
||||
+ threads="pthreads"
|
||||
+
|
||||
+ PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
|
||||
+ LIBS_LIBUSB_PRIVATE+=" $libusb_LIBS"
|
||||
+ CFLAGS_LIBUSB+=" $libusb_CFLAGS"
|
||||
+ ;;
|
||||
*-mingw*)
|
||||
AC_MSG_RESULT([ (Windows back-end, using MinGW)])
|
||||
backend="windows"
|
||||
@@ -213,6 +225,7 @@ AM_CONDITIONAL(OS_LINUX, test "x$os" = xlinux)
|
||||
AM_CONDITIONAL(OS_DARWIN, test "x$os" = xdarwin)
|
||||
AM_CONDITIONAL(OS_FREEBSD, test "x$os" = xfreebsd)
|
||||
AM_CONDITIONAL(OS_KFREEBSD, test "x$os" = xkfreebsd)
|
||||
+AM_CONDITIONAL(OS_HAIKU, test "x$os" = xhaiku)
|
||||
AM_CONDITIONAL(OS_WINDOWS, test "x$os" = xwindows)
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
diff --git a/libusb/Makefile-manual b/libusb/Makefile-manual
|
||||
index c0fe868..0acf707 100644
|
||||
--- a/libusb/Makefile-manual
|
||||
+++ b/libusb/Makefile-manual
|
||||
@@ -10,6 +10,10 @@ ifeq ($(OS), FreeBSD)
|
||||
FILE=Makefile.freebsd
|
||||
endif
|
||||
|
||||
+ifeq ($(OS), Haiku)
|
||||
+ FILE=Makefile.haiku
|
||||
+endif
|
||||
+
|
||||
ifeq ($(FILE), )
|
||||
all:
|
||||
$(error Your platform ${OS} is not supported by hidapi/libusb at this time.)
|
||||
diff --git a/libusb/Makefile.am b/libusb/Makefile.am
|
||||
index 13c9d35..1da06bc 100644
|
||||
--- a/libusb/Makefile.am
|
||||
+++ b/libusb/Makefile.am
|
||||
@@ -21,6 +21,13 @@ libhidapi_la_LDFLAGS = $(LTLDFLAGS)
|
||||
libhidapi_la_LIBADD = $(LIBS_LIBUSB)
|
||||
endif
|
||||
|
||||
+if OS_HAIKU
|
||||
+lib_LTLIBRARIES = libhidapi.la
|
||||
+libhidapi_la_SOURCES = hid.c
|
||||
+libhidapi_la_LDFLAGS = $(LTLDFLAGS)
|
||||
+libhidapi_la_LIBADD = $(LIBS_LIBUSB)
|
||||
+endif
|
||||
+
|
||||
hdrdir = $(includedir)/hidapi
|
||||
hdr_HEADERS = $(top_srcdir)/hidapi/hidapi.h
|
||||
|
||||
diff --git a/libusb/Makefile.haiku b/libusb/Makefile.haiku
|
||||
new file mode 100644
|
||||
index 0000000..6ddd172
|
||||
--- /dev/null
|
||||
+++ b/libusb/Makefile.haiku
|
||||
@@ -0,0 +1,46 @@
|
||||
+###########################################
|
||||
+# Simple Makefile for HIDAPI test program
|
||||
+#
|
||||
+# Alan Ott
|
||||
+# Signal 11 Software
|
||||
+# 2010-06-01
|
||||
+###########################################
|
||||
+
|
||||
+all: hidtest libs
|
||||
+
|
||||
+libs: libhidapi.so
|
||||
+
|
||||
+CC ?= cc
|
||||
+CFLAGS ?= -Wall -g -fPIC
|
||||
+
|
||||
+CXX ?= c++
|
||||
+CXXFLAGS ?= -Wall -g
|
||||
+
|
||||
+COBJS = hid.o
|
||||
+CPPOBJS = ../hidtest/hidtest.o
|
||||
+OBJS = $(COBJS) $(CPPOBJS)
|
||||
+INCLUDES = -I../hidapi -I$(shell finddir B_SYSTEM_HEADERS_DIRECTORY)
|
||||
+LDFLAGS = -L$(shell finddir B_SYSTEM_LIB_DIRECTORY)
|
||||
+LIBS = -lusb-1.0
|
||||
+
|
||||
+
|
||||
+# Console Test Program
|
||||
+hidtest: $(OBJS)
|
||||
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
|
||||
+
|
||||
+# Shared Libs
|
||||
+libhidapi.so: $(COBJS)
|
||||
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,$@.0 $^ -o $@ $(LIBS)
|
||||
+
|
||||
+# Objects
|
||||
+$(COBJS): %.o: %.c
|
||||
+ $(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
|
||||
+
|
||||
+$(CPPOBJS): %.o: %.cpp
|
||||
+ $(CXX) $(CXXFLAGS) -c $(INCLUDES) $< -o $@
|
||||
+
|
||||
+
|
||||
+clean:
|
||||
+ rm -f $(OBJS) hidtest libhidapi.so ../hidtest/hidtest.o
|
||||
+
|
||||
+.PHONY: clean libs
|
||||
--
|
||||
2.2.2
|
||||
Reference in New Issue
Block a user