package/pulseview: bump to version 0.4.2
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Thu, 18 Mar 2021 06:33:13 +0000 (07:33 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 20 Mar 2021 21:21:18 +0000 (22:21 +0100)
- Drop first patch (already in version)
- BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS is mandatory since
  https://sigrok.org/gitweb/?p=pulseview.git;a=commit;h=0466001be51e779b23aaebec1cc9361305c07be9

https://github.com/sigrokproject/pulseview/blob/pulseview-0.4.2/NEWS

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/pulseview/0001-Replace-obsolete-deprecated-Qt-methods.patch [new file with mode: 0644]
package/pulseview/0001-mainbar-fix-build-without-libsigrokdecode.patch [deleted file]
package/pulseview/0002-Replace-obsolete-deprecated-Qt-methods.patch [deleted file]
package/pulseview/Config.in
package/pulseview/pulseview.hash
package/pulseview/pulseview.mk

diff --git a/package/pulseview/0001-Replace-obsolete-deprecated-Qt-methods.patch b/package/pulseview/0001-Replace-obsolete-deprecated-Qt-methods.patch
new file mode 100644 (file)
index 0000000..42cdc46
--- /dev/null
@@ -0,0 +1,133 @@
+From caacc9bc622238ca48674ea6f40d07466e4b97a5 Mon Sep 17 00:00:00 2001
+From: Valentin Ochs <a@0au.de>
+Date: Sat, 20 Jun 2020 16:01:27 +0200
+Subject: [PATCH] Replace obsolete/deprecated Qt methods
+
+[Thomas: Backport from upstream commit
+ae726b70a7ada9a4be5808e00f0c951318479684, one conflict manually
+resolved in pv/util.cpp.]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ pv/util.cpp                     | 21 +++++++++++++++++++--
+ pv/util.hpp                     | 10 ++++++++++
+ pv/views/trace/decodetrace.cpp  |  3 ++-
+ pv/views/trace/ruler.cpp        |  2 +-
+ pv/widgets/timestampspinbox.cpp |  2 +-
+ 5 files changed, 33 insertions(+), 5 deletions(-)
+
+diff --git a/pv/util.cpp b/pv/util.cpp
+index 49b9467c..2a63038d 100644
+--- a/pv/util.cpp
++++ b/pv/util.cpp
+@@ -137,7 +137,7 @@ QString format_time_si(const Timestamp& v, SIPrefix prefix,
+       QString s;
+       QTextStream ts(&s);
+       if (sign && !v.is_zero())
+-              ts << forcesign;
++              ts.setNumberFlags(ts.numberFlags() | QTextStream::ForceSign);
+       ts << qSetRealNumberPrecision(precision) << (v * multiplier) << ' '
+               << prefix << unit;
+@@ -171,7 +171,7 @@ QString format_value_si(double v, SIPrefix prefix, unsigned precision,
+       QString s;
+       QTextStream ts(&s);
+       if (sign && (v != 0))
+-              ts << forcesign;
++              ts.setNumberFlags(ts.numberFlags() | QTextStream::ForceSign);
+       ts.setRealNumberNotation(QTextStream::FixedNotation);
+       ts.setRealNumberPrecision(precision);
+       ts << (v * multiplier) << ' ' << prefix << unit;
+@@ -281,5 +281,22 @@ vector<string> split_string(string text, string separator)
+       return result;
+ }
++/**
++ * Return the width of a string in a given font.
++ *
++ * @param[in] metric metrics of the font
++ * @param[in] string the string whose width should be determined
++ *
++ * @return width of the string in pixels
++ */
++std::streamsize text_width(const QFontMetrics &metric, const QString &string)
++{
++#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
++      return metric.horizontalAdvance(string);
++#else
++      return metric.width(string);
++#endif
++}
++
+ } // namespace util
+ } // namespace pv
+diff --git a/pv/util.hpp b/pv/util.hpp
+index dd7be222..ad904f85 100644
+--- a/pv/util.hpp
++++ b/pv/util.hpp
+@@ -30,6 +30,7 @@
+ #include <QMetaType>
+ #include <QString>
++#include <QFontMetrics>
+ using std::string;
+ using std::vector;
+@@ -137,6 +138,15 @@ QString format_time_minutes(const Timestamp& t, signed precision = 0,
+ vector<string> split_string(string text, string separator);
++/**
++ * Return the width of a string in a given font.
++ * @param[in] metric metrics of the font
++ * @param[in] string the string whose width should be determined
++ *
++ * @return width of the string in pixels
++ */
++std::streamsize text_width(const QFontMetrics &metric, const QString &string);
++
+ } // namespace util
+ } // namespace pv
+diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp
+index 9c7196bf..1ee7ae9f 100644
+--- a/pv/views/trace/decodetrace.cpp
++++ b/pv/views/trace/decodetrace.cpp
+@@ -103,7 +103,8 @@ DecodeTrace::DecodeTrace(pv::Session &session,
+       // Determine shortest string we want to see displayed in full
+       QFontMetrics m(QApplication::font());
+-      min_useful_label_width_ = m.width("XX"); // e.g. two hex characters
++      // e.g. two hex characters
++      min_useful_label_width_ = util::text_width(m, "XX");
+       // For the base color, we want to start at a very different color for
+       // every decoder stack, so multiply the index with a number that is
+diff --git a/pv/views/trace/ruler.cpp b/pv/views/trace/ruler.cpp
+index acea8a36..68134966 100644
+--- a/pv/views/trace/ruler.cpp
++++ b/pv/views/trace/ruler.cpp
+@@ -218,7 +218,7 @@ void Ruler::paintEvent(QPaintEvent*)
+               const int rightedge = width();
+               const int x_tick = tick.first;
+               if ((x_tick > leftedge) && (x_tick < rightedge)) {
+-                      const int x_left_bound = QFontMetrics(font()).width(tick.second) / 2;
++                      const int x_left_bound = util::text_width(QFontMetrics(font()), tick.second) / 2;
+                       const int x_right_bound = rightedge - x_left_bound;
+                       const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
+                       p.drawText(x_legend, ValueMargin, 0, text_height,
+diff --git a/pv/widgets/timestampspinbox.cpp b/pv/widgets/timestampspinbox.cpp
+index 21b3d0d7..383aed1f 100644
+--- a/pv/widgets/timestampspinbox.cpp
++++ b/pv/widgets/timestampspinbox.cpp
+@@ -75,7 +75,7 @@ QSize TimestampSpinBox::minimumSizeHint() const
+ {
+       const QFontMetrics fm(fontMetrics());
+       const int l = round(value_).str().size() + precision_ + 10;
+-      const int w = fm.width(QString(l, '0'));
++      const int w = util::text_width(fm, QString(l, '0'));
+       const int h = lineEdit()->minimumSizeHint().height();
+       return QSize(w, h);
+ }
+-- 
+2.26.2
+
diff --git a/package/pulseview/0001-mainbar-fix-build-without-libsigrokdecode.patch b/package/pulseview/0001-mainbar-fix-build-without-libsigrokdecode.patch
deleted file mode 100644 (file)
index 5cf0c44..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From da124df864dd7555733d6690eacf856435d55b2d Mon Sep 17 00:00:00 2001
-From: Bartosz Golaszewski <brgl@bgdev.pl>
-Date: Mon, 3 Dec 2018 13:14:16 +0100
-Subject: [PATCH] mainbar: fix build without libsigrokdecode
-
-We must not include decodesignal.hpp if we're not using libsigrokdecode
-or the build will fail due to libsigrokdecode.hpp not being present in
-the system.
-
-Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
----
- pv/toolbars/mainbar.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp
-index e6beb2b..7c4d0fb 100644
---- a/pv/toolbars/mainbar.cpp
-+++ b/pv/toolbars/mainbar.cpp
-@@ -35,7 +35,6 @@
- #include <boost/algorithm/string/join.hpp>
--#include <pv/data/decodesignal.hpp>
- #include <pv/devicemanager.hpp>
- #include <pv/devices/hardwaredevice.hpp>
- #include <pv/devices/inputfile.hpp>
-@@ -52,6 +51,7 @@
- #include <pv/widgets/importmenu.hpp>
- #ifdef ENABLE_DECODE
- #include <pv/widgets/decodermenu.hpp>
-+#include <pv/data/decodesignal.hpp>
- #endif
- #include <libsigrokcxx/libsigrokcxx.hpp>
--- 
-2.19.1
-
diff --git a/package/pulseview/0002-Replace-obsolete-deprecated-Qt-methods.patch b/package/pulseview/0002-Replace-obsolete-deprecated-Qt-methods.patch
deleted file mode 100644 (file)
index 42cdc46..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-From caacc9bc622238ca48674ea6f40d07466e4b97a5 Mon Sep 17 00:00:00 2001
-From: Valentin Ochs <a@0au.de>
-Date: Sat, 20 Jun 2020 16:01:27 +0200
-Subject: [PATCH] Replace obsolete/deprecated Qt methods
-
-[Thomas: Backport from upstream commit
-ae726b70a7ada9a4be5808e00f0c951318479684, one conflict manually
-resolved in pv/util.cpp.]
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- pv/util.cpp                     | 21 +++++++++++++++++++--
- pv/util.hpp                     | 10 ++++++++++
- pv/views/trace/decodetrace.cpp  |  3 ++-
- pv/views/trace/ruler.cpp        |  2 +-
- pv/widgets/timestampspinbox.cpp |  2 +-
- 5 files changed, 33 insertions(+), 5 deletions(-)
-
-diff --git a/pv/util.cpp b/pv/util.cpp
-index 49b9467c..2a63038d 100644
---- a/pv/util.cpp
-+++ b/pv/util.cpp
-@@ -137,7 +137,7 @@ QString format_time_si(const Timestamp& v, SIPrefix prefix,
-       QString s;
-       QTextStream ts(&s);
-       if (sign && !v.is_zero())
--              ts << forcesign;
-+              ts.setNumberFlags(ts.numberFlags() | QTextStream::ForceSign);
-       ts << qSetRealNumberPrecision(precision) << (v * multiplier) << ' '
-               << prefix << unit;
-@@ -171,7 +171,7 @@ QString format_value_si(double v, SIPrefix prefix, unsigned precision,
-       QString s;
-       QTextStream ts(&s);
-       if (sign && (v != 0))
--              ts << forcesign;
-+              ts.setNumberFlags(ts.numberFlags() | QTextStream::ForceSign);
-       ts.setRealNumberNotation(QTextStream::FixedNotation);
-       ts.setRealNumberPrecision(precision);
-       ts << (v * multiplier) << ' ' << prefix << unit;
-@@ -281,5 +281,22 @@ vector<string> split_string(string text, string separator)
-       return result;
- }
-+/**
-+ * Return the width of a string in a given font.
-+ *
-+ * @param[in] metric metrics of the font
-+ * @param[in] string the string whose width should be determined
-+ *
-+ * @return width of the string in pixels
-+ */
-+std::streamsize text_width(const QFontMetrics &metric, const QString &string)
-+{
-+#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
-+      return metric.horizontalAdvance(string);
-+#else
-+      return metric.width(string);
-+#endif
-+}
-+
- } // namespace util
- } // namespace pv
-diff --git a/pv/util.hpp b/pv/util.hpp
-index dd7be222..ad904f85 100644
---- a/pv/util.hpp
-+++ b/pv/util.hpp
-@@ -30,6 +30,7 @@
- #include <QMetaType>
- #include <QString>
-+#include <QFontMetrics>
- using std::string;
- using std::vector;
-@@ -137,6 +138,15 @@ QString format_time_minutes(const Timestamp& t, signed precision = 0,
- vector<string> split_string(string text, string separator);
-+/**
-+ * Return the width of a string in a given font.
-+ * @param[in] metric metrics of the font
-+ * @param[in] string the string whose width should be determined
-+ *
-+ * @return width of the string in pixels
-+ */
-+std::streamsize text_width(const QFontMetrics &metric, const QString &string);
-+
- } // namespace util
- } // namespace pv
-diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp
-index 9c7196bf..1ee7ae9f 100644
---- a/pv/views/trace/decodetrace.cpp
-+++ b/pv/views/trace/decodetrace.cpp
-@@ -103,7 +103,8 @@ DecodeTrace::DecodeTrace(pv::Session &session,
-       // Determine shortest string we want to see displayed in full
-       QFontMetrics m(QApplication::font());
--      min_useful_label_width_ = m.width("XX"); // e.g. two hex characters
-+      // e.g. two hex characters
-+      min_useful_label_width_ = util::text_width(m, "XX");
-       // For the base color, we want to start at a very different color for
-       // every decoder stack, so multiply the index with a number that is
-diff --git a/pv/views/trace/ruler.cpp b/pv/views/trace/ruler.cpp
-index acea8a36..68134966 100644
---- a/pv/views/trace/ruler.cpp
-+++ b/pv/views/trace/ruler.cpp
-@@ -218,7 +218,7 @@ void Ruler::paintEvent(QPaintEvent*)
-               const int rightedge = width();
-               const int x_tick = tick.first;
-               if ((x_tick > leftedge) && (x_tick < rightedge)) {
--                      const int x_left_bound = QFontMetrics(font()).width(tick.second) / 2;
-+                      const int x_left_bound = util::text_width(QFontMetrics(font()), tick.second) / 2;
-                       const int x_right_bound = rightedge - x_left_bound;
-                       const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
-                       p.drawText(x_legend, ValueMargin, 0, text_height,
-diff --git a/pv/widgets/timestampspinbox.cpp b/pv/widgets/timestampspinbox.cpp
-index 21b3d0d7..383aed1f 100644
---- a/pv/widgets/timestampspinbox.cpp
-+++ b/pv/widgets/timestampspinbox.cpp
-@@ -75,7 +75,7 @@ QSize TimestampSpinBox::minimumSizeHint() const
- {
-       const QFontMetrics fm(fontMetrics());
-       const int l = round(value_).str().size() + precision_ + 10;
--      const int w = fm.width(QString(l, '0'));
-+      const int w = util::text_width(fm, QString(l, '0'));
-       const int h = lineEdit()->minimumSizeHint().height();
-       return QSize(w, h);
- }
--- 
-2.26.2
-
index ea9bdc2605161b21ea3898bf26904f04540488a6..b8d94332a315554337135bf01f7f53c30c443649 100644 (file)
@@ -17,6 +17,8 @@ config BR2_PACKAGE_PULSEVIEW
        select BR2_PACKAGE_QT5BASE_WIDGETS
        select BR2_PACKAGE_QT5BASE_PNG
        select BR2_PACKAGE_QT5SVG
+       select BR2_PACKAGE_QT5TOOLS
+       select BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS
        select BR2_PACKAGE_BOOST
        select BR2_PACKAGE_BOOST_FILESYSTEM
        select BR2_PACKAGE_BOOST_SYSTEM
index 27e27ce1ce18d651e946f5958e1cc245d75c6a8a..b72000774beb3729f41186b6d48d5306d02eedce 100644 (file)
@@ -1,3 +1,3 @@
 # Locally computed
-sha256  9ee7ce3dd1457c6a5f5e4e9c2469903a1f070ba077ea68535cc29ef1dfac6f2f  pulseview-0.4.1.tar.gz
+sha256  f042f77a3e1b35bf30666330e36ec38fab8d248c3693c37b7e35d401c3bfabcb  pulseview-0.4.2.tar.gz
 sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
index 67d525f626301d868a756c3d8988f471fb99e0c0..f079dfbbcec9106fd60b6313a87a46346141d8f2 100644 (file)
@@ -4,11 +4,11 @@
 #
 ################################################################################
 
-PULSEVIEW_VERSION = 0.4.1
+PULSEVIEW_VERSION = 0.4.2
 PULSEVIEW_SITE = http://sigrok.org/download/source/pulseview
 PULSEVIEW_LICENSE = GPL-3.0+
 PULSEVIEW_LICENSE_FILES = COPYING
-PULSEVIEW_DEPENDENCIES = libsigrok qt5base qt5svg boost
+PULSEVIEW_DEPENDENCIES = libsigrok qt5base qt5svg qt5tools boost
 PULSEVIEW_CONF_OPTS = -DDISABLE_WERROR=TRUE
 
 ifeq ($(BR2_PACKAGE_BOOST_TEST),y)