File sdrpp.spec of Package sdrpp

#
# spec file for package sdrpp
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2020-2021, 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/
#


Name:           sdrpp
Version:        1.1.0~20240122.eab4264
Release:        0
Summary:        A cross-platform SDR software
License:        GPL-3.0-or-later
Group:          Productivity/Hamradio/Other
URL:            https://github.com/AlexandreRouma/SDRPlusPlus
Source:         SDRPlusPlus-%{version}.tar.xz
Patch1:         sdrpp-libcorrect.patch
Patch2:         sdrpp-discord.patch
Patch3:         sdrpp-libdir.patch
Patch4:         glfw-includes.patch
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  libcorrect-devel
BuildRequires:  pkgconfig
BuildRequires:  unzip
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(LimeSuite)
BuildRequires:  pkgconfig(SoapySDR)
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(glfw3)
BuildRequires:  pkgconfig(libad9361)
BuildRequires:  pkgconfig(libairspy)
BuildRequires:  pkgconfig(libairspyhf)
BuildRequires:  pkgconfig(libbladeRF)
BuildRequires:  pkgconfig(libhackrf)
BuildRequires:  pkgconfig(libiio)
BuildRequires:  pkgconfig(librtlsdr)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(rtaudio)
BuildRequires:  pkgconfig(volk)
BuildRequires:  sdrplay_api-devel
Requires:       google-roboto-fonts
%if 0%{?suse_version} == 1500
BuildRequires:  gcc8-c++
%else
BuildRequires:  gcc-c++
%endif

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

%package devel
Summary:        Files needed to build plugins for %{name}
Group:          Productivity/Hamradio/Other

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

This packages contains include files and library to build
third party plugins for %{name}

%prep
%setup -q -n SDRPlusPlus-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

# Install plugins to _lib
grep -rl 'lib/sdrpp/plugins' . | xargs sed -i -e 's:lib/sdrpp/plugins:%{_lib}/sdrpp/plugins:g'

%build
%if 0%{?suse_version} == 1500
export CC="gcc-8"
export CXX="g++-8"
%endif
%cmake \
  -DCMAKE_SHARED_LINKER_FLAGS="" \
  -DOPT_BUILD_AIRSPYHF_SOURCE=ON \
  -DOPT_BUILD_LIMESDR_SOURCE=ON \
  -DOPT_BUILD_BLADERF_SOURCE=ON \
  -DOPT_BUILD_PLUTOSDR_SOURCE=ON \
  -DOPT_BUILD_SPYSERVER_SOURCE=ON \
  -DOPT_BUILD_SDRPLAY_SOURCE=ON \
  -DUSE_INTERNAL_LIBCORRECT=OFF
%make_jobs

%install
%cmake_install
install -D -m0644 root/res/icons/sdrpp.png %{buildroot}/%{_datadir}/pixmaps/sdrpp.png
%suse_update_desktop_file %{name} "SDR++ - Software Defined Radio" %{name} %{name} Network
%fdupes -s %{buildroot}/%{_datadir}
install -dm 0755 %{buildroot}%{_includedir}/sdrpp_core
(cd core/src && find . -regex ".*\.\(h\|hpp\)" -exec cp --parents \{\} "%{buildroot}%{_includedir}/sdrpp_core" \;)

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

%files
%license license misc_modules/discord_integration/discord-rpc/LICENSE
%doc readme.md
%{_bindir}/sdrpp
%dir %{_libdir}/sdrpp
%{_libdir}/sdrpp/plugins
%{_libdir}/libsdrpp_core.so.*
%{_datadir}/sdrpp
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%files devel
%license license
%doc contributing.md
%{_includedir}/sdrpp_core
%{_libdir}/libsdrpp_core.so

%changelog
openSUSE Build Service is sponsored by