Fixed libsigrok

This commit is contained in:
2026-11-05 08:59:08 +01:00
parent ab662b55f5
commit 3afc26fdd3
6 changed files with 314 additions and 0 deletions
@@ -0,0 +1,12 @@
diff '--color=auto' -ur libsigrok-f06f788/bindings/python/sigrok/core/classes.i ../libsigrok-f06f788/bindings/python/sigrok/core/classes.i
--- libsigrok-f06f788/bindings/python/sigrok/core/classes.i 2024-10-20 13:10:56.000000000 -0700
+++ ../libsigrok-f06f788/bindings/python/sigrok/core/classes.i 2026-06-09 18:27:00.993413702 -0700
@@ -85,7 +85,7 @@
if (!GLib) {
fprintf(stderr, "Import of gi.repository.GLib failed.\n");
#if PY_VERSION_HEX >= 0x03000000
- return nullptr;
+ return 0;
#else
return;
#endif
@@ -0,0 +1,18 @@
https://bugs.gentoo.org/957126
https://github.com/sigrokproject/libsigrok/commit/467c80149e1ce0cd9bc77517466cc6b8f4753d49
From: Daniel Trnka <daniel.trnka@gmail.com>
Date: Sun, 24 Nov 2024 14:11:46 +0100
Subject: [PATCH] gwinstek-psp: Only build if serial_comm is enabled
--- a/configure.ac
+++ b/configure.ac
@@ -336,7 +336,7 @@ SR_DRIVER([GMC MH 1x/2x], [gmc-mh-1x-2x], [serial_comm])
SR_DRIVER([Great Scott Gadgets GreatFET One], [greatfet], [libusb])
SR_DRIVER([GW Instek GDS-800], [gwinstek-gds-800], [serial_comm])
SR_DRIVER([GW Instek GPD], [gwinstek-gpd], [serial_comm])
-SR_DRIVER([GW Instek PSP], [gwinstek-psp])
+SR_DRIVER([GW Instek PSP], [gwinstek-psp], [serial_comm])
SR_DRIVER([Hameg HMO], [hameg-hmo])
SR_DRIVER([Hantek 4032L], [hantek-4032l], [libusb])
SR_DRIVER([Hantek 6xxx], [hantek-6xxx], [libusb])
@@ -0,0 +1,38 @@
https://bugs.gentoo.org/878395
https://bugs.gentoo.org/959264
From cdd8b55975e447840ce76f3a241be88fec7585b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@gmail.com>
Date: Sun, 3 Nov 2024 17:07:29 +0100
Subject: [PATCH] support SWIG 4.2 and later
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
otherwise building sigrok fails with
bindings/swig/enums.i:1: Error: Unknown directive '%attribute'.
Also indicate that bindings/swig/enums.i is a generated file.
Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
---
bindings/cxx/enums.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bindings/cxx/enums.py b/bindings/cxx/enums.py
index 3711334e7..388faf225 100644
--- a/bindings/cxx/enums.py
+++ b/bindings/cxx/enums.py
@@ -73,9 +73,11 @@
code = open(os.path.join(outdirname, 'cxx/enums.cpp'), 'w')
swig = open(os.path.join(outdirname, 'swig/enums.i'), 'w')
-for file in (header, code):
+for file in (header, code, swig):
print("/* Generated file - edit enums.py instead! */", file=file)
+print('%include "attribute.i"', file=swig)
+
print("namespace sigrok {", file=header)
# Template for beginning of class declaration and public members.