summaryrefslogtreecommitdiffstats
path: root/abs/not_built/extra/crystalhd-git/PKGBUILD
blob: a7b3e7fed9814479f106b5cc3d09cae8111f87cf (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
# Contributor: Petteri Tolonen <petteri.tolonen[at]gmail.com>
# Maintainer: Petteri Tolonen <petteri.tolonen[at]gmail.com>

pkgname=crystalhd-git
pkgver=20111227
pkgrel=1
pkgdesc="Broadcom CrystalHD kernel module"
arch=('i686' 'x86_64')
url="http://linuxtv.org/git/jarod/crystalhd.git"
license=('GPL2')
depends=('libcrystalhd-git')
makedepends=('autoconf' 'make' 'git')
install='crystalhd-git.install'
conflicts=('crystalhd')
_gitroot='git://linuxtv.org/jarod/crystalhd.git'
_gitname='crystalhd'

build() {

    cd $startdir/src

    msg "Connecting to the GIT server...."

    if [ -d $startdir/src/$_gitname ] ; then
        cd $_gitname && git pull origin
        msg "The local files are updated."
    else
        git clone $_gitroot
        cd $_gitname
    fi

    cd driver/linux

    autoconf
    ./configure --prefix=/usr
    sed -i 's/'-Werror'/''/g' Makefile 

    if ! grep -q "<linux/delay.h>" $srcdir/crystalhd/driver/linux/crystalhd_flea_ddr.c
    then
    sed -i '26i #include <linux/delay.h>' $srcdir/crystalhd/driver/linux/crystalhd_flea_ddr.c
    fi

    make || return 1
    
    mkdir -p $pkgdir/etc/udev/rules.d
    mkdir -p $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom

    cp -f 20-crystalhd.rules $pkgdir/etc/udev/rules.d/
    install -d $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom
    install -m 0644 crystalhd.ko $pkgdir/lib/modules/$(uname -r)/kernel/drivers/video/broadcom
}
md5sums=()