From 672eff0e1c260009a72fd79b7f2bb664a36f7088 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Tue, 23 Mar 2021 19:31:12 +0100 Subject: [PATCH] pulseview, bump version (#5791) --- .../patches/pulseview-0.4.2-qt-5.15.patch | 140 ++++++++++++++++++ ....4.1.patchset => pulseview-0.4.2.patchset} | 51 ++----- ...ew-0.4.1.recipe => pulseview-0.4.2.recipe} | 57 ++++--- 3 files changed, 188 insertions(+), 60 deletions(-) create mode 100644 sci-electronics/pulseview/patches/pulseview-0.4.2-qt-5.15.patch rename sci-electronics/pulseview/patches/{pulseview-0.4.1.patchset => pulseview-0.4.2.patchset} (52%) rename sci-electronics/pulseview/{pulseview-0.4.1.recipe => pulseview-0.4.2.recipe} (68%) diff --git a/sci-electronics/pulseview/patches/pulseview-0.4.2-qt-5.15.patch b/sci-electronics/pulseview/patches/pulseview-0.4.2-qt-5.15.patch new file mode 100644 index 000000000..bfda8c432 --- /dev/null +++ b/sci-electronics/pulseview/patches/pulseview-0.4.2-qt-5.15.patch @@ -0,0 +1,140 @@ +From ae726b70a7ada9a4be5808e00f0c951318479684 Mon Sep 17 00:00:00 2001 +From: Valentin Ochs +Date: Sat, 20 Jun 2020 16:01:27 +0200 +Subject: [PATCH] Replace obsolete/deprecated Qt methods + +--- + pv/subwindows/decoder_selector/subwindow.cpp | 2 +- + 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 +- + 6 files changed, 34 insertions(+), 6 deletions(-) + +diff --git a/pv/subwindows/decoder_selector/subwindow.cpp b/pv/subwindows/decoder_selector/subwindow.cpp +index 94ed6f4b..2c65dcf2 100644 +--- a/pv/subwindows/decoder_selector/subwindow.cpp ++++ b/pv/subwindows/decoder_selector/subwindow.cpp +@@ -185,7 +185,7 @@ QToolBar* SubWindow::create_toolbar(QWidget *parent) const + int SubWindow::minimum_width() const + { + QFontMetrics m(info_label_body_->font()); +- const int label_width = m.width(QString(tr(initial_notice))); ++ const int label_width = util::text_width(m, tr(initial_notice)); + + return label_width + min_width_margin; + } +diff --git a/pv/util.cpp b/pv/util.cpp +index 897254e1..dfb8c72b 100644 +--- a/pv/util.cpp ++++ b/pv/util.cpp +@@ -143,7 +143,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; + +@@ -169,7 +169,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; +@@ -279,5 +279,22 @@ vector 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 fab29a14..49ae04b2 100644 +--- a/pv/util.hpp ++++ b/pv/util.hpp +@@ -30,6 +30,7 @@ + + #include + #include ++#include + + using std::string; + using std::vector; +@@ -143,6 +144,15 @@ QString format_time_minutes(const Timestamp& t, signed precision = 0, + + vector 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 67c9b1c4..93c7c5a9 100644 +--- a/pv/views/trace/decodetrace.cpp ++++ b/pv/views/trace/decodetrace.cpp +@@ -161,7 +161,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 555794fc..83ffed28 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 fea8175e..01424a5b 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); + } diff --git a/sci-electronics/pulseview/patches/pulseview-0.4.1.patchset b/sci-electronics/pulseview/patches/pulseview-0.4.2.patchset similarity index 52% rename from sci-electronics/pulseview/patches/pulseview-0.4.1.patchset rename to sci-electronics/pulseview/patches/pulseview-0.4.2.patchset index 8133fdf6a..c6fc2dbaf 100644 --- a/sci-electronics/pulseview/patches/pulseview-0.4.1.patchset +++ b/sci-electronics/pulseview/patches/pulseview-0.4.2.patchset @@ -1,28 +1,14 @@ -From e0ab2bde670d875a7134b225ec3feda7f8865f2a Mon Sep 17 00:00:00 2001 +From 1e77a52b7138c555002f57db81ecabc8a555b3fc Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 12 Jan 2019 10:48:33 +0100 Subject: Build and packaging fixes diff --git a/CMakeLists.txt b/CMakeLists.txt -index a19593d..ae751c7 100644 +index c29fa28..03b3c7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -72,8 +72,12 @@ add_subdirectory(manual) - #= Dependencies - #------------------------------------------------------------------------------- - -+# glibmm uses c++14 features -+set(CMAKE_CXX_STANDARD 14) -+set(CMAKE_CXX_STANDARD_REQUIRED ON) -+ - list(APPEND PKGDEPS glib-2.0>=2.28.0) --list(APPEND PKGDEPS glibmm-2.4>=2.28.0) -+list(APPEND PKGDEPS glibmm-2.58>=2.28.0) - - set(LIBSR_CXX_BINDING "libsigrokcxx>=0.5.1") - list(APPEND PKGDEPS "${LIBSR_CXX_BINDING}") -@@ -137,7 +141,6 @@ function(check_working_cxx_atomics varname additional_lib) +@@ -146,7 +146,6 @@ function(check_working_cxx_atomics varname additional_lib) include(CheckCXXSourceCompiles) include(CMakePushCheckState) cmake_push_check_state() @@ -30,15 +16,15 @@ index a19593d..ae751c7 100644 set(CMAKE_REQUIRED_LIBRARIES "${additional_lib}") set(CMAKE_REQUIRED_QUIET 1) CHECK_CXX_SOURCE_COMPILES(" -@@ -411,7 +414,6 @@ qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES}) +@@ -445,7 +444,6 @@ 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) add_definitions(-DBOOST_MATH_DISABLE_FLOAT128=1) - if(ENABLE_DECODE) -@@ -467,6 +469,11 @@ else() + if(ENABLE_FLOW) +@@ -505,6 +503,11 @@ else() list(APPEND PULSEVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) endif() @@ -50,34 +36,25 @@ index a19593d..ae751c7 100644 if(WIN32) # On Windows we need to statically link the libqsvg imageformat # plugin (and the QtSvg component) for SVG graphics/icons to work. -@@ -507,12 +514,16 @@ endif() +@@ -546,6 +549,10 @@ endif() #= Installation #------------------------------------------------------------------------------- --# Install the executable. --install(TARGETS ${PROJECT_NAME} DESTINATION bin/) -- - # Install the manpage. - install(FILES doc/pulseview.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) - ++# Install the executable. +if(HAIKU) +install(TARGETS ${PROJECT_NAME} DESTINATION apps/) -+ +else() -+# Install the executable. -+install(TARGETS ${PROJECT_NAME} DESTINATION bin/) -+ - # Install the desktop file. - install(FILES contrib/org.sigrok.PulseView.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + # Install the executable. + install(TARGETS ${PROJECT_NAME} DESTINATION bin/) -@@ -525,6 +536,7 @@ install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons +@@ -564,6 +571,7 @@ install(FILES icons/pulseview.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons # Generate Windows installer script. - configure_file(contrib/pulseview_cross.nsi.in contrib/pulseview_cross.nsi @ONLY) -+endif() + configure_file(contrib/pulseview_cross.nsi.in ${CMAKE_CURRENT_BINARY_DIR}/contrib/pulseview_cross.nsi @ONLY) ++endif(HAIKU) #=============================================================================== #= Packaging (handled by CPack) -- -2.19.1 +2.30.2 diff --git a/sci-electronics/pulseview/pulseview-0.4.1.recipe b/sci-electronics/pulseview/pulseview-0.4.2.recipe similarity index 68% rename from sci-electronics/pulseview/pulseview-0.4.1.recipe rename to sci-electronics/pulseview/pulseview-0.4.2.recipe index e9b5ff4f4..5e9c8753b 100644 --- a/sci-electronics/pulseview/pulseview-0.4.1.recipe +++ b/sci-electronics/pulseview/pulseview-0.4.2.recipe @@ -15,8 +15,9 @@ COPYRIGHT="2012-2019 PulseView contributors" LICENSE="GNU GPL v3" REVISION="1" SOURCE_URI="http://sigrok.org/download/source/pulseview/pulseview-$portVersion.tar.gz" -CHECKSUM_SHA256="9ee7ce3dd1457c6a5f5e4e9c2469903a1f070ba077ea68535cc29ef1dfac6f2f" -PATCHES="pulseview-$portVersion.patchset" +CHECKSUM_SHA256="f042f77a3e1b35bf30666330e36ec38fab8d248c3693c37b7e35d401c3bfabcb" +PATCHES="pulseview-$portVersion.patchset + pulseview-0.4.2-qt-5.15.patch" ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64" SECONDARY_ARCHITECTURES="x86" @@ -26,57 +27,67 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix - lib:libsigrok$secondaryArchSuffix - lib:libsigrokcxx$secondaryArchSuffix - lib:libboost_system$secondaryArchSuffix - lib:libboost_system$secondaryArchSuffix lib:libboost_filesystem$secondaryArchSuffix lib:libboost_serialization$secondaryArchSuffix - lib:libzip$secondaryArchSuffix - lib:libqt5core$secondaryArchSuffix - lib:libqt5gui$secondaryArchSuffix - lib:libqt5widgets$secondaryArchSuffix - lib:libglibmm_2.58$secondaryArchSuffix - lib:libglib_2.0$secondaryArchSuffix - lib:libintl$secondaryArchSuffix + lib:libboost_system$secondaryArchSuffix lib:libftdi1$secondaryArchSuffix + lib:libglib_2.0$secondaryArchSuffix + lib:libglibmm_2.4$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libQt5Core$secondaryArchSuffix + lib:libQt5Gui$secondaryArchSuffix + lib:libQt5Svg$secondaryArchSuffix + lib:libQt5Widgets$secondaryArchSuffix + lib:libsigrok$secondaryArchSuffix lib:libsigrokdecode$secondaryArchSuffix + lib:libsigc_2.0$secondaryArchSuffix lib:libusb_1.0$secondaryArchSuffix - lib:libsigc_3.0$secondaryArchSuffix + lib:libzip$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libsigrokcxx$secondaryArchSuffix - devel:libsigrokdecode$secondaryArchSuffix - devel:libqt5core$secondaryArchSuffix devel:libboost_filesystem$secondaryArchSuffix - devel:libglib_2.0$secondaryArchSuffix + devel:libboost_serialization$secondaryArchSuffix + devel:libboost_system$secondaryArchSuffix devel:libftdi1$secondaryArchSuffix + devel:libglib_2.0$secondaryArchSuffix + devel:libQt5Core$secondaryArchSuffix + devel:libQt5Gui$secondaryArchSuffix + devel:libQt5Svg$secondaryArchSuffix + devel:libQt5Widgets$secondaryArchSuffix + devel:libsigrok$secondaryArchSuffix + devel:libsigrokdecode$secondaryArchSuffix devel:libusb_1.0$secondaryArchSuffix devel:libzip$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake cmd:gcc$secondaryArchSuffix + cmd:lrelease$secondaryArchSuffix >= 5 cmd:pkg_config$secondaryArchSuffix - cmd:ninja + cmd:linguist$secondaryArchSuffix >= 5 + cmd:make " BUILD() { - cmake $cmakeDirArgs -GNinja - ninja $jobArgs + mkdir -p build && cd build + cmake $cmakeDirArgs \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_TEST=OFF \ + -DDISABLE_WERROR=ON -L .. + make $jobArgs } INSTALL() { - ninja install + make -C build install rm -rf $prefix/share addAppDeskbarSymlink $appsDir/pulseview } TEST() { - ninja check + make check }