summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f55493544e1caec014af164c0166226555446eba (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
# Maintainer: Kohei Suzuki <eagletmt@gmail.com>
pkgname=pt1_drv-dkms-hg
_pkgname=pt1_drv
pkgver=r141.c8688d7d6382
pkgrel=3
pkgdesc="PT1/2 driver sources for DKMS"
arch=('i686' 'x86_64')
url="http://hg.honeyplanet.jp/pt1/"
license=('unknown')
depends=('dkms' 'linux-headers')
makedepends=('mercurial')
provides=('pt1_drv-dkms')
install=dkms.install
source=("$pkgname"::hg+'http://hg.honeyplanet.jp/pt1/'
        dkms.conf
        99-pt1_drv.rules
        linux-4.2-vmalloc.patch
        linux-4.12-copy-user.patch)

pkgver() {
  cd "$srcdir/$pkgname"
  printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
}

prepare() {
  cd "$srcdir/$pkgname"
  patch -Np1 -i "$srcdir/linux-4.2-vmalloc.patch"
  patch -Np1 -i "$srcdir/linux-4.12-copy-user.patch"
}

build() {
  cd "$srcdir/$pkgname/driver"
  make version.h
}

package() {
  cd "$srcdir/$pkgname/driver"

  install -dm755 "$pkgdir/usr/src/$_pkgname-$pkgver"
  install -m644 *.{c,h} Makefile "$srcdir/dkms.conf" "$pkgdir/usr/src/$_pkgname-$pkgver/"
  install -Dm644 "$srcdir/99-pt1_drv.rules" "$pkgdir/usr/lib/udev/rules.d/99-pt1_drv.rules"
}

# vim:set ts=2 sw=2 et:
sha1sums=('SKIP'
          'af3fc15f2b7e9e1fc9a8559546a0ed733f7115c6'
          'ad3c58078fbd48b8f97ea24af2b084be29210b47'
          '547f63e6449a73e9072681babc89a7be12e2c07b'
          'ad636e6a198628703b7d18c67f091f6271f7cd0f')