summarylogtreecommitdiffstats
path: root/build-libusb-and-hidapi.sh
blob: 5ecfa1a4c1abd2a05d830ca2e509d4df99edb36a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env bash

# SPDX-FileCopyrightText: 2020 TQ Tezos <https://tqtezos.com/>
#
# SPDX-License-Identifier: LicenseRef-MIT-TQ

# This script builds and installs libusb and hidapi libraries. It's required since alpine
# doesn't provide static versions for these libraries, thus we have to compile it ourselves.
set -euo pipefail

git clone --single-branch --branch v1.0.23 https://github.com/libusb/libusb.git --depth 1
cd libusb
autoreconf -fvi && ./configure && make && make install

git clone --single-branch --branch hidapi-0.9.0 https://github.com/libusb/hidapi.git --depth 1

cd hidapi
autoreconf -fvi && ./bootstrap && ./configure && make && make install

rm -rf libusb hidapi