From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1280196-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id E98561382C5
	for <garchives@archives.gentoo.org>; Sun,  9 May 2021 18:14:02 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 94F0BE077C;
	Sun,  9 May 2021 18:14:01 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 62A81E077C
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 May 2021 18:14:01 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BEE62340C77
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 May 2021 18:13:59 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 35E3559C
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 May 2021 18:13:58 +0000 (UTC)
From: "Andrew Ammerlaan" <andrewammerlaan@riseup.net>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" <andrewammerlaan@riseup.net>
Message-ID: <1620502822.b26e5a664b0300b7c50b259849b5946fa78a4ec5.andrewammerlaan@gentoo>
Subject: [gentoo-commits] repo/proj/guru:master commit in: sci-electronics/dsview/, sci-electronics/dsview/files/
X-VCS-Repository: repo/proj/guru
X-VCS-Files: sci-electronics/dsview/dsview-1.12.ebuild sci-electronics/dsview/dsview-9999.ebuild sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch sci-electronics/dsview/files/dsview-1.12-fix-qt.patch sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch
X-VCS-Directories: sci-electronics/dsview/files/ sci-electronics/dsview/
X-VCS-Committer: andrewammerlaan
X-VCS-Committer-Name: Andrew Ammerlaan
X-VCS-Revision: b26e5a664b0300b7c50b259849b5946fa78a4ec5
X-VCS-Branch: master
Date: Sun,  9 May 2021 18:13:58 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 3a462548-e39b-4302-9ed8-67907afe1e9f
X-Archives-Hash: 05a20fc55e66db3fd63fa8eb1fd82e0b

commit:     b26e5a664b0300b7c50b259849b5946fa78a4ec5
Author:     Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Sat May  8 19:40:22 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
CommitDate: Sat May  8 19:40:22 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b26e5a66

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 <AT> gmail.com>

 sci-electronics/dsview/dsview-1.12.ebuild          | 13 +++----
 sci-electronics/dsview/dsview-9999.ebuild          | 11 ++----
 .../dsview/files/dsview-1.12-fix-extern-c.patch    | 42 ++++++++++++++++++++++
 .../dsview/files/dsview-1.12-fix-qt.patch          | 13 +++++++
 .../dsview/files/dsview-1.12-fix-segfault.patch    | 22 ++++++++++++
 5 files changed, 86 insertions(+), 15 deletions(-)

diff --git a/sci-electronics/dsview/dsview-1.12.ebuild b/sci-electronics/dsview/dsview-1.12.ebuild
index ad5e51153..dbcb96bbc 100644
--- a/sci-electronics/dsview/dsview-1.12.ebuild
+++ b/sci-electronics/dsview/dsview-1.12.ebuild
@@ -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() {

diff --git a/sci-electronics/dsview/dsview-9999.ebuild b/sci-electronics/dsview/dsview-9999.ebuild
index ad5e51153..98b14e640 100644
--- a/sci-electronics/dsview/dsview-9999.ebuild
+++ b/sci-electronics/dsview/dsview-9999.ebuild
@@ -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() {

diff --git a/sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch b/sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch
new file mode 100644
index 000000000..f3e537c87
--- /dev/null
+++ b/sci-electronics/dsview/files/dsview-1.12-fix-extern-c.patch
@@ -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"

diff --git a/sci-electronics/dsview/files/dsview-1.12-fix-qt.patch b/sci-electronics/dsview/files/dsview-1.12-fix-qt.patch
new file mode 100644
index 000000000..bebf8c84a
--- /dev/null
+++ b/sci-electronics/dsview/files/dsview-1.12-fix-qt.patch
@@ -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>
+ 

diff --git a/sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch b/sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch
new file mode 100644
index 000000000..353d234f5
--- /dev/null
+++ b/sci-electronics/dsview/files/dsview-1.12-fix-segfault.patch
@@ -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())