summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8de533dd7859df6759b97d1859b17223e34b74f3 (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
53
54
# Maintainer: Robert Falkenberg <robert.falkenberg@tu-dortmund.de>
# Contributor: Kyle Keen <keenerd@gmail.com>
# Contributor: Dominik Heidler <dheidler@gmail.com>

pkgname=libuhd3
pkgver=3.15.0.0
pkgrel=1
pkgdesc="Universal Software Radio Peripheral (USRP) userspace driver"
arch=('x86_64')
url="https://files.ettus.com/manual/"
license=('GPL')
depends=('boost-libs' 'orc' 'libusb')
optdepends=('python: usrp utils' 'libuhd-firmware3')
makedepends=('cmake' 'boost' 'python-mako')
# gpsd?  dpdk?
provides=('libuhd=3.15.0.0')
conflicts=('libuhd' 'libuhd-firmware')

source=("libuhd-$pkgver.tar.gz::https://github.com/EttusResearch/uhd/archive/v$pkgver.tar.gz"
        boost-1.73.patch)
sha256sums=('eed4a77d75faafff56be78985950039f8d9d1eb9fcbd58b8862e481dd49825cd'
            '10c2f221dee97418f92d10606f9b9fea1436e3bd0d7120e7b24fc90a95a07fc1')

prepare() {
  cd "$srcdir/uhd-$pkgver/host"
  mkdir build

  # https://github.com/EttusResearch/uhd/issues/347
  patch -Np2 -i ../../boost-1.73.patch
}

build() {
  cd "$srcdir/uhd-$pkgver/host/build"

  cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ \
           -DPYTHON_EXECUTABLE=/usr/bin/python3 \
           -DENABLE_EXAMPLES=OFF \
           -DENABLE_UTILS=ON \
           -DENABLE_TESTS=OFF \
           -DENABLE_E100=ON \
           -DENABLE_E300=ON
  make
}

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

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