mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 20:13:01 -04:00
sci-electronics/dsview: add 1.3.2-r1, migrate to Qt6, drop 1.3.0, 1.3.2
- Switch RDEPEND to dev-qt/qtbase:6 + dev-qt/qtsvg:6.
- Pass -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Core=ON so upstream's Qt5-first
detection takes the Qt6 branch.
- Apply upstream c428bd66 to fix nativeEvent override under Qt6.
- Refresh PYTHON_COMPAT to python3_{12..15}.
Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
@@ -1,2 +1 @@
|
||||
DIST dsview-1.3.0.tar.gz 9747423 BLAKE2B bee5969e80c6d57e5551d490e4682af94681db2d6396e44cd38708ff4c1022ee4e890ce0a17ebf6244888ffda46605bace3b6fc97824c42a2c8df1d91565d480 SHA512 367be9c8e7fe88008ec411d2122220df86678d622d5062f1248e63b1204185d1e09e4189910f96dd2e1df3005bf3b8ecba6061e9ae27ad77e696c7c1098dc4c9
|
||||
DIST dsview-1.3.2.tar.gz 10216782 BLAKE2B 57ad018412f13e625528775c256a546f4f08d807ba43edaf412837b743961addf868d9f15e12819916100db1e41623d553ad7e1aaff56ea5c76bc6a4c1963ece SHA512 02de7e853ae20c313c0d3c12893ea490c0872000ebea4fbeaa177bb01382db6016292f8c8e41ab1db3799851c302f6b23b5ae58ce63186b789f7da835f087ad6
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
GITHUB_PN="DSView"
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
|
||||
inherit cmake python-r1 udev xdg
|
||||
|
||||
DESCRIPTION="An open source multi-function instrument"
|
||||
HOMEPAGE="
|
||||
https://www.dreamsourcelab.com
|
||||
https://github.com/DreamSourceLab/DSView
|
||||
"
|
||||
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/DreamSourceLab/${GITHUB_PN}.git"
|
||||
else
|
||||
SRC_URI="https://github.com/DreamSourceLab/${GITHUB_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
S="${WORKDIR}/${GITHUB_PN}-${PV}"
|
||||
fi
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
dev-cpp/glibmm:2
|
||||
dev-libs/boost
|
||||
dev-libs/glib
|
||||
dev-libs/libzip
|
||||
dev-qt/qtcore:5
|
||||
dev-qt/qtgui:5
|
||||
dev-qt/qtwidgets:5
|
||||
dev-qt/qtsvg:5
|
||||
dev-qt/qtconcurrent:5
|
||||
sci-libs/fftw:3.0
|
||||
virtual/libusb:1
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
# bug 887877
|
||||
"${FILESDIR}/${P}-gcc13.patch"
|
||||
# bug 887913
|
||||
"${FILESDIR}/${P}-fix-flags.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
udev_reload
|
||||
xdg_pkg_postinst
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
udev_reload
|
||||
xdg_pkg_postrm
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
GITHUB_PN="DSView"
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
PYTHON_COMPAT=( python3_{12..15} )
|
||||
|
||||
inherit cmake python-r1 udev xdg
|
||||
|
||||
@@ -33,11 +33,8 @@ RDEPEND="${PYTHON_DEPS}
|
||||
dev-libs/boost
|
||||
dev-libs/glib
|
||||
dev-libs/libzip
|
||||
dev-qt/qtcore:5
|
||||
dev-qt/qtgui:5
|
||||
dev-qt/qtwidgets:5
|
||||
dev-qt/qtsvg:5
|
||||
dev-qt/qtconcurrent:5
|
||||
dev-qt/qtbase:6[concurrent,gui,widgets]
|
||||
dev-qt/qtsvg:6
|
||||
sci-libs/fftw:3.0
|
||||
virtual/libusb:1
|
||||
"
|
||||
@@ -55,11 +52,17 @@ PATCHES=(
|
||||
"${FILESDIR}/${PN}-1.3.0-gcc13.patch"
|
||||
# bug 887913
|
||||
"${FILESDIR}/${PN}-1.3.0-fix-flags.patch"
|
||||
# Upstream commit c428bd66: fix Qt6 nativeEvent override signature.
|
||||
"${FILESDIR}/${PN}-1.3.2-qt6.patch"
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
# Upstream CMakeLists tries Qt5 first and only falls back to Qt6
|
||||
# when Qt5 is absent; block the Qt5 probe so the Qt6 path runs
|
||||
# even when Qt5 happens to still be installed.
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Core=ON
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
GITHUB_PN="DSView"
|
||||
PYTHON_COMPAT=( python3_{12..13} )
|
||||
PYTHON_COMPAT=( python3_{12..15} )
|
||||
|
||||
inherit cmake python-r1 udev xdg
|
||||
|
||||
@@ -33,11 +33,8 @@ RDEPEND="${PYTHON_DEPS}
|
||||
dev-libs/boost
|
||||
dev-libs/glib
|
||||
dev-libs/libzip
|
||||
dev-qt/qtcore:5
|
||||
dev-qt/qtgui:5
|
||||
dev-qt/qtwidgets:5
|
||||
dev-qt/qtsvg:5
|
||||
dev-qt/qtconcurrent:5
|
||||
dev-qt/qtbase:6[concurrent,gui,widgets]
|
||||
dev-qt/qtsvg:6
|
||||
sci-libs/fftw:3.0
|
||||
virtual/libusb:1
|
||||
"
|
||||
@@ -56,8 +53,12 @@ PATCHES=(
|
||||
)
|
||||
|
||||
src_configure() {
|
||||
# Upstream CMakeLists tries Qt5 first and only falls back to Qt6
|
||||
# when Qt5 is absent; block the Qt5 probe so the Qt6 path runs
|
||||
# even when Qt5 happens to still be installed.
|
||||
local mycmakeargs=(
|
||||
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Core=ON
|
||||
)
|
||||
|
||||
cmake_src_configure
|
||||
|
||||
123
sci-electronics/dsview/files/dsview-1.3.2-qt6.patch
Normal file
123
sci-electronics/dsview/files/dsview-1.3.2-qt6.patch
Normal file
@@ -0,0 +1,123 @@
|
||||
From c428bd66e313aaf64bfe5b96c687858a72fa6ddd Mon Sep 17 00:00:00 2001
|
||||
From: dreamsource-tai <tzz@dreamsourcelab.com>
|
||||
Date: Thu, 11 Jul 2024 15:14:28 +0800
|
||||
Subject: [PATCH] fix: unable to complie with qt6
|
||||
|
||||
---
|
||||
DSView/pv/dock/keywordlineedit.cpp | 16 +++++++++++++++-
|
||||
DSView/pv/dock/keywordlineedit.h | 1 +
|
||||
DSView/pv/mainframe.cpp | 8 +++-----
|
||||
DSView/pv/mainframe.h | 11 +++++++++--
|
||||
libsigrok4DSL/lib_main.c | 2 +-
|
||||
5 files changed, 29 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/DSView/pv/dock/keywordlineedit.cpp b/DSView/pv/dock/keywordlineedit.cpp
|
||||
index a74c8c15..aef003ec 100644
|
||||
--- a/DSView/pv/dock/keywordlineedit.cpp
|
||||
+++ b/DSView/pv/dock/keywordlineedit.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "../config/appconfig.h"
|
||||
#include "../ui/langresource.h"
|
||||
#include "../log.h"
|
||||
+#include "../dsvdef.h"
|
||||
|
||||
namespace{
|
||||
QTimer *move_timer = NULL;
|
||||
@@ -120,7 +121,20 @@ void KeyLineEdit::wheelEvent(QWheelEvent *event)
|
||||
int v = new_text.toInt();
|
||||
int old_v = v;
|
||||
|
||||
- if (event->delta() > 0){
|
||||
+ int delta = 0;
|
||||
+
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
+ int anglex = event->angleDelta().x();
|
||||
+ int angley = event->angleDelta().y();
|
||||
+
|
||||
+ if (anglex == 0 || ABS_VAL(angley) >= ABS_VAL(anglex)){
|
||||
+ delta = angley;
|
||||
+ }
|
||||
+#else
|
||||
+ delta = event->delta();
|
||||
+#endif
|
||||
+
|
||||
+ if (delta > 0){
|
||||
v++;
|
||||
}
|
||||
else{
|
||||
diff --git a/DSView/pv/dock/keywordlineedit.h b/DSView/pv/dock/keywordlineedit.h
|
||||
index 5a32ec51..93b50cb8 100644
|
||||
--- a/DSView/pv/dock/keywordlineedit.h
|
||||
+++ b/DSView/pv/dock/keywordlineedit.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
#include <QSpinBox>
|
||||
+#include <QWheelEvent>
|
||||
|
||||
class IKeywordActive{
|
||||
public:
|
||||
diff --git a/DSView/pv/mainframe.cpp b/DSView/pv/mainframe.cpp
|
||||
index f9e91588..9f92d42b 100644
|
||||
--- a/DSView/pv/mainframe.cpp
|
||||
+++ b/DSView/pv/mainframe.cpp
|
||||
@@ -1106,10 +1106,9 @@ QWidget* MainFrame::GetBodyView()
|
||||
return _mainWindow->GetBodyView();
|
||||
}
|
||||
|
||||
-bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
-{
|
||||
#ifdef _WIN32
|
||||
-
|
||||
+bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, MESSAGE_RESULT_PTR result)
|
||||
+{
|
||||
if (_parentNativeWidget != NULL)
|
||||
{
|
||||
MSG *msg = static_cast<MSG*>(message);
|
||||
@@ -1129,10 +1128,9 @@ bool MainFrame::nativeEvent(const QByteArray &eventType, void *message, long *re
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
-#endif
|
||||
|
||||
return QWidget::nativeEvent(eventType, message, result);
|
||||
}
|
||||
+#endif
|
||||
|
||||
} // namespace pv
|
||||
diff --git a/DSView/pv/mainframe.h b/DSView/pv/mainframe.h
|
||||
index 36674801..0c2ec3ee 100644
|
||||
--- a/DSView/pv/mainframe.h
|
||||
+++ b/DSView/pv/mainframe.h
|
||||
@@ -37,6 +37,13 @@
|
||||
|
||||
#include "toolbars/titlebar.h"
|
||||
|
||||
+
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
+typedef qintptr *MESSAGE_RESULT_PTR;
|
||||
+#else
|
||||
+typedef long *MESSAGE_RESULT_PTR;
|
||||
+#endif
|
||||
+
|
||||
namespace pv {
|
||||
|
||||
class MainWindow;
|
||||
@@ -108,14 +115,14 @@ class MainFrame :
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
bool eventFilter(QObject *object, QEvent *event) override;
|
||||
+
|
||||
#ifdef _WIN32
|
||||
void showEvent(QShowEvent *event);
|
||||
+ bool nativeEvent(const QByteArray &eventType, void *message, MESSAGE_RESULT_PTR result) override;
|
||||
#endif
|
||||
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
- bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
||||
-
|
||||
signals:
|
||||
void sig_ParentNativeEvent(int msg);
|
||||
|
||||
Reference in New Issue
Block a user