Unbreak with newer boost.

from Brad
This commit is contained in:
ajacoutot 2021-09-05 08:13:33 +00:00
parent dc9e33e983
commit 5b908bb0a0
7 changed files with 173 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.11 2021/03/19 17:06:35 sthen Exp $
# $OpenBSD: Makefile,v 1.12 2021/09/05 08:13:33 ajacoutot Exp $
BROKEN-i386 = frequent cmake-related build failures
# INSTALL stage looks for libgnuradio-runtime.so.3.8.2.0 but the file is
@ -8,7 +8,7 @@ COMMENT = signal-processing toolkit for SDR (software-defined radio)
V = 3.8.2.0
DISTNAME = gnuradio-$V
REVISION = 2
REVISION = 3
SHARED_LIBS += gnuradio-analog 0.0 # 3.7
SHARED_LIBS += gnuradio-atsc 0.0 # 3.7

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-gnuradio-runtime_include_gnuradio_CMakeLists_txt,v 1.1 2021/09/05 08:13:33 ajacoutot Exp $
[PATCH] boost: remove deprecated math/common_factor.hpp
2c767bb260a25b415e8c9c4b3ea37280b2127cec
Index: gnuradio-runtime/include/gnuradio/CMakeLists.txt
--- gnuradio-runtime/include/gnuradio/CMakeLists.txt.orig
+++ gnuradio-runtime/include/gnuradio/CMakeLists.txt
@@ -43,6 +43,7 @@ install(FILES
gr_complex.h
hier_block2.h
high_res_timer.h
+ integer_math.h
io_signature.h
logger.h
math.h

View File

@ -0,0 +1,45 @@
$OpenBSD: patch-gnuradio-runtime_include_gnuradio_integer_math_h,v 1.1 2021/09/05 08:13:33 ajacoutot Exp $
[PATCH] boost: remove deprecated math/common_factor.hpp
2c767bb260a25b415e8c9c4b3ea37280b2127cec
Index: gnuradio-runtime/include/gnuradio/integer_math.h
--- gnuradio-runtime/include/gnuradio/integer_math.h.orig
+++ gnuradio-runtime/include/gnuradio/integer_math.h
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+#ifndef INCLUDED_GR_INTEGER_MATH_H
+#define INCLUDED_GR_INTEGER_MATH_H
+
+#if (__cplusplus >= 201703L)
+
+// Prefer C++17 goodness.
+#include <numeric>
+#define GR_GCD std::gcd
+#define GR_LCM std::lcm
+
+#elif (BOOST_VERSION >= 105800)
+
+// Fallback: newer boost API (introduced in Boost 1.58.0).
+#include <boost/integer/common_factor_rt.hpp>
+#define GR_GCD boost::integer::gcd
+#define GR_LCM boost::integer::lcm
+
+#else
+
+// Last resort: old deprecated boost API.
+#include <boost/math/common_factor_rt.hpp>
+#define GR_GCD boost::math::gcd
+#define GR_LCM boost::math::lcm
+
+#endif /* __cplusplus >= 201703L */
+#endif /* INCLUDED_GR_INTEGER_MATH_H */

View File

@ -0,0 +1,49 @@
$OpenBSD: patch-gnuradio-runtime_lib_buffer_cc,v 1.1 2021/09/05 08:13:33 ajacoutot Exp $
[PATCH] boost: remove deprecated math/common_factor.hpp
2c767bb260a25b415e8c9c4b3ea37280b2127cec
Index: gnuradio-runtime/lib/buffer.cc
--- gnuradio-runtime/lib/buffer.cc.orig
+++ gnuradio-runtime/lib/buffer.cc
@@ -25,22 +25,13 @@
#endif
#include "vmcircbuf.h"
#include <gnuradio/buffer.h>
+#include <gnuradio/integer_math.h>
#include <gnuradio/math.h>
#include <assert.h>
#include <algorithm>
#include <iostream>
#include <stdexcept>
-// the following header is deprecated as of Boost 1.66.0, and the
-// other API was introduced in Boost 1.58.0. Since we still support
-// Boost back to 1.54.0, use the older API if pre-1.5.80 and otherwise
-// use the newer API.
-#if (BOOST_VERSION < 105800)
-#include <boost/math/common_factor_rt.hpp>
-#else
-#include <boost/integer/common_factor_rt.hpp>
-#endif
-
namespace gr {
static long s_buffer_count = 0; // counts for debugging storage mgmt
@@ -80,13 +71,9 @@ static long s_buffer_reader_count = 0;
*
* type_size * nitems == k * page_size
*/
-static long minimum_buffer_items(long type_size, long page_size)
+static inline long minimum_buffer_items(long type_size, long page_size)
{
-#if (BOOST_VERSION < 105800)
- return page_size / boost::math::gcd(type_size, page_size);
-#else
- return page_size / boost::integer::gcd(type_size, page_size);
-#endif
+ return page_size / GR_GCD(type_size, page_size);
}

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-gr-digital_lib_symbol_sync_cc_impl_cc,v 1.1 2021/09/05 08:13:33 ajacoutot Exp $
[PATCH] boost: remove deprecated math/common_factor.hpp
2c767bb260a25b415e8c9c4b3ea37280b2127cec
Index: gr-digital/lib/symbol_sync_cc_impl.cc
--- gr-digital/lib/symbol_sync_cc_impl.cc.orig
+++ gr-digital/lib/symbol_sync_cc_impl.cc
@@ -25,9 +25,9 @@
#endif
#include "symbol_sync_cc_impl.h"
+#include <gnuradio/integer_math.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/math.h>
-#include <boost/math/common_factor.hpp>
#include <stdexcept>
namespace gr {
@@ -116,7 +116,7 @@ symbol_sync_cc_impl::symbol_sync_cc_impl(enum ted_type
throw std::runtime_error("unable to create interpolating_resampler_ccf");
// Block Internal Clocks
- d_interps_per_symbol_n = boost::math::lcm(d_ted->inputs_per_symbol(), d_osps_n);
+ d_interps_per_symbol_n = GR_LCM(d_ted->inputs_per_symbol(), d_osps_n);
d_interps_per_ted_input_n = d_interps_per_symbol_n / d_ted->inputs_per_symbol();
d_interps_per_output_sample_n = d_interps_per_symbol_n / d_osps_n;

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-gr-digital_lib_symbol_sync_ff_impl_cc,v 1.1 2021/09/05 08:13:33 ajacoutot Exp $
[PATCH] boost: remove deprecated math/common_factor.hpp
2c767bb260a25b415e8c9c4b3ea37280b2127cec
Index: gr-digital/lib/symbol_sync_ff_impl.cc
--- gr-digital/lib/symbol_sync_ff_impl.cc.orig
+++ gr-digital/lib/symbol_sync_ff_impl.cc
@@ -25,9 +25,9 @@
#endif
#include "symbol_sync_ff_impl.h"
+#include <gnuradio/integer_math.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/math.h>
-#include <boost/math/common_factor.hpp>
#include <stdexcept>
namespace gr {
@@ -116,7 +116,7 @@ symbol_sync_ff_impl::symbol_sync_ff_impl(enum ted_type
throw std::runtime_error("unable to create interpolating_resampler_fff");
// Block Internal Clocks
- d_interps_per_symbol_n = boost::math::lcm(d_ted->inputs_per_symbol(), d_osps_n);
+ d_interps_per_symbol_n = GR_LCM(d_ted->inputs_per_symbol(), d_osps_n);
d_interps_per_ted_input_n = d_interps_per_symbol_n / d_ted->inputs_per_symbol();
d_interps_per_output_sample_n = d_interps_per_symbol_n / d_osps_n;

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.3 2020/10/13 09:04:51 bentley Exp $
@comment $OpenBSD: PLIST,v 1.4 2021/09/05 08:13:33 ajacoutot Exp $
bin/gnuradio-companion
@bin bin/gnuradio-config-info
bin/gr-ctrlport-monitor
@ -494,6 +494,7 @@ include/gnuradio/fxpt_vco.h
include/gnuradio/gr_complex.h
include/gnuradio/hier_block2.h
include/gnuradio/high_res_timer.h
include/gnuradio/integer_math.h
include/gnuradio/io_signature.h
include/gnuradio/logger.h
include/gnuradio/math.h