summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2bc00442c75febfdef42fb6a23b4ca1423a1e49e (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
# Maintainer: Matt Collins <matt.mattop@gmail.com>

_pkgbase="gasket"
pkgname="$_pkgbase-dkms-git"
pkgver=r236.5815ee3
pkgrel=1
pkgdesc='Google Coral driver for PCIe-based Edge TPU devices, such as the M.2 and Mini PCIe Accelerator, Git version'
arch=('x86_64')
url='https://coral.withgoogle.com/'
license=('GPL2')
depends=('dkms')
provides=("${_pkgbase}")
conflicts=("${_pkgbase}")
makedepends=('sed' 'binutils' 'git')
source=("git+https://github.com/google/gasket-driver.git"
        "https://github.com/google/gasket-driver/commit/4b2a1464f3b619daaf0f6c664c954a42c4b7ce00.patch")
sha256sums=('SKIP'
            'SKIP')

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

prepare() {
  cd gasket-driver
  patch -Np1 -i ../../4b2a1464f3b619daaf0f6c664c954a42c4b7ce00.patch
}

package() {
  echo "${srcdir}"
  echo "${pkgdir}"
  cd "${srcdir}/gasket-driver/src"
  mkdir -p "${pkgdir}/usr/src/${_pkgbase}-${pkgver}"
  cp -pr * "${pkgdir}/usr/src/${_pkgbase}-${pkgver}"
  install -Dm644 "${srcdir}/gasket-driver/debian/gasket-dkms.dkms" "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
  install -Dm644 "${srcdir}/gasket-driver/debian/gasket-dkms.udev" "${pkgdir}/usr/lib/udev/rules.d/60-gasket-dkms.rules"
  sed -e "s/#MODULEVERSION#/${pkgver}/" -i "${pkgdir}/usr/src/${_pkgbase}-${pkgver}/dkms.conf"
}