1 # Contributor: Lex Rivera <x-demon@x-demon.org>
2 # Contributor: B < gotleenucks at gmail dot com>
3 # Can easily be built against any kernel you want; just set the
4 # _kernver variable manually and adapt makedepends accordingly.
5 pkgname=(crystalhd-snapshot libcrystalhd)
10 makedepends=('kernel26-headers' 'svn')
11 arch=('i686' 'x86_64')
12 url="http://code.google.com/p/crystalhd-for-osx/"
14 source=(2.6.35+_ioctl_replaced_by_unlocked_ioctl.patch
15 add_missing_include.patch)
21 _svntrunk=http://crystalhd-for-osx.googlecode.com/svn/trunk/
24 if [ -d $_svnmod/.svn ]; then
25 msg "SVN tree found, reverting changes and updating to -r$pkgver"
26 (cd $_svnmod && svn revert -R . && make distclean; svn up -r ${_svnver})
28 msg "Checking out SVN tree of -r$pkgver"
29 svn co $_svntrunk --config-dir ./ -r ${_svnver} $_svnmod
32 # Patch the code so it will build against 2.6.35 and higher
33 cd $srcdir/$_svnmod/crystalhd/driver/linux/
34 msg "Patching code so it builds with 2.6.35 and higher"
35 patch -Np1 -i $srcdir/${source[0]}
36 patch -Np1 -i $srcdir/${source[1]}
38 # Revert to 8 DMA buffers; 16 DMA buffers is supposed to improve CrystalHD performance
39 # but it's a bit heavy for an AppleTV with 256 MB of RAM. Damn you Apple for soldering it on!
40 # If you got heaps of RAM, comment this out - you'll want 16 DMA buffers.
41 # Not needed anymore if you build 3.8.0/r160 or higher.
42 # sed -i '/BC_RX_LIST_CNT/s|16|8|' ${srcdir}/${_svnmod}/crystalhd/include/bc_dts_glob_lnx.h
44 # Modify tresholds in an attempt to counter the framedrops and agressive RAM (and swap) usage
45 #sed -i '/PAUSE_DECODER_THRESHOLD/s|12|6|' ${srcdir}/${_svnmod}/crystalhd/linux_lib/libcrystalhd/libcrystalhd_priv.h
46 #sed -i '/RESUME_DECODER_THRESHOLD/s|5|3|' ${srcdir}/${_svnmod}/crystalhd/linux_lib/libcrystalhd/libcrystalhd_priv.h
48 # Build the kernel module
49 cd $srcdir/${_svnmod}/crystalhd/driver/linux
50 msg "Compiling kernel module..."
53 make -C /lib/modules/${_kernver}/build SUBDIRS=$(pwd) modules
56 cd $srcdir/${_svnmod}/crystalhd/linux_lib/libcrystalhd
57 msg "Compiling userspace library..."
62 package_crystalhd-snapshot() {
64 pkgdesc="Broadcom CrystalHD kernel module, stable release from SVN tree"
66 conflicts=('crystalhd-svn' 'crystalhd-git')
67 install=crystalhd.install
69 cd $srcdir/${_svnmod}/crystalhd/driver/linux
70 mkdir -p $pkgdir/{etc/udev/rules.d,lib/modules/${_kernver}/updates}
72 install -m 0644 20-crystalhd.rules $pkgdir/etc/udev/rules.d/
73 install -m 0644 crystalhd.ko $pkgdir/lib/modules/${_kernver}/updates/
77 package_libcrystalhd() {
79 pkgdesc="Broadcom CrystalHD library, stable release from SVN tree"
80 depends=('gcc-libs' 'crystalhd')
81 conflicts=('libcrystalhd-svn' 'libcrystalhd-git')
83 cd $srcdir/${_svnmod}/crystalhd/linux_lib/libcrystalhd
84 make install DESTDIR=$pkgdir
88 sha1sums=('c43277eef2fa45a4dfa8dc188e7d5f990f4e6b22'
89 '7e5967c765cde9cdb04754c7a617a63af3aee0f6')
91 # Let's not confuse poor AUR, shall we?
92 pkgname=crystalhd-snapshot
93 pkgdesc="Broadcom CrystalHD kernel module & library, tagged releases from Google Code SVN tree"