From 53ff2fbaed648d8013ab66cad637ba995b1a9d14 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Sun, 1 Aug 2021 13:59:02 -0500 Subject: [PATCH] Fix build error due to C++ template behind C linkage This has recently been fixed upstream. Bring in the upstream patch. --- ...d-due-to-C-template-behind-C-linkage.patch | 54 +++++++++++++++++++ pulseview.spec | 7 ++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-broken-build-due-to-C-template-behind-C-linkage.patch diff --git a/0001-Fix-broken-build-due-to-C-template-behind-C-linkage.patch b/0001-Fix-broken-build-due-to-C-template-behind-C-linkage.patch new file mode 100644 index 0000000..98bbd42 --- /dev/null +++ b/0001-Fix-broken-build-due-to-C-template-behind-C-linkage.patch @@ -0,0 +1,54 @@ +From ed643f0b4ac587204a5243451cda181ee1405d62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +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 + +As libsigrokdecode.h declares extern C linkage itself where necessary, +remove it from pulseviews include statements from the last two occasions. +--- + 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 . + */ + +-extern "C" { + #include +-} + + #include + #include +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 . + */ + +-extern "C" { + #include +-} + + #include + #include +-- +2.31.1 + diff --git a/pulseview.spec b/pulseview.spec index c097deb..043e647 100644 --- a/pulseview.spec +++ b/pulseview.spec @@ -1,6 +1,6 @@ Name: pulseview Version: 0.4.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Signal acquisition and analysis GUI for sigrok # Combined GPLv3+ (libsigrok and libsigrokdecode) and GPLv2+ (pulseview) License: GPLv3+ @@ -8,6 +8,8 @@ URL: http://www.sigrok.org Source0: %{url}/download/source/%{name}/%{name}-%{version}.tar.gz # https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff;h=ae726b70a7ada9a4be5808e00f0c951318479684 Patch0: pulseview-qt.patch +# Upstream commit ed643f0b4ac587204a5243451cda181ee1405d62 +Patch1: 0001-Fix-broken-build-due-to-C-template-behind-C-linkage.patch BuildRequires: pkgconfig(libsigrokcxx) >= 0.5.2 BuildRequires: pkgconfig(libsigrokdecode) >= 0.5.2 BuildRequires: qt5-qtbase-devel @@ -59,6 +61,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata %{_datadir}/appdata/org.sigrok.PulseView.appdata.xml %changelog +* Sun Aug 01 2021 Alexandru Gagniuc - 0.4.2-8 +- Add upstream patch to fix build error due to C++ template behind C linkage + * Fri Jul 23 2021 Fedora Release Engineering - 0.4.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild