PKGBUILDs/community/libuhd/PKGBUILD
2021-06-10 12:59:07 +00:00

64 lines
1.9 KiB
Bash

# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Dominik Heidler <dheidler@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - set -DNEON_SIMD_ENABLE=OFF
# - explicitly link v5/v6 with libatomic
pkgname=libuhd
pkgver=4.0.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'
'python-numpy: python api')
makedepends=('cmake' 'boost' 'python-mako' 'python-numpy')
# gpsd? dpdk?
source=("libuhd-$pkgver.tar.gz::https://github.com/EttusResearch/uhd/archive/v$pkgver.tar.gz"
gcc11.patch
boost-1.76.patch)
sha256sums=('4f3513c43edf0178391ed5755266864532716b8b503bcfb9a983ae6256c51b14'
'967ef02684f8b07ceebc3fbfc36b97f5ca74e3c1ecf481f643ec20ca0af4f08c'
'14907a6fc67b59fdfaee7c46f91b903296e4e0e335f39ff2e83bb935ee10b4f5')
prepare() {
cd "$srcdir/uhd-$pkgver/host"
mkdir build
patch -Np1 -d .. -i ../gcc11.patch
# https://github.com/EttusResearch/uhd/issues/437
patch -Np1 -d .. -i ../boost-1.76.patch
}
build() {
cd "$srcdir/uhd-$pkgver/host/build"
[[ $CARCH == "arm" || $CARCH == "armv6h" ]] && echo "target_link_libraries(uhd atomic)" >> "$srcdir/uhd-$pkgver/host/lib/CMakeLists.txt"
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DENABLE_PYTHON_API=ON \
-DENABLE_EXAMPLES=OFF \
-DENABLE_UTILS=ON \
-DENABLE_TESTS=OFF \
-DENABLE_E100=ON \
-DENABLE_E300=ON \
-DNEON_SIMD_ENABLE=OFF
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"
}