mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-25 20:57:12 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
From 01de3217e14b52e44356185729f804460147c85c 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>
|
||||
[Fabrice: restore original patch in pv/util.cpp for 0.4.2]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Dario: make the patch to be applied with fuzz factor 0]
|
||||
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.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 9a9a5065a2e1..b0c29f304287 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);
|
||||
ts << ' ' << prefix << unit;
|
||||
|
||||
@@ -175,7 +175,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;
|
||||
@@ -285,5 +285,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 e1640c4a374d..a6cdfdcad4d9 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;
|
||||
@@ -138,6 +139,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 1cc89feb67ae..0347b3327b27 100644
|
||||
--- a/pv/views/trace/decodetrace.cpp
|
||||
+++ b/pv/views/trace/decodetrace.cpp
|
||||
@@ -164,7 +164,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");
|
||||
|
||||
default_row_height_ = (ViewItemPaintParams::text_height() * 6) / 4;
|
||||
annotation_height_ = (ViewItemPaintParams::text_height() * 5) / 4;
|
||||
diff --git a/pv/views/trace/ruler.cpp b/pv/views/trace/ruler.cpp
|
||||
index 555794fc42c6..83ffed281b5f 100644
|
||||
--- a/pv/views/trace/ruler.cpp
|
||||
+++ b/pv/views/trace/ruler.cpp
|
||||
@@ -283,7 +283,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 fea8175e8e00..01424a5b7837 100644
|
||||
--- a/pv/widgets/timestampspinbox.cpp
|
||||
+++ b/pv/widgets/timestampspinbox.cpp
|
||||
@@ -76,7 +76,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.43.0
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From ed643f0b4ac587204a5243451cda181ee1405d62 Mon Sep 17 00:00:00 2001
|
||||
From: =?utf8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||||
Date: Wed, 28 Apr 2021 02:14:47 +0200
|
||||
Subject: [PATCH] Fix broken build due to C++ template behind C linkage
|
||||
|
||||
glib/gatomic.h since 2.68 includes type_traits, which causes a compilation
|
||||
error:
|
||||
In file included from /usr/include/glib-2.0/glib/gatomic.h:31,
|
||||
from /usr/include/glib-2.0/glib/gthread.h:32,
|
||||
from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
|
||||
from /usr/include/glib-2.0/glib.h:32,
|
||||
from /usr/include/libsigrokdecode/libsigrokdecode.h:25,
|
||||
from /home/abuild/rpmbuild/BUILD/pulseview-0.4.2/pv/data/decode/annotation.cpp:21:
|
||||
/usr/include/c++/10/type_traits:2308:3: error: template with C linkage
|
||||
2308 | template<typename _CTp, typename _Rp>
|
||||
|
||||
As libsigrokdecode.h declares extern C linkage itself where necessary,
|
||||
remove it from pulseviews include statements from the last two occasions.
|
||||
|
||||
[Retrieved from:
|
||||
https://sigrok.org/gitweb/?p=pulseview.git;a=commit;h=ed643f0b4ac587204a5243451cda181ee1405d62]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
pv/data/decode/annotation.cpp | 2 --
|
||||
pv/views/trace/decodetrace.cpp | 2 --
|
||||
2 files changed, 4 deletions(-)
|
||||
|
||||
diff --git a/pv/data/decode/annotation.cpp b/pv/data/decode/annotation.cpp
|
||||
index 7f233478..f8a5c47b 100644
|
||||
--- a/pv/data/decode/annotation.cpp
|
||||
+++ b/pv/data/decode/annotation.cpp
|
||||
@@ -17,9 +17,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
-extern "C" {
|
||||
#include <libsigrokdecode/libsigrokdecode.h>
|
||||
-}
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
diff --git a/pv/views/trace/decodetrace.cpp b/pv/views/trace/decodetrace.cpp
|
||||
index 409f1d28..888064d0 100644
|
||||
--- a/pv/views/trace/decodetrace.cpp
|
||||
+++ b/pv/views/trace/decodetrace.cpp
|
||||
@@ -17,9 +17,7 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
-extern "C" {
|
||||
#include <libsigrokdecode/libsigrokdecode.h>
|
||||
-}
|
||||
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
--
|
||||
2.24.0.rc2
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From cbdd970fa4a805cefcad2e692df204bfceb46e16 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Thu, 30 Dec 2021 16:19:46 +0100
|
||||
Subject: [PATCH] Support glibmm 2.68
|
||||
|
||||
Support glibmm 2.68 which has been released one year ago and is the
|
||||
first stable release in the glibmm-2.68 ABI series:
|
||||
https://gitlab.gnome.org/GNOME/glibmm/-/blob/2.68.2/NEWS
|
||||
|
||||
C++17 support is mandatory with glibmm 2.68
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Upstream: not sent yet
|
||||
[Dario: make the patch to be applied with fuzz factor 0]
|
||||
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
---
|
||||
CMakeLists.txt | 23 +++++++++++++++++++----
|
||||
INSTALL | 2 +-
|
||||
2 files changed, 20 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c29fa283bcb6..e739d5fccaa7 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -75,7 +75,14 @@ add_subdirectory(manual)
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
list(APPEND PKGDEPS glib-2.0>=2.28.0)
|
||||
-list(APPEND PKGDEPS glibmm-2.4>=2.28.0)
|
||||
+
|
||||
+set(LIBSR_GLIBMM "glibmm-2.4>=2.28.0")
|
||||
+find_package(PkgConfig)
|
||||
+pkg_check_modules(LIBSRGLIBMM24 ${LIBSR_GLIBMM})
|
||||
+if(NOT LIBSRGLIBMM24_FOUND)
|
||||
+ set(LIBSR_GLIBMM "glibmm-2.68>=2.68.0")
|
||||
+endif()
|
||||
+list(APPEND PKGDEPS ${LIBSR_GLIBMM})
|
||||
|
||||
if(ENABLE_FLOW)
|
||||
list(APPEND PKGDEPS gstreamermm-1.0>=1.8.0)
|
||||
@@ -93,7 +100,6 @@ if(ANDROID)
|
||||
list(APPEND PKGDEPS libsigrokandroidutils>=0.1.0)
|
||||
endif()
|
||||
|
||||
-find_package(PkgConfig)
|
||||
pkg_check_modules(LIBSRCXX ${LIBSR_CXX_BINDING})
|
||||
if(NOT LIBSRCXX_FOUND OR NOT LIBSRCXX_VERSION)
|
||||
message(FATAL_ERROR "libsigrok C++ bindings missing, check libsigrok's 'configure' output (missing dependencies?)")
|
||||
@@ -194,7 +200,11 @@ memaccess_check_unaligned_le(HAVE_UNALIGNED_LITTLE_ENDIAN_ACCESS)
|
||||
set(PV_TITLE PulseView)
|
||||
set(PV_VERSION_STRING "0.4.2")
|
||||
|
||||
-set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION})
|
||||
+if(LIBSRGLIBMM24_FOUND)
|
||||
+ set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.4_VERSION})
|
||||
+else()
|
||||
+ set(PV_GLIBMM_VERSION ${PKGDEPS_glibmm-2.68_VERSION})
|
||||
+endif()
|
||||
|
||||
include(GetGitRevisionDescription)
|
||||
|
||||
@@ -445,7 +455,12 @@ qt5_add_resources(pulseview_RESOURCES_RCC ${CMAKE_BINARY_DIR}/translations.qrc)
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
add_definitions(-D__STDC_LIMIT_MACROS)
|
||||
add_definitions(-Wall -Wextra)
|
||||
-add_definitions(-std=c++11)
|
||||
+if(LIBSRGLIBMM24_FOUND)
|
||||
+ add_definitions(-std=c++11)
|
||||
+else()
|
||||
+ # glibmm-2.68 reuires c++17
|
||||
+ add_definitions(-std=c++17)
|
||||
+endif()
|
||||
add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1)
|
||||
|
||||
if(ENABLE_FLOW)
|
||||
diff --git a/INSTALL b/INSTALL
|
||||
index d666f0a7f824..ecf984f3c4b4 100644
|
||||
--- a/INSTALL
|
||||
+++ b/INSTALL
|
||||
@@ -14,7 +14,7 @@ Requirements
|
||||
- pkg-config >= 0.22
|
||||
- cmake >= 2.8.12
|
||||
- libglib >= 2.28.0
|
||||
- - glibmm-2.4 (>= 2.28.0)
|
||||
+ - glibmm-2.4 (>= 2.28.0) or glibmm-2.68 (>= 2.68.0)
|
||||
- Qt5 (>= 5.3), including the following components:
|
||||
- Qt5Core, Qt5Gui, Qt5Widgets, Qt5Svg, Qt5LinguistTools
|
||||
- Qt translation package (optional; needed at runtime, not build time)
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
config BR2_PACKAGE_PULSEVIEW
|
||||
bool "pulseview"
|
||||
depends on BR2_PACKAGE_QT5
|
||||
# libsigrok->libglib2:
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS # boost-filesystem
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
# libsigrok->libzip
|
||||
depends on !BR2_STATIC_LIBS
|
||||
# libsigrok
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_9
|
||||
depends on BR2_ENABLE_LOCALE
|
||||
select BR2_PACKAGE_LIBSIGROK
|
||||
select BR2_PACKAGE_LIBSIGROKCXX
|
||||
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
|
||||
select BR2_PACKAGE_BOOST_SERIALIZATION
|
||||
help
|
||||
PulseView is a Qt based logic analyzer, oscilloscope
|
||||
and MSO GUI for sigrok.
|
||||
|
||||
http://sigrok.org/wiki/PulseView
|
||||
|
||||
comment "pulseview needs a toolchain w/ locale, wchar, threads, dynamic library, C++, gcc >= 7, host gcc >= 4.9"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_PACKAGE_QT5
|
||||
depends on BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS
|
||||
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || !BR2_USE_WCHAR \
|
||||
|| !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP \
|
||||
|| BR2_STATIC_LIBS || !BR2_ENABLE_LOCALE || \
|
||||
!BR2_HOST_GCC_AT_LEAST_4_9
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 f042f77a3e1b35bf30666330e36ec38fab8d248c3693c37b7e35d401c3bfabcb pulseview-0.4.2.tar.gz
|
||||
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
|
||||
@@ -0,0 +1,27 @@
|
||||
################################################################################
|
||||
#
|
||||
# pulseview
|
||||
#
|
||||
################################################################################
|
||||
|
||||
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 qt5tools boost
|
||||
PULSEVIEW_CONF_OPTS = -DDISABLE_WERROR=TRUE
|
||||
|
||||
ifeq ($(BR2_PACKAGE_BOOST_TEST),y)
|
||||
PULSEVIEW_CONF_OPTS += -DENABLE_TESTS=TRUE
|
||||
else
|
||||
PULSEVIEW_CONF_OPTS += -DENABLE_TESTS=FALSE
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSIGROKDECODE),y)
|
||||
PULSEVIEW_CONF_OPTS += -DENABLE_DECODE=TRUE
|
||||
PULSEVIEW_DEPENDENCIES += libsigrokdecode
|
||||
else
|
||||
PULSEVIEW_CONF_OPTS += -DENABLE_DECODE=FALSE
|
||||
endif
|
||||
|
||||
$(eval $(cmake-package))
|
||||
Reference in New Issue
Block a user