HIDAPI-0.15.0

#### Supplemental Linux® From Scratch - Version 13.0

### Chapter 2. General Libraries

- Prev

  Glaze-7.0.2

- Next

  iniparser-4.2.6

- Up
- Home

# HIDAPI-0.15.0

## Introduction to HIDAPI

The HIDAPI package provides a library for working with HIDs (Human Interface Devices) and can utilize libusb to better serve this goal.

- Download: http://github.com/libusb/hidapi/archive/hidapi-0.15.0.tar.gz

### Note

`hidapi-0.15.0.tar.gz` extracts to `hidapi-hidapi-0.15.0`.

### HIDAPI Dependencies

#### Required

CMake

#### Recommended

libusb

## Kernel Configuration

To allow HIDAPI to access HIDs, enable the following options and recompile the kernel if necessary:

    Device Drivers --->
      [*] HID bus support --->                                         [HID_SUPPORT]
        <*>   HID bus core support                                             [HID]
        [*]     /dev/hidraw raw HID device support                          [HIDRAW]
        <*/M>   User-space I/O driver support for HID subsystem               [UHID]
        <*>     Generic HID driver                                     [HID_GENERIC]

## Installation of HIDAPI

Install HIDAPI by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr   \
          -D CMAKE_BUILD_TYPE=Release    \
          -D CMAKE_SKIP_INSTALL_RPATH=ON \
          -W no-dev -G Ninja .. &&
    ninja

Now, as the `root` user:

    ninja install

## Command Explanations

`-D CMAKE_SKIP_INSTALL_RPATH=ON`: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

## Contents

Installed Programs: None
Installed Libraries: libhidapi-hidraw and libhidapi-libusb
Installed Directories: /usr/include/hidapi and /usr/lib/cmake/hidapi

### Short Descriptions

`libhidapi-hidraw` | accesses raw HIDs
`libhidapi-libusb` | accesses HIDs via libusb

- Prev

  Glaze-7.0.2

- Next

  iniparser-4.2.6

- Up
- Home