summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ea21faa5d70b9945f1c156bb74e60fe85c49c657 (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
# Maintainer: Lorenzo Zolfanelli <dev(at)zolfa(dot)nl>

_pkgbase="nxp-pn5xx"
_git_repo="https://github.com/jr64/nxp-pn5xx"
_git_branch="master"
pkgname="${_pkgbase}-dkms-git"
pkgver=0.0.1.r9.g32ed027
pkgrel=2
pkgdesc="Kernel mode driver for NXP pn5xx NFC readers with ACPI autodiscovery"
arch=('any')
url="https://github.com/jr64/nxp-pn5xx"
license=('GPL-2.0-only')
depends=('dkms')
provides=("${_pkgbase}-dkms=${pkgver}")
conflicts=("${_pkgbase}")
makedepends=("git")
source=("${_pkgbase}::git+${_git_repo}#branch=${_git_branch}"
	'dkms.conf'
	'nxp-pn5xx.conf'
	'nxp-pn5xx-linux6.12-llseek.patch')
sha256sums=('SKIP'
            '3c8c4215ba5d17a252b8a74f36adb6a7dc2fe3c4a18b3d3790703505a5662f82'
            '20b96902d6741ba2b165fbc6348740cf407d42839a3af2d89c358da5558b83ea'
            'f912a17553589f100ea84456d9f68cd9b1fdbdec426fd3204314a8dde44fef71')

prepare() {
	cd "${_pkgbase}"

	# Required until https://github.com/jr64/nxp-pn5xx/pull/4 is accepted
	patch -Np1 -i ../nxp-pn5xx-linux6.12-llseek.patch
}

package() {
	install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
	sed -e "s/@_PKGBASE@/${_pkgbase}/" \
	    -e "s/@PKGVER@/${pkgver}/" \
	    -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

	cp -r ${_pkgbase}/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/

	install -Dm644 ${_pkgbase}.conf "${pkgdir}/usr/lib/modprobe.d/${_pkgbase}.conf"
}


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