updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / openhantek / PKGBUILD
blob4480bea90855df6bc71e3e8f78dfac1f6d37efb0
1 # Contributor: Kyle Keen <keenerd@gmail.com>
2 pkgname=openhantek
3 pkgver=0.2.0
4 _fwpkgver=0.7.0
5 pkgrel=2
6 pkgdesc="Qt4 UI for the Hantek DSO-2090/2150/2250/5200/5200A oscilloscopes. Includes firmware."
7 arch=('i686' 'x86_64')
8 url="http://www.openhantek.org/"
9 license=('GPL')
10 depends=('qt' 'libusb' 'fftw' 'libgl' 'fxload')
11 makedepends=('binutils')
12 source=(http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgname-$pkgver.tar.bz2 \
13 http://downloads.sourceforge.net/project/$pkgname/$pkgname-extractfw/$pkgname-extractfw-0.7.0.tar.bz2)
14 md5sums=('57732229f063f582bfaa3c3cc942dae2'
15          '9346d8e842cf1ea3eb378f21220e74b9')
17 # todo: handle groups, source firmware
19 # If you can't run OpenHantek as normal user, you have to add your user to the plugdev group.
20 # groupadd plugdev
21 # usermod -a -G plugdev USER
22 # log out and back in again
24 build() {
25   cd "$srcdir/$pkgname"
26   qmake PREFIX="/usr"  # Hah.
27   sed -i 's|/local/|/|g' Makefile
28   sed -i 's|/local||g' OpenHantek.pro
29   # fix crashiness on Catalyst, makes display slightly uglier
30   sed -i 's|GL_SMOOTH/*GL_FLAT*/|GL_FLAT|' src/glscope.cpp
31   make
32   #sed -i 's|local/\(share/apps/openhantek/translations\)|\1\x00\x00\x00\x00\x00\x00|' bin/openhantek
34   cd "$srcdir/$pkgname-extractfw"
35   ./configure --prefix=/usr
36   sed -i 's|/local/|/|g' Makefile
37   sed -i 's/-lbfd/-ldl &/' Makefile
38   make
39   ./fwget.sh
40   sed -i 's|/local/|/|g' 90-hantek.rules
43 package() {
44   cd "$srcdir/$pkgname"
45   make INSTALL_ROOT="$pkgdir" install
46   
47   cd "$srcdir/$pkgname-extractfw"
48   make DESTDIR="$pkgdir" install
49   mkdir -p "$pkgdir/usr/share/hantek/"
50   cp firmware/*.hex "$pkgdir/usr/share/hantek/"
51   install -Dm644 90-hantek.rules "$pkgdir/etc/udev/rules.d/90-hantek.rules"