Skip to content

Commit d5dbde6

Browse files
facchinmumbynos
authored andcommitted
update hidapi
1 parent dfa460c commit d5dbde6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6634
-4051
lines changed

deps/hidapi/.appveyor.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
os: Visual Studio 2015
2+
3+
environment:
4+
matrix:
5+
- BUILD_ENV: msbuild
6+
arch: x64
7+
- BUILD_ENV: msbuild
8+
arch: Win32
9+
- BUILD_ENV: cygwin
10+
11+
install:
12+
- cmd: if %BUILD_ENV%==cygwin (
13+
C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake )
14+
15+
build_script:
16+
- cmd: if %BUILD_ENV%==msbuild (
17+
msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" )
18+
- cmd: if %BUILD_ENV%==cygwin (
19+
C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make" )
20+
21+
artifacts:
22+
# Win32 artifacts
23+
- path: .\windows\Release\hidapi.dll
24+
- path: .\windows\Release\hidapi.lib
25+
- path: .\windows\Release\hidapi.pdb
26+
- path: .\windows\Release\hidtest.exe
27+
- path: .\windows\Release\hidtest.pdb
28+
# x64 artifacts
29+
- path: .\windows\x64\Release\hidapi.dll
30+
- path: .\windows\x64\Release\hidapi.lib
31+
- path: .\windows\x64\Release\hidapi.pdb
32+
- path: .\windows\x64\Release\hidtest.exe
33+
- path: .\windows\x64\Release\hidtest.pdb

deps/hidapi/.builds/alpine.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
image: alpine/edge
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- eudev-dev
7+
- libusb-dev
8+
- linux-headers
9+
sources:
10+
- https://github.com/libusb/hidapi
11+
tasks:
12+
- setup: |
13+
cd hidapi
14+
./bootstrap
15+
./configure
16+
- build: |
17+
cd hidapi
18+
make
19+
make DESTDIR=$PWD/root install
20+
make clean
21+
- build-manual: |
22+
cd hidapi/linux
23+
make -f Makefile-manual
24+
cd ../libusb
25+
make -f Makefile-manual

deps/hidapi/.builds/archlinux.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
image: archlinux
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- libusb
7+
- libudev0
8+
sources:
9+
- https://github.com/libusb/hidapi
10+
tasks:
11+
- setup: |
12+
cd hidapi
13+
./bootstrap
14+
./configure
15+
- build: |
16+
cd hidapi
17+
make
18+
make DESTDIR=$PWD/root install
19+
make clean
20+
- build-manual: |
21+
cd hidapi/linux
22+
make -f Makefile-manual
23+
cd ../libusb
24+
make -f Makefile-manual
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
image: fedora/latest
2+
packages:
3+
- autoconf
4+
- automake
5+
- libtool
6+
- mingw64-gcc
7+
- mingw64-gcc-c++
8+
sources:
9+
- https://github.com/libusb/hidapi
10+
tasks:
11+
- setup: |
12+
cd hidapi
13+
./bootstrap
14+
mingw64-configure
15+
- build: |
16+
cd hidapi
17+
make
18+
make DESTDIR=$PWD/root install
19+
make clean
20+
- build-manual: |
21+
cd hidapi/windows
22+
make -f Makefile-manual OS=MINGW CC=x86_64-w64-mingw32-gcc

deps/hidapi/.builds/freebsd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
image: freebsd/latest
2+
packages:
3+
- autoconf
4+
- automake
5+
- gmake
6+
- libiconv
7+
- libtool
8+
- pkgconf
9+
sources:
10+
- https://github.com/libusb/hidapi
11+
tasks:
12+
- setup: |
13+
cd hidapi
14+
./bootstrap
15+
./configure
16+
- build: |
17+
cd hidapi
18+
make
19+
make DESTDIR=$PWD/root install
20+
make clean
21+
- build-manual: |
22+
cd hidapi/libusb
23+
gmake -f Makefile-manual

deps/hidapi/.cirrus.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
alpine_task:
2+
container:
3+
image: alpine:latest
4+
install_script: apk add autoconf automake g++ gcc libusb-dev libtool linux-headers eudev-dev make musl-dev
5+
script:
6+
- ./bootstrap
7+
- ./configure || { cat config.log; exit 1; }
8+
- make
9+
- make install
10+
11+
freebsd11_task:
12+
freebsd_instance:
13+
image: freebsd-11-2-release-amd64
14+
install_script:
15+
- pkg install -y
16+
autoconf automake libiconv libtool pkgconf
17+
script:
18+
- ./bootstrap
19+
- ./configure || { cat config.log; exit 1; }
20+
- make
21+
- make install
22+
23+
freebsd12_task:
24+
freebsd_instance:
25+
image: freebsd-12-1-release-amd64
26+
install_script:
27+
- pkg install -y
28+
autoconf automake libiconv libtool pkgconf
29+
script:
30+
- ./bootstrap
31+
- ./configure || { cat config.log; exit 1; }
32+
- make
33+
- make install

deps/hidapi/.gitattributes

Lines changed: 0 additions & 7 deletions
This file was deleted.

deps/hidapi/.gitignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

deps/hidapi/AUTHORS.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Ludovic Rousseau <[email protected]>:
1010
Bug fixes
1111
Correctness fixes
1212

13+
libusb/hidapi Team:
14+
Development/maintainance since June 4th 2019
1315

1416
For a comprehensive list of contributions, see the commit list at github:
15-
http://github.com/signal11/hidapi/commits/master
17+
https://github.com/libusb/hidapi/graphs/contributors
1618

deps/hidapi/BUILD.autotools.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Building HIDAPI using Autotools (deprecated)
2+
3+
---
4+
**NOTE**: for all intentions and purposes the Autotools build scripts for HIDAPI are _deprecated_ and going to be obsolete in the future.
5+
HIDAPI Team recommends using CMake build for HIDAPI.
6+
If you are already using Autotools build scripts provided by HIDAPI,
7+
consider switching to CMake build scripts as soon as possible.
8+
9+
---
10+
11+
To be able to use Autotools to build HIDAPI, it has to be [installed](#installing-autotools)/available in the system.
12+
13+
Make sure you've checked [prerequisites](BUILD.md#prerequisites) and installed all required dependencies.
14+
15+
## Installing Autotools
16+
17+
HIDAPI uses few specific tools/packages from Autotools: `autoconf`, `automake`, `libtool`.
18+
19+
On different platforms or package managers, those could be named a bit differently or packaged together.
20+
You'll have to check the documentation/package list for your specific package manager.
21+
22+
### Linux
23+
24+
On Ubuntu the tools are available via APT:
25+
26+
```sh
27+
sudo apt install autoconf automake libtool
28+
```
29+
30+
### FreeBSD
31+
32+
FreeBSD Autotools can be installed as:
33+
34+
```sh
35+
pkg_add -r autotools
36+
```
37+
38+
Additionally, on FreeBSD you will need to install GNU make:
39+
```sh
40+
pkg_add -r gmake
41+
```
42+
43+
## Building HIDAPI with Autotools
44+
45+
A simple command list, to build HIDAPI with Autotools as a _shared library_ and install in into your system:
46+
47+
```sh
48+
./bootstrap # this prepares the configure script
49+
./configure
50+
make # build the library
51+
make install # as root, or using sudo, this will install hidapi into your system
52+
```
53+
54+
`./configure` can take several arguments which control the build. A few commonly used options:
55+
```sh
56+
--enable-testgui
57+
# Enable the build of Foxit-based Test GUI. This requires Fox toolkit to
58+
# be installed/available. See README.md#test-gui for remarks.
59+
60+
--prefix=/usr
61+
# Specify where you want the output headers and libraries to
62+
# be installed. The example above will put the headers in
63+
# /usr/include and the binaries in /usr/lib. The default is to
64+
# install into /usr/local which is fine on most systems.
65+
66+
--disable-shared
67+
# By default, both shared and static libraries are going to be built/installed.
68+
# This option disables shared library build, if only static library is required.
69+
```
70+
71+
72+
## Cross Compiling
73+
74+
This section talks about cross compiling HIDAPI for Linux using Autotools.
75+
This is useful for using HIDAPI on embedded Linux targets. These
76+
instructions assume the most raw kind of embedded Linux build, where all
77+
prerequisites will need to be built first. This process will of course vary
78+
based on your embedded Linux build system if you are using one, such as
79+
OpenEmbedded or Buildroot.
80+
81+
For the purpose of this section, it will be assumed that the following
82+
environment variables are exported.
83+
```sh
84+
$ export STAGING=$HOME/out
85+
$ export HOST=arm-linux
86+
```
87+
88+
`STAGING` and `HOST` can be modified to suit your setup.
89+
90+
### Prerequisites
91+
92+
Depending on what backend you want to cross-compile, you also need to prepare the dependencies:
93+
`libusb` for libusb HIDAPI backend, or `libudev` for hidraw HIDAPI backend.
94+
95+
An example of cross-compiling `libusb`. From `libusb` source directory, run:
96+
```sh
97+
./configure --host=$HOST --prefix=$STAGING
98+
make
99+
make install
100+
```
101+
102+
An example of cross-comping `libudev` is not covered by this section.
103+
Check `libudev`'s documentation for details.
104+
105+
### Building HIDAPI
106+
107+
Build HIDAPI:
108+
```sh
109+
PKG_CONFIG_DIR= \
110+
PKG_CONFIG_LIBDIR=$STAGING/lib/pkgconfig:$STAGING/share/pkgconfig \
111+
PKG_CONFIG_SYSROOT_DIR=$STAGING \
112+
./configure --host=$HOST --prefix=$STAGING
113+
# make / make install - same as for a regular build
114+
```

0 commit comments

Comments
 (0)