Cleanup and python 3.13

This commit is contained in:
Mario Fetka
2025-05-05 10:23:40 +02:00
parent 7c1ee4ca45
commit b56141d74d
121 changed files with 9006 additions and 479 deletions

View File

@@ -0,0 +1,6 @@
AUX libsigrok-0.5.2-py313.patch 1897 BLAKE2B b4221654e1a056e9e2bcf04b79685f231204984eb40e31eecd09d04774956fc6e9fd474c0070255a130dbd67e9b191b013da8fc6568b3673bae759ca7e6d253d SHA512 081674a2d92b4562efadf812b70fece9d9a2373ff31c34e42189ea3ba5a9f49ce10f4bed70a24efdee77834f0a105fa3f54231669ff7ba8216e8761472150fe7
AUX libsigrok-0.5.2-sipeed-slogic.patch 42177 BLAKE2B e2451273f22091c4c6c550f5ee729e5ae298684de680599bb403e44474d9471c408718403a11a679403a404c45f12fe2aea1be0897ac24fb6433f6610135a954 SHA512 c0fdcb6b39d1e76a928116e8b31cced8b63421f551fd89729f03188da1988b94b6349b35c5d9516faadec4d7ba4071380e0b58608e049e1878250ab294bf0568
AUX libsigrok-0.5.2-swig-4.1.patch 377 BLAKE2B f795f46bce213e9444ea3d8b362a4d82d3e34676a9aae49f45764679effa388afcc15bc04e14fdc89cb25fbd700ca3bf80234b291c3607b0454ecf997d20997d SHA512 0334cbb95fbba961d9f16b18978dd15dbf68b80b897af54d25660dd0bcb049d21ea681f39bae3884c4869ecce4efd2601bce7825fbd41160ddddbe92ad678740
DIST libsigrok-f6d0f7a.zip 1761945 BLAKE2B 719965bb29636232ca9cdf8ea61b8365e23a875ba300e75ff1662cb43217df2cb0eb9bac796ae1debc9236e17a7bff575442e0d42f70b22e94bd928e05d3f013 SHA512 b3d59cc60845bfc46c72c7a67145e5e0b9641793d590a0a814f60f22fdb02bf6e9373219c0dca4d1805fd47321b12c6dea4c40a31fc412571b70a37cec267642
EBUILD libsigrok-0.6.0.ebuild 3506 BLAKE2B 21f395a147c87a9f3c924fc137c773700d211d55dd8500dab3101d1d79fe9469f6d7d7f0b83477da096f28eb6f9394d1d0f141fce1f6a953f7925c73f608b33d SHA512 55a8a11ad36e8d8b04f95e53ad1afc51f2e3d7cf5d71c947d662defca8233f5e740363ea64ae505578344a8bd9252264a2eeef60000d808b21ae96e8d7e01a1d
MISC metadata.xml 886 BLAKE2B cb7cece1f79a4affb612e55f147eb93895a805e43aed6bbabfed2e3b925b0714d64651c00294da2742f8c09ce9984a58888b89025d73712400c8bd026296b2cb SHA512 79c9697b3fe6954108cb60ae79c06cee280ef6d73bcd9e35ab148750a4fa55c8e5118c21cdb4e3ae009d4c160a26c98132448476ef90ac6d7a19a79138c3b2f6

View File

