SHA256
1
0
forked from pool/gnuradio

Accepting request 613006 from hardware:sdr

OBS-URL: https://build.opensuse.org/request/show/613006
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gnuradio?expand=0&rev=26
This commit is contained in:
Dominique Leuenberger 2018-06-02 10:09:08 +00:00 committed by Git OBS Bridge
commit e671dde0c6
5 changed files with 139 additions and 13 deletions

View File

@ -1,7 +0,0 @@
<constraints>
<hardware>
<memory>
<size unit="G">4</size>
</memory>
</hardware>
</constraints>

48
boost_161.patch Normal file
View File

@ -0,0 +1,48 @@
Index: gnuradio-3.7.12.0/gr-blocks/lib/message_strobe_impl.cc
===================================================================
--- gnuradio-3.7.12.0.orig/gr-blocks/lib/message_strobe_impl.cc
+++ gnuradio-3.7.12.0/gr-blocks/lib/message_strobe_impl.cc
@@ -91,7 +91,7 @@ namespace gr {
void message_strobe_impl::run()
{
while(!d_finished) {
- boost::this_thread::sleep(boost::posix_time::milliseconds(d_period_ms));
+ boost::this_thread::sleep(boost::posix_time::microseconds(static_cast<long>(d_period_ms * 1000)));
if(d_finished) {
return;
}
Index: gnuradio-3.7.12.0/gr-uhd/lib/usrp_block_impl.cc
===================================================================
--- gnuradio-3.7.12.0.orig/gr-uhd/lib/usrp_block_impl.cc
+++ gnuradio-3.7.12.0/gr-uhd/lib/usrp_block_impl.cc
@@ -196,7 +196,7 @@ bool usrp_block_impl::_wait_for_locked_s
while (true) {
if ((not first_lock_time.is_not_a_date_time()) and
- (boost::get_system_time() > (first_lock_time + boost::posix_time::seconds(LOCK_TIMEOUT)))) {
+ (boost::get_system_time() > (first_lock_time + boost::posix_time::milliseconds(static_cast<long>(1000*LOCK_TIMEOUT))))) {
break;
}
@@ -207,7 +207,7 @@ bool usrp_block_impl::_wait_for_locked_s
else {
first_lock_time = boost::system_time(); //reset to 'not a date time'
- if (boost::get_system_time() > (start + boost::posix_time::seconds(LOCK_TIMEOUT))){
+ if (boost::get_system_time() > (start + boost::posix_time::milliseconds(static_cast<long>(1000*LOCK_TIMEOUT)))){
return false;
}
}
Index: gnuradio-3.7.12.0/gr-blocks/lib/message_strobe_random_impl.cc
===================================================================
--- gnuradio-3.7.12.0.orig/gr-blocks/lib/message_strobe_random_impl.cc
+++ gnuradio-3.7.12.0/gr-blocks/lib/message_strobe_random_impl.cc
@@ -110,7 +110,7 @@ namespace gr {
void message_strobe_random_impl::run()
{
while(!d_finished) {
- boost::this_thread::sleep(boost::posix_time::milliseconds(std::max(0.0f,next_delay())));
+ boost::this_thread::sleep(boost::posix_time::microseconds(std::max(0L,static_cast<long>(next_delay()))));
if(d_finished) {
return;
}

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue May 29 09:56:10 UTC 2018 - adam.majer@suse.de
- boost_161.patch: fix compilation with Boost 1.67 (bsc#1089806)
- missing_library.patch: hack to fix linking with required
libraries.
- use memory-constraints package instead of _constraints
-------------------------------------------------------------------
Mon Apr 2 22:28:38 UTC 2018 - mardnh@gmx.de

View File

@ -1,7 +1,7 @@
#
# spec file for package gnuradio
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -23,7 +23,7 @@ Name: gnuradio
Version: 3.7.12.0
Release: 0
Summary: GNU software radio
License: GPL-3.0+
License: GPL-3.0-or-later
Group: Productivity/Hamradio/Other
URL: http://gnuradio.org
Source: https://github.com/gnuradio/gnuradio/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
@ -31,6 +31,8 @@ Source1: https://github.com/gnuradio/volk/archive/v%{volk_version}.tar.gz
# http://www.nathanwest.us/grc_to_37.sh
Source2: grc_to_37.sh
Source99: %{name}-rpmlintrc
Patch1: boost_161.patch
Patch2: missing_library.patch
BuildRequires: alsa-devel
BuildRequires: boost-devel
BuildRequires: cmake
@ -43,6 +45,7 @@ BuildRequires: gsl-devel
BuildRequires: libSDL-devel
BuildRequires: libjack-devel
BuildRequires: libxslt-python
BuildRequires: memory-constraints
BuildRequires: orc
BuildRequires: pkgconfig
BuildRequires: portaudio-devel
@ -190,14 +193,17 @@ This package contains the examples of using GNU Radio depending on wxWidgets.
%prep
%setup -q
tar xzf %{SOURCE1} -C volk/ --strip-components=1
%patch1 -p1
%patch2 -p1
# remove buildtime from documentation
sed -i 's|^HTML_TIMESTAMP = YES|HTML_TIMESTAMP = NO|' docs/doxygen/Doxyfile.in
sed -i 's|^HTML_TIMESTAMP = YES|HTML_TIMESTAMP = NO|' docs/doxygen/Doxyfile.swig_doc.in
%build
%cmake \
-DCMAKE_SHARED_LINKER_FLAGS=""
make -j2
%limit_build -m 2000
%cmake
# -DCMAKE_SHARED_LINKER_FLAGS=""
%make_jobs
%install
%cmake_install
@ -245,7 +251,7 @@ rm -rf %{buildroot}%{_prefix}/libexec
%files
%defattr(-,root,root,-)
%doc COPYING
%license COPYING
%{_bindir}/*
%dir %{_datadir}/gnuradio
%{_datadir}/gnuradio/grc/

71
missing_library.patch Normal file
View File

@ -0,0 +1,71 @@
Index: gnuradio-3.7.12.0/gr-uhd/gnuradio-uhd.pc.in
===================================================================
--- gnuradio-3.7.12.0.orig/gr-uhd/gnuradio-uhd.pc.in
+++ gnuradio-3.7.12.0/gr-uhd/gnuradio-uhd.pc.in
@@ -7,5 +7,5 @@ Name: gnuradio-uhd
Description: GNU Radio blocks for UHD
Requires: gnuradio-runtime
Version: @LIBVER@
-Libs: -L${libdir} -lgnuradio-uhd
+Libs: -L${libdir} -lgnuradio-uhd -lpthread
Cflags: -I${includedir}
Index: gnuradio-3.7.12.0/gr-uhd/examples/c++/CMakeLists.txt
===================================================================
--- gnuradio-3.7.12.0.orig/gr-uhd/examples/c++/CMakeLists.txt
+++ gnuradio-3.7.12.0/gr-uhd/examples/c++/CMakeLists.txt
@@ -31,11 +31,14 @@ include_directories(
link_directories(${UHD_LIBRARY_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+
########################################################################
# Build executable
########################################################################
add_executable(tags_demo tags_demo.cc)
-target_link_libraries(tags_demo gnuradio-uhd)
+target_link_libraries(tags_demo gnuradio-uhd Threads::Threads)
INSTALL(TARGETS
tags_demo
Index: gnuradio-3.7.12.0/volk/lib/CMakeLists.txt
===================================================================
--- gnuradio-3.7.12.0.orig/volk/lib/CMakeLists.txt
+++ gnuradio-3.7.12.0/volk/lib/CMakeLists.txt
@@ -532,7 +532,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.11
#Add dynamic library
add_library(volk SHARED $<TARGET_OBJECTS:volk_obj>)
- target_link_libraries(volk ${volk_libraries})
+ target_link_libraries(volk ${volk_libraries} "m")
target_include_directories(volk
PUBLIC ${PROJECT_BINARY_DIR}/include
PUBLIC ${PROJECT_SOURCE_DIR}/include
@@ -574,7 +574,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.11
else()
#create the volk runtime library
add_library(volk SHARED ${volk_sources})
- target_link_libraries(volk ${volk_libraries})
+ target_link_libraries(volk ${volk_libraries} "m")
include_directories(volk
PUBLIC ${PROJECT_BINARY_DIR}/include
PUBLIC ${PROJECT_SOURCE_DIR}/include
Index: gnuradio-3.7.12.0/gnuradio-runtime/lib/pmt/CMakeLists.txt
===================================================================
--- gnuradio-3.7.12.0.orig/gnuradio-runtime/lib/pmt/CMakeLists.txt
+++ gnuradio-3.7.12.0/gnuradio-runtime/lib/pmt/CMakeLists.txt
@@ -81,9 +81,13 @@ set(pmt_sources
${CMAKE_CURRENT_SOURCE_DIR}/pmt_serialize.cc
)
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+
list(APPEND gnuradio_pmt_libs
${Boost_LIBRARIES}
${LOG4CPP_LIBRARIES}
+ Threads::Threads
)
add_custom_target(pmt_generated