summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 39ef3801588348f34ec6ca0d9f85e646f56ca02e (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
54
55
56
57
58
59
60
61
62
63
# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Alad Wenter <alad@archlinux.org>
# Contributor: Christian Hesse <mail@eworm.de>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Daniel Plaza <daniel.plaza.espi@gmail.com>

_android_arch=x86-64

pkgname=android-${_android_arch}-pcsclite
pkgver=2.3.0
pkgrel=1
arch=('any')
pkgdesc="PC/SC Architecture smartcard middleware library (Android ${_android_arch})"
url='https://pcsclite.apdu.fr/'
license=('BSD')
groups=('android-pcsclite')
depends=('android-ndk')
makedepends=('android-meson')
options=(!strip !buildflags staticlibs !emptydirs)
source=("https://pcsclite.apdu.fr/files/pcsc-lite-${pkgver}.tar.xz"{,.asc}
        '0002-Disable-issetugid.patch'
        '0003-Fix-missing-pthread_cancel.patch')
md5sums=('a5b0906b64215b1e1ec0e314311601ad'
         'SKIP'
         '17cc08c1b9ed2c5912be2fd2b368c669'
         '3050ecacb997c4c6f901ddd18d4c87fc')
validpgpkeys=('F5E11B9FFE911146F41D953D78A1B4DFE8F9C57E') # Ludovic Rousseau <rousseau@debian.org>

prepare() {
    cd "${srcdir}/pcsc-lite-${pkgver}"

    patch -Np1 -i ../0002-Disable-issetugid.patch
    patch -Np1 -i ../0003-Fix-missing-pthread_cancel.patch
}

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

    android-${_android_arch}-meson build \
        -Dlibsystemd=false \
        -Dlibudev=false \
        -Dlibusb=false \
        -Dpolkit=false \
        -Dusb=false \
        -Dserial=false \
        -Dserialconfdir="${ANDROID_PREFIX_ETC}/reader.conf.d" \
        -Dusbdropdir="${ANDROID_PREFIX_LIB}/pcsc/drivers"
    ninja -C build
}

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

    DESTDIR="${pkgdir}" meson install -C build
    rm -rf "$pkgdir/bin"
    rm -f "$pkgdir/${ANDROID_PREFIX_BIN}/pcscd"
    rm -rf "$pkgdir/${ANDROID_PREFIX_SHARE}"
    ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.so
    ${ANDROID_STRIP} -g "${pkgdir}/${ANDROID_PREFIX_LIB}"/*.a || true
}