summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 77c58a9b4385eb433d3f3c14e70b85bbaf702c7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Sergej Pupykin <arch+pub@sergej.pp.ru>
# Contributor: Niels Martignène <niels.martignene@gmail.com>
# Contributor: Nicolas Avrutin <nicolasavru@gmail.com>
# Contributor: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>

_android_arch=x86-64

pkgname=android-${_android_arch}-hidapi
pkgver=0.14.0
pkgrel=2
arch=('any')
pkgdesc="Simple library for communicating with USB and Bluetooth HID devices (Android ${_android_arch})"
url='https://github.com/libusb/hidapi'
license=('GPL3'
         'BSD'
         'custom')
depends=('android-ndk')
optdepends=("android-${_android_arch}-libusb: for hidapi-libusb")
makedepends=('android-cmake'
             "android-${_android_arch}-libusb")
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://github.com/libusb/hidapi/archive/hidapi-${pkgver}.tar.gz")
md5sums=('d65a951df6f566f90bbeb4414caf2c1e')

build() {
    cd "${srcdir}/hidapi-hidapi-$pkgver"
    source android-env ${_android_arch}

    android-${_android_arch}-cmake \
        -S . \
        -B build-shared \
        -DBUILD_SHARED_LIBS=ON \
        -DBUILD_TESTING=OFF
    cmake --build build-shared

    android-${_android_arch}-cmake \
        -S . \
        -B build-static \
        -DBUILD_SHARED_LIBS=OFF \
        -DBUILD_TESTING=OFF
    cmake --build build-static
}

package() {
    cd "${srcdir}/hidapi-hidapi-$pkgver"
    source android-env ${_android_arch}

    make -C build-shared DESTDIR="${pkgdir}" install
    make -C build-static DESTDIR="${pkgdir}" install
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a
}