git: b8dd0def34db - main - comms/sdr++: New port: Cross-Platform SDR Software

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 23 Jun 2022 17:50:32 UTC
The branch main has been updated by yuri:

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

commit b8dd0def34db0cf5f0ca442f441a96526fc79bdd
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-06-23 17:32:43 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-06-23 17:50:16 +0000

    comms/sdr++: New port: Cross-Platform SDR Software
---
 comms/Makefile                            |  1 +
 comms/sdr++/Makefile                      | 32 +++++++++++++++++
 comms/sdr++/distinfo                      |  3 ++
 comms/sdr++/files/patch-CMakeLists.txt    | 24 +++++++++++++
 comms/sdr++/files/patch-core_src_core.cpp | 16 +++++++++
 comms/sdr++/pkg-descr                     |  4 +++
 comms/sdr++/pkg-plist                     | 59 +++++++++++++++++++++++++++++++
 7 files changed, 139 insertions(+)

diff --git a/comms/Makefile b/comms/Makefile
index c89107e588da..fc4bdf838b63 100644
--- a/comms/Makefile
+++ b/comms/Makefile
@@ -156,6 +156,7 @@
     SUBDIR += rxtx
     SUBDIR += scmxx
     SUBDIR += scrcpy
+    SUBDIR += sdr++
     SUBDIR += sdr-wspr
     SUBDIR += ser2net
     SUBDIR += serialoverip
