mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-10 15:45:15 -04:00
sci-electronics/dsview: fix gcc-11 compile
* fix extern-c error when compile * fix qt compile error * fix segfault * remove useless patches Closes: https://bugs.gentoo.org/787674 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
@@ -47,9 +47,11 @@ DEPEND="
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.01-viewport.patch
|
||||
"${FILESDIR}"/${PN}-1.12-desktop.patch
|
||||
"${FILESDIR}"/${PN}-1.12-cmake.patch
|
||||
"${FILESDIR}"/${P}-desktop.patch
|
||||
"${FILESDIR}"/${P}-cmake.patch
|
||||
"${FILESDIR}"/${P}-fix-qt.patch
|
||||
"${FILESDIR}"/${P}-fix-segfault.patch
|
||||
"${FILESDIR}"/${P}-fix-extern-c.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
@@ -79,10 +81,9 @@ src_configure() {
|
||||
|
||||
src_compile() {
|
||||
cd "${S}/libsigrok4DSL" || die
|
||||
emake DESTDIR="${D}"
|
||||
emake
|
||||
cd "${S}/libsigrokdecode4DSL" || die
|
||||
emake DESTDIR="${D}"
|
||||
cd "${S}"
|
||||
emake
|
||||
}
|
||||
|
||||
src_install() {
|
||||
|
||||
@@ -46,12 +46,6 @@ DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.01-viewport.patch
|
||||
"${FILESDIR}"/${PN}-1.12-desktop.patch
|
||||
"${FILESDIR}"/${PN}-1.12-cmake.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
export CC="$(tc-getCC)"
|
||||
export AR="$(tc-getAR)"
|
||||
@@ -79,10 +73,9 @@ src_configure() {
|
||||
|
||||
src_compile() {
|
||||
cd "${S}/libsigrok4DSL" || die
|
||||
emake DESTDIR="${D}"
|
||||
emake
|
||||
cd "${S}/libsigrokdecode4DSL" || die
|
||||
emake DESTDIR="${D}"
|
||||
cd "${S}"
|
||||
emake
|
||||
}
|
||||
|
||||
src_install() {
|
||||
|
||||
42
sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch
Normal file
42
sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
diff --git a/DSView/pv/data/decode/annotation.cpp b/DSView/pv/data/decode/annotation.cpp
|
||||
index c433a28..7f23e36 100755
|
||||
--- a/DSView/pv/data/decode/annotation.cpp
|
||||
+++ b/DSView/pv/data/decode/annotation.cpp
|
||||
@@ -19,9 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
-extern "C" {
|
||||
#include <libsigrokdecode4DSL/libsigrokdecode.h>
|
||||
-}
|
||||
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/pv/view/decodetrace.cpp
|
||||
index ad943ac..733497f 100755
|
||||
--- a/DSView/pv/view/decodetrace.cpp
|
||||
+++ b/DSView/pv/view/decodetrace.cpp
|
||||
@@ -19,9 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
-extern "C" {
|
||||
#include <libsigrokdecode4DSL/libsigrokdecode.h>
|
||||
-}
|
||||
|
||||
#include <extdef.h>
|
||||
|
||||
diff --git a/DSView/pv/widgets/decodergroupbox.cpp b/DSView/pv/widgets/decodergroupbox.cpp
|
||||
index 79d3cd8..80c4c44 100755
|
||||
--- a/DSView/pv/widgets/decodergroupbox.cpp
|
||||
+++ b/DSView/pv/widgets/decodergroupbox.cpp
|
||||
@@ -18,9 +18,7 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
-extern "C" {
|
||||
#include <libsigrokdecode4DSL/libsigrokdecode.h>
|
||||
-}
|
||||
|
||||
#include "decodergroupbox.h"
|
||||
#include "../data/decoderstack.h"
|
||||
13
sci-electronics/dsview/files/dsview-1.12-fix-qt.patch
Normal file
13
sci-electronics/dsview/files/dsview-1.12-fix-qt.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp
|
||||
index 921d3db..16cdce9 100755
|
||||
--- a/DSView/pv/view/viewport.cpp
|
||||
+++ b/DSView/pv/view/viewport.cpp
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
#include <QStyleOption>
|
||||
-
|
||||
+#include <QPainterPath>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
22
sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch
Normal file
22
sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff --git a/libsigrokdecode4DSL/instance.c b/libsigrokdecode4DSL/instance.c
|
||||
index 5ede710..5d96701 100755
|
||||
--- a/libsigrokdecode4DSL/instance.c
|
||||
+++ b/libsigrokdecode4DSL/instance.c
|
||||
@@ -370,6 +370,8 @@ SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess,
|
||||
}
|
||||
}
|
||||
|
||||
+ gstate = PyGILState_Ensure();
|
||||
+
|
||||
/*
|
||||
* Prepare a default channel map, where samples come in the
|
||||
* order in which the decoder class defined them.
|
||||
@@ -389,8 +391,6 @@ SRD_API struct srd_decoder_inst *srd_inst_new(struct srd_session *sess,
|
||||
/* Default to the initial pins being the same as in sample 0. */
|
||||
oldpins_array_seed(di);
|
||||
|
||||
- gstate = PyGILState_Ensure();
|
||||
-
|
||||
/* Create a new instance of this decoder class. */
|
||||
if (!(di->py_inst = PyObject_CallObject(dec->py_dec, NULL))) {
|
||||
if (PyErr_Occurred())
|
||||
Reference in New Issue
Block a user