git: db29af575277 - main - comms/airspyhf: Add new port

From: Dmitri Goutnik <dmgk_at_FreeBSD.org>
Date: Thu, 23 Jun 2022 22:48:08 UTC
The branch main has been updated by dmgk:

URL: https://cgit.FreeBSD.org/ports/commit/?id=db29af57527777e3986d9acb643bcd2a79d73e1d

commit db29af57527777e3986d9acb643bcd2a79d73e1d
Author:     Dmitri Goutnik <dmgk@FreeBSD.org>
AuthorDate: 2022-06-23 22:32:50 +0000
Commit:     Dmitri Goutnik <dmgk@FreeBSD.org>
CommitDate: 2022-06-23 22:47:50 +0000

    comms/airspyhf: Add new port
    
    User mode driver for Airspy HF+, a high performance software defined radio for
    the HF and VHF bands.
    
    WWW: https://github.com/airspy/airspyhf
---
 comms/Makefile                                     |  1 +
 comms/airspyhf/Makefile                            | 27 ++++++++++++++++++++++
 comms/airspyhf/distinfo                            |  3 +++
 .../files/patch-libairspyhf_src_airspyhf.c         | 11 +++++++++
 comms/airspyhf/pkg-descr                           |  4 ++++
 comms/airspyhf/pkg-plist                           | 13 +++++++++++
 6 files changed, 59 insertions(+)

diff --git a/comms/Makefile b/comms/Makefile
index fc4bdf838b63..cc07612bbb24 100644
--- a/comms/Makefile
+++ b/comms/Makefile
@@ -2,6 +2,7 @@
 
     SUBDIR += acfax
     SUBDIR += airspy
+    SUBDIR += airspyhf
     SUBDIR += aldo
     SUBDIR += amtterm
     SUBDIR += anyremote
diff --git a/comms/airspyhf/Makefile b/comms/airspyhf/Makefile
new file mode 100644
index 000000000000..14a8c156f2c9
--- /dev/null
+++ b/comms/airspyhf/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	airspyhf
+DISTVERSION=	1.6.8-7
+DISTVERSIONSUFFIX=	-gb93dedd
+CATEGORIES=	comms hamradio
+
+MAINTAINER=	dmgk@FreeBSD.org
+COMMENT=	User mode driver for Airspy HF+ SDR
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		cmake compiler:c11 pkgconfig
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	airspy
+
+CMAKE_ARGS=	-DLIBUSB_LIBRARIES="/usr/lib/libusb.so"
+CMAKE_OFF=	INSTALL_UDEV_RULES
+
+OPTIONS_DEFINE_amd64=	SIMD
+OPTIONS_DEFINE_i386=	SIMD
+OPTIONS_DEFAULT_amd64=	SIMD
+OPTIONS_DEFAULT_i386=	SIMD
+
+SIMD_CFLAGS=	-DFREEBSD_USE_SIMD -msse -msse2 -mfpmath=sse -mmmx
+
+.include <bsd.port.mk>
diff --git a/comms/airspyhf/distinfo b/comms/airspyhf/distinfo
new file mode 100644
index 000000000000..5a757f3f9884
--- /dev/null
+++ b/comms/airspyhf/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1656019287
+SHA256 (airspy-airspyhf-1.6.8-7-gb93dedd_GH0.tar.gz) = 19075646e6ccbda05ab9d9ccb6678d0905ebf8acd66312cf1de34b17116b9190
+SIZE (airspy-airspyhf-1.6.8-7-gb93dedd_GH0.tar.gz) = 52949
diff --git a/comms/airspyhf/files/patch-libairspyhf_src_airspyhf.c b/comms/airspyhf/files/patch-libairspyhf_src_airspyhf.c
new file mode 100644
index 000000000000..7cb5442ee504
--- /dev/null
+++ b/comms/airspyhf/files/patch-libairspyhf_src_airspyhf.c
@@ -0,0 +1,11 @@
+--- libairspyhf/src/airspyhf.c.orig	2022-06-23 21:14:46 UTC
++++ libairspyhf/src/airspyhf.c
+@@ -1189,7 +1189,7 @@ int ADDCALL airspyhf_stop(airspyhf_device_t* device)
+ 	int result1, result2;
+ 	result1 = kill_io_threads(device);
+ 	result2 = airspyhf_set_receiver_mode(device, RECEIVER_MODE_OFF);
+-	libusb_interrupt_event_handler(device->usb_context);
++	// libusb_interrupt_event_handler(device->usb_context);
+ 
+ 	if (result2 != AIRSPYHF_SUCCESS)
+ 	{
diff --git a/comms/airspyhf/pkg-descr b/comms/airspyhf/pkg-descr
new file mode 100644
index 000000000000..c465a45c9214
--- /dev/null
+++ b/comms/airspyhf/pkg-descr
@@ -0,0 +1,4 @@
+User mode driver for Airspy HF+, a high performance software defined radio for
+the HF and VHF bands.
+
+WWW: https://github.com/airspy/airspyhf
diff --git a/comms/airspyhf/pkg-plist b/comms/airspyhf/pkg-plist
new file mode 100644
index 000000000000..794ede310103
--- /dev/null
+++ b/comms/airspyhf/pkg-plist
@@ -0,0 +1,13 @@
+bin/airspyhf_calibrate
+bin/airspyhf_gpio
+bin/airspyhf_info
+bin/airspyhf_lib_version
+bin/airspyhf_rx
+include/libairspyhf/airspyhf.h
+include/libairspyhf/airspyhf_commands.h
+include/libairspyhf/iqbalancer.h
+lib/libairspyhf.a
+lib/libairspyhf.so
+lib/libairspyhf.so.0
+lib/libairspyhf.so.1.6.8
+libdata/pkgconfig/libairspyhf.pc