updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / crystalhd-git / PKGBUILD
blob300c683ef832c30ca272dfb72f73ef407f22e168
1 # Contributor: Petteri Tolonen <petteri.tolonen[at]gmail.com>
2 # Maintainer: Petteri Tolonen <petteri.tolonen[at]gmail.com>
4 pkgname=crystalhd-git
5 pkgver=20111227
6 pkgrel=1
7 pkgdesc="Broadcom CrystalHD kernel module"
8 arch=('i686' 'x86_64')
9 url="http://linuxtv.org/git/jarod/crystalhd.git"
10 license=('GPL2')
11 depends=('linux>=3.0' 'libcrystalhd-git')
12 makedepends=('autoconf' 'linux-headers>=3.0' 'make' 'git')
13 install='crystalhd-git.install'
14 conflicts=('crystalhd')
15 _gitroot='git://linuxtv.org/jarod/crystalhd.git'
16 _gitname='crystalhd'
18 build() {
20     cd $startdir/src
22     msg "Connecting to the GIT server...."
24     if [ -d $startdir/src/$_gitname ] ; then
25         cd $_gitname && git pull origin
26         msg "The local files are updated."
27     else
28         git clone $_gitroot
29         cd $_gitname
30     fi
32     cd driver/linux
34     autoconf
35     ./configure --prefix=/usr
36     sed -i 's/'-Werror'/''/g' Makefile 
38     if ! grep -q "<linux/delay.h>" $srcdir/crystalhd/driver/linux/crystalhd_flea_ddr.c
39     then
40     sed -i '26i #include <linux/delay.h>' $srcdir/crystalhd/driver/linux/crystalhd_flea_ddr.c
41     fi
43     make || return 1
44     
45     mkdir -p $pkgdir/etc/udev/rules.d
46     mkdir -p $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom
48     cp -f 20-crystalhd.rules $pkgdir/etc/udev/rules.d/
49     install -d $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom
50     install -m 0644 crystalhd.ko $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom