File sdrpp-git.spec of Package sdrpp-git

#
# spec file for package sdrpp-git
#
# Copyright (c) 2020-2023, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

# tetra_demod is enabled by default
# use "osc build --without tetra_demod" to build without this 3rd-party plugin
#
# !!! temporary disabled since plugin is not up to date
#%%bcond_without tetra_demod
#

Name:           sdrpp-git
Version:        1.1.0+git20231029
Release:        0
Summary:        A cross-platform SDR software
License:        GPL-3.0-or-later
Group:          Productivity/Hamradio/Other
URL:            https://github.com/AlexandreRouma/SDRPlusPlus
#Git-Clone:     https://github.com/AlexandreRouma/SDRPlusPlus.git
Source:         SDRPlusPlus-%{version}.tar.xz
%if 0%{with tetra_demod}
Source1:        https://github.com/cropinghigh/sdrpp-tetra-demodulator/archive/refs/heads/master.zip
Patch1:         sdrpp-tetra-demodulator-cmake.patch
%endif
Patch3:         fix-build.patch
BuildRequires:  cmake
BuildRequires:  fdupes
%if 0%{?suse_version} == 1500
BuildRequires:  gcc8-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  libcorrect-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(SoapySDR)
BuildRequires:  pkgconfig(LimeSuite)
BuildRequires:  pkgconfig(libairspy)
BuildRequires:  pkgconfig(libairspyhf)
BuildRequires:  pkgconfig(libairspyhf)
BuildRequires:  pkgconfig(libbladeRF)
BuildRequires:  pkgconfig(librtlsdr)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(libhackrf)
BuildRequires:  pkgconfig(libiio)
BuildRequires:  pkgconfig(libad9361)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(rtaudio)
BuildRequires:  pkgconfig(uhd)
# FIXME: BR boost_system (linker error without it)
#       seems do be an indirect dependency via uhd !?!
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_system-devel
%else
BuildRequires:  boost-devel
%endif
# /HACK
BuildRequires:  pkgconfig(volk)
BuildRequires:  pkgconfig(xxf86vm)
BuildRequires:  unzip
Requires:       google-roboto-fonts
Recommends:     soapysdr0.8-module-rtlsdr
Conflicts:      sdrpp

%description
SDR++ is a cross-platform and open source SDR software.

%prep
%setup -q -n SDRPlusPlus-%{version}
# tetra_demod
%if 0%{with tetra_demod}
unzip %{SOURCE1}
mv -v sdrpp-tetra-demodulator-master decoder_modules/tetra_demodulator
%patch1 -p1
%endif
# /tetra-demod
#%%patch2 -p1
%patch3 -p1

%build
%if 0%{?suse_version} == 1500
export CC="gcc-8"
export CXX="g++-8"
%endif
### !!!!!
### !!!!!
### OPT_BUILD_WEATHER_SAT_DECODER does not build yet with pre 1.5 git 
#[ 86%] Building CXX object decoder_modules/weather_sat_decoder/CMakeFiles/weather_sat_decoder.dir/src/main.cpp.o
#/home/mhauke/tmp/SDRPlusPlus/decoder_modules/weather_sat_decoder/src/main.cpp:9:10: schwerwiegender Fehler: dsp/pll.h: Datei oder Verzeichnis nicht gefunden
#    9 | #include <dsp/pll.h>
%cmake \
  -DCMAKE_SHARED_LINKER_FLAGS="" \
  -DUSE_INTERNAL_LIBCORRECT=OFF \
  -DOPT_BUILD_AIRSPYHF_SOURCE=ON \
  -DOPT_BUILD_LIMESDR_SOURCE=ON \
  -DOPT_BUILD_BLADERF_SOURCE=ON \
  -DOPT_BUILD_PLUTOSDR_SOURCE=ON \
  -DOPT_BUILD_USRP_SOURCE=ON \
  -DOPT_BUILD_WEATHER_SAT_DECODER=OFF \
  -DOPT_BUILD_SPYSERVER_SOURCE=ON
%make_jobs

%install
%cmake_install
install -D -m0644 root/res/icons/sdrpp.png %{buildroot}/%{_datadir}/pixmaps/sdrpp.png
%suse_update_desktop_file -c sdrpp sdrpp "SDR++ - Software Defined Radio" sdrpp sdrpp Network HamRadio
%fdupes -s %{buildroot}/%{_datadir}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license license
%doc readme.md
%{_bindir}/sdrpp
%dir %{_prefix}/lib/sdrpp
%{_prefix}/lib/sdrpp/plugins
%{_prefix}/lib/libsdrpp_core.so
%{_datadir}/sdrpp
%{_datadir}/applications/sdrpp.desktop
%{_datadir}/pixmaps/sdrpp.png

%changelog
openSUSE Build Service is sponsored by