summaryrefslogtreecommitdiff
path: root/community/libuhd/PKGBUILD
blob: d51796f9efcb20367d5cbaab860ce9efa616cc43 (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
# $Id: PKGBUILD 105585 2014-02-10 16:15:17Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Dominik Heidler <dheidler@gmail.com>

pkgname=libuhd
pkgver=3.6.2
_verstring=003_006_002
pkgrel=1
pkgdesc="Universal Software Radio Peripheral (USRP) userspace driver"
arch=('x86_64' 'i686')
url="http://code.ettus.com/redmine/ettus/projects/uhd/wiki"
license=('GPL')
depends=('boost-libs' 'orc' 'libusbx')
optdepends=('python2: usrp utils')
makedepends=('cmake' 'boost' 'python2-cheetah')

source=("libuhd-$pkgver.tar.gz::https://github.com/EttusResearch/uhd/archive/release_${_verstring}.tar.gz")
md5sums=('50a25b95dc08dd3946988c5da98814a9')

build() {
  cd "$srcdir/uhd-release_$_verstring/host"
  # fix for py2
  find -name "*.py" -or -name '*.py.in' | xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  
  mkdir -p build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ \
           -DPYTHON_EXECUTABLE=/usr/bin/python2 \
           -DENABLE_EXAMPLES=OFF \
           -DENABLE_UTILS=ON \
           -DENABLE_TESTS=OFF \
           -DENABLE_E100=ON
  # e100 is disabled by default for now, check that on future releases

  make
}

check() {
  cd "$srcdir/uhd-release_$_verstring/host/build"
  make test
}

package() {
  cd "$srcdir/uhd-release_$_verstring/host/build"
  make DESTDIR="$pkgdir" install
  install -Dm644 "../utils/uhd-usrp.rules" "$pkgdir/usr/lib/udev/rules.d/10-uhd-usrp.rules"
}