summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 93c7ffbafb6bcae4cc8840c5ab4b31388f141ea3 (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
# Maintainer: Chris Na <buxel.dev@gmail.com>
# Contributor: 0x00002a <markus@optiikka.io>

pkgname=libfprint-goodixtls511-git
pkgver=r1813.8c36740
pkgrel=1
pkgdesc="libfprint with Goodix GF511 (27c6:5110) TLS fingerprint sensor driver"
arch=('x86_64')
url="https://github.com/buxel/libfprint.git"
license=('LGPL-2.1-or-later')

# Replaces the official libfprint so fprintd and pam_fprintd keep working
provides=('libfprint' 'libfprint-2.so=2-64')
conflicts=('libfprint' 'libfprint-goodixtls-git')
# replaces=('libfprint-goodixtls-git')  # intentionally omitted: goodixtls-git covers
                                         # multiple Goodix TLS sensors; only replace it
                                         # if the user explicitly chooses this package

depends=('glib2' 'glibc' 'gnutls' 'libgudev' 'libgusb' 'openssl' 'pixman')
makedepends=('git' 'meson' 'pkgconf' 'glib2-devel')
optdepends=('fprintd: D-Bus daemon for fingerprint authentication')

_branch="goodixtls-upstream-mr"
source=("${pkgname}::git+${url}#branch=${_branch}")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "${srcdir}/${pkgname}"
    meson setup build \
        --buildtype=release \
        --prefix=/usr \
        -Ddoc=false \
        -Dgtk-examples=false \
        -Dintrospection=false \
        -Dinstalled-tests=false \
        -Dgoodixtls=enabled
    ninja -C build
}

check() {
    cd "${srcdir}/${pkgname}"
    ninja -C build test
}

package() {
    cd "${srcdir}/${pkgname}"
    DESTDIR="${pkgdir}" ninja -C build install

    # Install udev rules so the sensor is accessible without root
    # (ninja install already handles this via meson's udev_rules_dir detection)
}