summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c99c2f47ad04bcbc12a9c85d6aa76f8848ecc562 (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
55
56
57
58
59
60
61
62
63
# 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=2
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>3.15.0.0' 'libuhd-firmware>3.15.0.0')

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

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

  # https://github.com/EttusResearch/uhd/issues/347
  patch --forward --strip=1 --input "$srcdir/boost-1.73.patch"

  # Add missing "#include <thread>" due to
  # header dependency changes since GCC 11.1
  # See https://gcc.gnu.org/gcc-11/porting_to.html
  patch --forward --strip=1 --input "$srcdir/gcc-11.1.patch"

  cd "$srcdir/uhd-$pkgver/host"
  mkdir build
}

build() {
  cd "$srcdir/uhd-$pkgver/host"
  cmake -B "build" \
           -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 -C "build"
}

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

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