diff --git a/comms/sdr++/Makefile b/comms/sdr++/Makefile
new file mode 100644
index 000000000000..5e30e8c278a1
--- /dev/null
+++ b/comms/sdr++/Makefile
@@ -0,0 +1,32 @@
+PORTNAME=	sdr++
+DISTVERSION=	1.0.4
+CATEGORIES=	comms hamradio
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Cross-Platform SDR Software
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/license
+
+LIB_DEPENDS=	libad9361.so:misc/libad9361-iio \
+		libairspy.so:comms/airspy \
+		libfftw3f.so:math/fftw3-float \
+		libglfw.so:graphics/glfw \
+		libhackrf.so:comms/hackrf \
+		libiio.so:misc/libiio \
+		librtaudio.so:audio/rtaudio \
+		librtlsdr.so:comms/rtl-sdr \
+		libSoapySDR.so:misc/soapysdr \
+		libvolk.so:devel/volk
+
+USES=		cmake compiler:c++17-lang gl pkgconfig xorg
+USE_GL=		gl glew glu opengl
+USE_XORG=	x11
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	AlexandreRouma
+GH_PROJECT=	SDRPlusPlus
+
+CMAKE_OFF=	OPT_BUILD_AIRSPYHF_SOURCE # dependency isn't ported yet
+
+.include <bsd.port.mk>
diff --git a/comms/sdr++/distinfo b/comms/sdr++/distinfo
new file mode 100644
index 000000000000..0d98d920ef15
--- /dev/null
+++ b/comms/sdr++/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1656000685
+SHA256 (AlexandreRouma-SDRPlusPlus-1.0.4_GH0.tar.gz) = 251256de6725ceb4f9fb2823c7ad825068ad16cf9b5fb894259b173aae5a69ea
+SIZE (AlexandreRouma-SDRPlusPlus-1.0.4_GH0.tar.gz) = 3700787
diff --git a/comms/sdr++/files/patch-CMakeLists.txt b/comms/sdr++/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..479c84390851
--- /dev/null
+++ b/comms/sdr++/files/patch-CMakeLists.txt
@@ -0,0 +1,24 @@
+--- CMakeLists.txt.orig	2022-06-23 16:25:30 UTC
++++ CMakeLists.txt
+@@ -3,8 +3,8 @@ project(sdrpp)
+ 
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+     set(CMAKE_INSTALL_PREFIX "/usr/local")
+-else()
+-    set(CMAKE_INSTALL_PREFIX "/usr")
++#else()
++#    set(CMAKE_INSTALL_PREFIX "/usr")
+ endif()
+ 
+ # Compatibility Options
+@@ -206,8 +206,8 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/root/res/icons D
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/root/res/themes DESTINATION share/sdrpp)
+ configure_file(${CMAKE_SOURCE_DIR}/sdrpp.desktop ${CMAKE_CURRENT_BINARY_DIR}/sdrpp.desktop @ONLY)
+ 
+-if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sdrpp.desktop DESTINATION /usr/share/applications)
++if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
++    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sdrpp.desktop DESTINATION share/applications)
+ endif ()
+ 
+ # Create uninstall target
diff --git a/comms/sdr++/files/patch-core_src_core.cpp b/comms/sdr++/files/patch-core_src_core.cpp
new file mode 100644
index 000000000000..aacd2c028a0a
--- /dev/null
+++ b/comms/sdr++/files/patch-core_src_core.cpp
@@ -0,0 +1,16 @@
+- print glewInit() error description
+
+--- core/src/core.cpp.orig	2022-06-23 16:55:03 UTC
++++ core/src/core.cpp
+@@ -383,8 +383,10 @@ int sdrpp_main(int argc, char *argv[]) {
+         free(icons[i].pixels);
+     }
+ 
+-    if (glewInit() != GLEW_OK) {
++    GLenum err = glewInit();
++    if (err != GLEW_OK) {
+         spdlog::error("Failed to initialize OpenGL loader!");
++        spdlog::error(glewGetErrorString(err));
+         return 1;
+     }
+ 
diff --git a/comms/sdr++/pkg-descr b/comms/sdr++/pkg-descr
new file mode 100644
index 000000000000..dd4d4886d639
--- /dev/null
+++ b/comms/sdr++/pkg-descr
@@ -0,0 +1,4 @@
+SDR++ is a cross-platform and open source SDR software with the aim
+of being bloat free and simple to use.
+
+WWW: https://github.com/AlexandreRouma/SDRPlusPlus
diff --git a/comms/sdr++/pkg-plist b/comms/sdr++/pkg-plist
new file mode 100644
index 000000000000..92f3c356cb11
--- /dev/null
+++ b/comms/sdr++/pkg-plist
@@ -0,0 +1,59 @@
+bin/sdrpp
+include/correct-sse.h
+include/correct.h
+lib/libcorrect.a
+lib/libcorrect.so
+lib/libsdrpp_core.so
+lib/sdrpp/plugins/airspy_source.so
+lib/sdrpp/plugins/audio_sink.so
+lib/sdrpp/plugins/discord_integration.so
+lib/sdrpp/plugins/file_source.so
+lib/sdrpp/plugins/frequency_manager.so
+lib/sdrpp/plugins/hackrf_source.so
+lib/sdrpp/plugins/meteor_demodulator.so
+lib/sdrpp/plugins/network_sink.so
+lib/sdrpp/plugins/plutosdr_source.so
+lib/sdrpp/plugins/radio.so
+lib/sdrpp/plugins/recorder.so
+lib/sdrpp/plugins/rigctl_server.so
+lib/sdrpp/plugins/rtl_sdr_source.so
+lib/sdrpp/plugins/rtl_tcp_source.so
+lib/sdrpp/plugins/soapy_source.so
+lib/sdrpp/plugins/spyserver_source.so
+lib/sdrpp/plugins/weather_sat_decoder.so
+share/applications/sdrpp.desktop
+share/sdrpp/bandplans/canada.json
+share/sdrpp/bandplans/china.json
+share/sdrpp/bandplans/france.json
+share/sdrpp/bandplans/general.json
+share/sdrpp/bandplans/germany-mobile-lte-bands.json
+share/sdrpp/bandplans/germany-mobile-networks.json
+share/sdrpp/bandplans/germany.json
+share/sdrpp/bandplans/russia.json
+share/sdrpp/bandplans/usa.json
+share/sdrpp/colormaps/classic.json
+share/sdrpp/colormaps/classic_green.json
+share/sdrpp/colormaps/electric.json
+share/sdrpp/colormaps/gqrx.json
+share/sdrpp/colormaps/greyscale.json
+share/sdrpp/colormaps/inferno.json
+share/sdrpp/colormaps/magma.json
+share/sdrpp/colormaps/plasma.json
+share/sdrpp/colormaps/turbo.json
+share/sdrpp/colormaps/viridis.json
+share/sdrpp/colormaps/websdr.json
+share/sdrpp/fonts/Roboto-Medium.ttf
+share/sdrpp/icons/center_tuning.png
+share/sdrpp/icons/menu.png
+share/sdrpp/icons/muted.png
+share/sdrpp/icons/normal_tuning.png
+share/sdrpp/icons/play.png
+share/sdrpp/icons/sdrpp.ico
+share/sdrpp/icons/sdrpp.png
+share/sdrpp/icons/stop.png
+share/sdrpp/icons/unmuted.png
+share/sdrpp/themes/army green.json
+share/sdrpp/themes/dark.json
+share/sdrpp/themes/deep blue.json
+share/sdrpp/themes/grey.json
+share/sdrpp/themes/light.json