# Maintainer:
pkgname=uhd
pkgver=4.7.0.0
pkgrel=0
pkgdesc="USRP Hardware Driver"
url="https://github.com/EttusResearch/uhd"
options="!check" # no tests
arch="all"
license="GPL-3.0-or-later"
makedepends="
	boost-dev
	cmake
	libusb-dev
	py3-numpy-dev
	py3-mako
	py3-pybind11-dev
	py3-setuptools
	python3-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-libs $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/EttusResearch/uhd/archive/refs/tags/v$pkgver.tar.gz"

build() {
	case "$CARCH" in
	aarch64)
		local neon=ON
		;;
	*)
		local neon=OFF
		;;
	esac
	cmake -B build-host -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DNEON_SIMD_ENABLE=$neon \
		-DUHD_VERSION=$pkgver \
		host
	cmake --build build-host
}

package() {
	DESTDIR="$pkgdir" cmake --install build-host
}

sha512sums="
6f2c48890058620499dc4f9661da1fe26fb711225d8f1f4a84cb9a57b049cccdf87d40480618f37bc2aff23b2538b5323f526985ec25a6a1f58122d39387b0cb  uhd-4.7.0.0.tar.gz
"