@@ -0,0 +1,46 @@
http://sigrok.org/gitweb/?p=libsigrok.git;a=commit;h=5bc8174531df86991ba8aa6d12942923925d9e72
From: Gerhard Sittig <redacted>
Date: Mon, 2 Oct 2023 16:33:08 +0000 (+0200)
Subject: bindings/python: rephrase for Python 3.9 deprecation (call API)
X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=5bc8174531df86991ba8aa6d12942923925d9e72;hp=1711287ee9e5e4d37cab1cf9fcda5c98f732a137
bindings/python: rephrase for Python 3.9 deprecation (call API)
The PyEval_CallObject() routine was deprecated in Python 3.9, use
PyObject_CallObject() instead which has existed since at least 3.0.
There are also PyEval_InitThreads() deprecation warnings, but these
originate from SWIG generated code and are outside of our control.
Requires SWIG version 4.1 to silence these.
Tested-By: Sascha Silbe <redacted>
--- a/bindings/python/sigrok/core/classes.i
+++ b/bindings/python/sigrok/core/classes.i
@@ -134,7 +134,7 @@ typedef guint pyg_flags_type;
auto arglist = Py_BuildValue("(OO)", log_obj, string_obj);
- auto result = PyEval_CallObject($input, arglist);
+ auto result = PyObject_CallObject($input, arglist);
Py_XDECREF(arglist);
Py_XDECREF(log_obj);
@@ -177,7 +177,7 @@ typedef guint pyg_flags_type;
$1 = [=] () {
const auto gstate = PyGILState_Ensure();
- const auto result = PyEval_CallObject($input, nullptr);
+ const auto result = PyObject_CallObject($input, nullptr);
const bool completed = !PyErr_Occurred();
const bool valid_result = (completed && result == Py_None);
@@ -221,7 +221,7 @@ typedef guint pyg_flags_type;
auto arglist = Py_BuildValue("(OO)", device_obj, packet_obj);
- auto result = PyEval_CallObject($input, arglist);
+ auto result = PyObject_CallObject($input, arglist);
Py_XDECREF(arglist);
Py_XDECREF(device_obj);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
https://bugs.gentoo.org/878395
--- a/bindings/cxx/enums.py
+++ b/bindings/cxx/enums.py
@@ -73,6 +73,8 @@
code = open(os.path.join(outdirname, 'cxx/enums.cpp'), 'w')
swig = open(os.path.join(outdirname, 'swig/enums.i'), 'w')
+print('%include "attribute.i" \n', file=swig)
+
for file in (header, code):
print("/* Generated file - edit enums.py instead! */", file=file)

View File

@@ -0,0 +1,156 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
PYTHON_COMPAT=( python3_{10..13} )
GIT_COMMIT="f6d0f7a"
inherit autotools python-r1 java-pkg-opt-2 udev xdg
if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="git://sigrok.org/${PN}"
inherit git-r3
else
SRC_URI="http://sigrok.org/gitweb/?p=${PN}.git;a=snapshot;h=${GIT_COMMIT};sf=zip -> ${PN}-${GIT_COMMIT}.zip"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
S="${WORKDIR}/${PN}-${GIT_COMMIT}"
fi
DESCRIPTION="Basic hardware drivers for logic analyzers and input/output file format support"
HOMEPAGE="https://sigrok.org/wiki/Libsigrok"
LICENSE="GPL-3"
SLOT="0/4"
IUSE="bluetooth +cxx ftdi hidapi java nettle parport python serial static-libs test +udev usb"
REQUIRED_USE="java? ( cxx )
python? ( cxx ${PYTHON_REQUIRED_USE} )"
RESTRICT="!test? ( test )"
# We also support librevisa, but that isn't in the tree ...
LIB_DEPEND="
>=dev-libs/glib-2.32.0[static-libs(+)]
>=dev-libs/libzip-0.8:=[static-libs(+)]
bluetooth? ( >=net-wireless/bluez-4.0:= )
cxx? ( dev-cpp/glibmm:2[static-libs(+)] )
ftdi? ( dev-embedded/libftdi:1[static-libs(+)] )
hidapi? ( >=dev-libs/hidapi-0.8.0 )
nettle? ( dev-libs/nettle:=[static-libs(+)] )
parport? ( sys-libs/libieee1284[static-libs(+)] )
python? (
${PYTHON_DEPS}
>=dev-python/pygobject-3.0.0[${PYTHON_USEDEP}]
)
serial? ( >=dev-libs/libserialport-0.1.1[static-libs(+)] )
usb? ( virtual/libusb:1[static-libs(+)] )
"
RDEPEND="
java? ( >=virtual/jre-1.8:* )
!static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )
static-libs? ( ${LIB_DEPEND} )
"
DEPEND="${LIB_DEPEND//\[static-libs(+)]}
cxx? ( app-text/doxygen )
java? (
>=dev-lang/swig-3.0.6
>=virtual/jdk-1.8:*
)
python? (
>=dev-lang/swig-3.0.6
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
)
test? ( >=dev-libs/check-0.9.4 )
virtual/pkgconfig
"
BDEPEND="app-arch/unzip"
PATCHES=(
# https://bugs.gentoo.org/878395
"${FILESDIR}/${PN}-0.5.2-swig-4.1.patch"
"${FILESDIR}/${PN}-0.5.2-sipeed-slogic.patch"
"${FILESDIR}/${PN}-0.5.2-py313.patch"
)
pkg_setup() {
use python && python_setup
java-pkg-opt-2_pkg_setup
}
src_unpack() {
[[ ${PV} == *9999* ]] && git-r3_src_unpack || default
}
sigrok_src_prepare() {
eautoreconf
}
src_prepare() {
default
sigrok_src_prepare
use python && python_copy_sources
}
sigrok_src_configure() {
econf \
$(use_with bluetooth libbluez) \
$(use_with ftdi libftdi) \
$(use_with hidapi libhidapi) \
$(use_with nettle libnettle) \
$(use_with parport libieee1284) \
$(use_with serial libserialport) \
$(use_with usb libusb) \
$(use_enable cxx) \
$(use_enable java) \
$(use_enable static-libs static) \
"${@}"
}
each_python_configure() {
cd "${BUILD_DIR}"
sigrok_src_configure --disable-ruby --enable-python
}
src_configure() {
sigrok_src_configure --disable-ruby --disable-python
use python && python_foreach_impl each_python_configure
}
each_python_compile() {
cd "${BUILD_DIR}"
emake python-build
}
src_compile() {
default
use python && python_foreach_impl each_python_compile
}
src_test() {
emake check
}
each_python_install() {
cd "${BUILD_DIR}"
emake python-install DESTDIR="${D}"
python_optimize
}
src_install() {
default
use python && python_foreach_impl each_python_install
use udev && udev_dorules contrib/*.rules
find "${D}" -name '*.la' -type f -delete || die
}
pkg_postinst() {
udev_reload
xdg_pkg_postinst
}
pkg_postrm() {
udev_reload
xdg_pkg_postrm
}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>embedded@gentoo.org</email>
<name>Embedded Gentoo</name>
</maintainer>
<longdescription>
libsigrok is a shared library written in C, which provides the basic
hardware access drivers for logic analyzers and other supported devices,
as well as input/output file format support.
</longdescription>
<use>
<flag name="ftdi">Enable drivers that need <pkg>dev-embedded/libftdi</pkg></flag>
<flag name="hidapi">Enable drivers that need <pkg>dev-libs/hidapi</pkg></flag>
<flag name="nettle">Enable drivers that need <pkg>dev-libs/nettle</pkg></flag>
<flag name="parport">Enable drivers that are parallel (IEEE1284) based</flag>
<flag name="serial">Enable drivers that are serial (RS232) based</flag>
</use>
</pkgmetadata>