[gentoo-commits] repo/gentoo:master commit in: sci-libs/libsigrok/files/, sci-libs/libsigrok/
commit: a09cf66a0d720125efdfd0f62643ba4be61545a7 Author: Sam James gentoo org> AuthorDate: Sat Jun 10 21:32:32 2023 + Commit: Sam James gentoo org> CommitDate: Sat Jun 10 21:32:37 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a09cf66a sci-libs/libsigrok: fix build w/ swig-4.1 Closes: https://bugs.gentoo.org/878395 Signed-off-by: Sam James gentoo.org> .../libsigrok/files/libsigrok-0.5.2-swig-4.1.patch | 11 ++ sci-libs/libsigrok/libsigrok-0.5.2-r4.ebuild | 156 + 2 files changed, 167 insertions(+) diff --git a/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.1.patch b/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.1.patch new file mode 100644 index ..6513491270cf --- /dev/null +++ b/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.1.patch @@ -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) diff --git a/sci-libs/libsigrok/libsigrok-0.5.2-r4.ebuild b/sci-libs/libsigrok/libsigrok-0.5.2-r4.ebuild new file mode 100644 index ..8da4999fe538 --- /dev/null +++ b/sci-libs/libsigrok/libsigrok-0.5.2-r4.ebuild @@ -0,0 +1,156 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +PYTHON_COMPAT=( python3_{9..11} ) + +inherit autotools python-r1 java-pkg-opt-2 udev xdg-utils + +if [[ ${PV} == ** ]]; then + EGIT_REPO_URI="git://sigrok.org/${PN}" + inherit git-r3 +else + SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"; + KEYWORDS="~amd64 ~arm ~arm64 ~x86" +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 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 ) + 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-doc/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 +" + +S="${WORKDIR}"/${P} + +PATCHES=( + # https://sigrok.org/bugzilla/show_bug.cgi?id=1527 + "${FILESDIR}/${P}-swig-4.patch" + # https://sigrok.org/bugzilla/show_bug.cgi?id=1526 + "${FILESDIR}/${P}-check-0.15.patch" + # https://bugs.gentoo.org/878395 + "${FILESDIR}/${PN}-0.5.2-swig-4.1.patch" +) + +pkg_setup() { + use python && python_setup + java-pkg-opt-2_pkg_setup +} + +src_unpack() { + [[ ${PV} == ** ]] && 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 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_D
[gentoo-commits] repo/gentoo:master commit in: sci-libs/libsigrok/files/
commit: aebc03acfbe9cb5cf3ee4416eab0c75a1d2acdd6 Author: Sam James gentoo org> AuthorDate: Sat Aug 27 11:41:18 2022 + Commit: Sam James gentoo org> CommitDate: Sat Aug 27 11:41:18 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aebc03ac sci-libs/libsigrok: drop unused Ruby patch Fixes: acde501c0f1a1673ab84c9c316334b497bbf0a00 Signed-off-by: Sam James gentoo.org> .../files/libsigrok-0.5.2-ruby-swig-docs.patch | 63 -- 1 file changed, 63 deletions(-) diff --git a/sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch b/sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch deleted file mode 100644 index 808227a2fffb.. --- a/sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch +++ /dev/null @@ -1,63 +0,0 @@ -From bae9308ec157378bd22ce4f4a0226f1e7ef23594 Mon Sep 17 00:00:00 2001 -From: Anatol Pomozov -Date: Mon, 8 Jun 2020 20:46:44 -0700 -Subject: [PATCH] Fix ruby SWIG bindings generation - -bindings/swig/doc.py generates a swig interface file for ruby bindings -that includes docstrings with comments braces ( /* and */ ) like this: - - %feature("docstring") sigrok::Channel::type "/* Type of this channel. */\n"; - %feature("docstring") sigrok::Channel::enabled "/* Enabled status of this channel. */\n"; - -SWIG generates *.cxx and adds its own braces to the docstring: - -/*/* Document-class: Sigrok::Error -Exception thrown when an error code is returned by any libsigrok call. */ -*/ - -this causes compilation error for Ruby bindings. - -To fix the error we should not add extra braces to the docstring. -With this patch libsigrok compiles fine with with ruby 2.7 and swig 4.0.2. - -Fixes bug #1526 - -Signed-off-by: Anatol Pomozov - bindings/swig/doc.py | 8 - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/bindings/swig/doc.py b/bindings/swig/doc.py -index e8767af8..182f5477 100644 a/bindings/swig/doc.py -+++ b/bindings/swig/doc.py -@@ -46,7 +46,7 @@ for compound in index.findall('compound'): - if language == 'python': - print('%%feature("docstring") %s "%s";' % (class_name, brief)) - elif language == 'ruby': --print('%%feature("docstring") %s "/* Document-class: %s\\n%s */\\n";' % (class_name, class_name.replace("sigrok", "Sigrok", 1), brief)) -+print('%%feature("docstring") %s "Document-class: %s\\n%s\\n";' % (class_name, class_name.replace("sigrok", "Sigrok", 1), brief)) - elif language == 'java': - print('%%typemap(javaclassmodifiers) %s "/** %s */\npublic class"' % ( - class_name, brief)) -@@ -77,10 +77,10 @@ for compound in index.findall('compound'): - for name, desc in parameters.items()]) + '";') - if language == 'ruby' and kind == 'public-func': - print(str.join('\n', [ --'%%feature("docstring") %s::%s "/* %s' % ( -+'%%feature("docstring") %s::%s "%s' % ( - class_name, member_name, brief)] + [ - '@param %s %s' % (name, desc) --for name, desc in parameters.items()]) + ' */\\n";') -+for name, desc in parameters.items()]) + '\\n";') - elif language == 'java' and kind == 'public-func': - print(str.join('\n', [ - '%%javamethodmodifiers %s::%s "/** %s' % ( -@@ -111,4 +111,4 @@ for compound in index.findall('compound'): - print('%}') - elif language == 'ruby' and constants: - for member_name, brief in constants: --print('%%feature("docstring") %s::%s "/* %s */\\n";' % (class_name, member_name, brief)) -+print('%%feature("docstring") %s::%s "%s\\n";' % (class_name, member_name, brief)) --- -2.27.0
[gentoo-commits] repo/gentoo:master commit in: sci-libs/libsigrok/files/, sci-libs/libsigrok/
commit: cb658281569eb887138e836f0c17a6855c84f047 Author: Sven Wegener gentoo org> AuthorDate: Mon Nov 16 22:16:24 2020 + Commit: Sven Wegener gentoo org> CommitDate: Mon Nov 16 22:31:16 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb658281 sci-libs/libsigrok: Fix FEATURES=test with >=dev-libs/check-0.15 Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Sven Wegener gentoo.org> .../files/libsigrok-0.5.2-check-0.15.patch | 26 ++ sci-libs/libsigrok/libsigrok-0.5.2.ebuild | 1 + 2 files changed, 27 insertions(+) diff --git a/sci-libs/libsigrok/files/libsigrok-0.5.2-check-0.15.patch b/sci-libs/libsigrok/files/libsigrok-0.5.2-check-0.15.patch new file mode 100644 index 000..8099dcc6c49 --- /dev/null +++ b/sci-libs/libsigrok/files/libsigrok-0.5.2-check-0.15.patch @@ -0,0 +1,26 @@ +From 505a55f7899ee2eb41418e753a1290252202ecd3 Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Tue, 15 Sep 2020 08:50:48 +0200 +Subject: [PATCH] tests: strutil, use ck_assert + +We pass no message, so use ck_assert instead of ck_assert_msg. This +results in an error with check 0.15: +tests/strutil.c:157:2: error: too few arguments to function '_ck_assert_failed' + 157 | ck_assert_msg(saved_locale != NULL); +--- + tests/strutil.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/strutil.c b/tests/strutil.c +index fca70eaae..ec2233329 100644 +--- a/tests/strutil.c b/tests/strutil.c +@@ -154,7 +154,7 @@ START_TEST(test_locale) + fprintf(stderr, "Old locale = %s\n", old_locale); + /* Copy the name so it won’t be clobbered by setlocale. */ + saved_locale = g_strdup(old_locale); +- ck_assert_msg(saved_locale != NULL); ++ ck_assert(saved_locale != NULL); + + #ifdef _WIN32 + /* diff --git a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild index bff13a8719a..17fe88bad8f 100644 --- a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild +++ b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild @@ -72,6 +72,7 @@ PATCHES=( "${FILESDIR}/${P}-swig-4.patch" # https://sigrok.org/bugzilla/show_bug.cgi?id=1526 "${FILESDIR}/${P}-ruby-swig-docs.patch" # bug 705074 + "${FILESDIR}/${P}-check-0.15.patch" ) pkg_setup() {
[gentoo-commits] repo/gentoo:master commit in: sci-libs/libsigrok/files/, sci-libs/libsigrok/
commit: 2d67ebbf58c156b92a1ef37bec35e3d780a5f746 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Jul 5 22:06:48 2020 + Commit: Andreas Sturmlechner gentoo org> CommitDate: Mon Jul 6 18:15:24 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d67ebbf sci-libs/libsigrok: Fix build with IUSE=java and >=dev-lang/swig-4 See also: https://sigrok.org/bugzilla/show_bug.cgi?id=1527 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner gentoo.org> .../libsigrok/files/libsigrok-0.5.2-swig-4.patch | 37 ++ sci-libs/libsigrok/libsigrok-0.5.2.ebuild | 3 ++ 2 files changed, 40 insertions(+) diff --git a/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.patch b/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.patch new file mode 100644 index 000..3c5dd85a510 --- /dev/null +++ b/sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.patch @@ -0,0 +1,37 @@ +From e803574173bdac8a7f33085a648c29eaf248a394 Mon Sep 17 00:00:00 2001 +From: Uwe Hermann +Date: Sat, 4 Apr 2020 21:54:13 +0200 +Subject: [PATCH 1/1] bindings/java: Fix build issue with SWIG 4.x. + +Tested with SWIG 3.x and SWIG 4.x. + +This fixes bug #1527. +--- + bindings/java/org/sigrok/core/classes/classes.i | 8 + 1 file changed, 8 insertions(+) + +diff --git a/bindings/java/org/sigrok/core/classes/classes.i b/bindings/java/org/sigrok/core/classes/classes.i +index 75793b25..e953fe5d 100644 +--- a/bindings/java/org/sigrok/core/classes/classes.i b/bindings/java/org/sigrok/core/classes/classes.i +@@ -94,10 +94,18 @@ VECTOR(std::shared_ptr, HardwareDevice) + "java.util.Map" + + %typemap(javain, ++/* SWIG 4.0.0 changed the std::map wrappers in an incompatible way. */ ++#if SWIG_VERSION >= 0x04 ++pre=" $javaclassname temp$javainput = new $javaclassname(); ++for (java.util.Map.Entry entry : $javainput.entrySet()) ++ temp$javainput.put(entry.getKey(), entry.getValue());", ++pgcppname="temp$javainput") ++#else + pre=" $javaclassname temp$javainput = new $javaclassname(); + for (java.util.Map.Entry entry : $javainput.entrySet()) + temp$javainput.set(entry.getKey(), entry.getValue());", + pgcppname="temp$javainput") ++#endif + std::map< CKey, CValue > "$javaclassname.getCPtr(temp$javainput)" + + %typemap(javaout) std::map< CKey, CValue > { +-- +2.24.0.rc2 diff --git a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild index ba30bc5fe2d..03ae49481ed 100644 --- a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild +++ b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild @@ -67,6 +67,9 @@ DEPEND="${LIB_DEPEND//\[static-libs(+)]} S="${WORKDIR}"/${P} +# https://sigrok.org/bugzilla/show_bug.cgi?id=1527 +PATCHES=( "${FILESDIR}/${P}-swig-4.patch" ) + pkg_setup() { use python && python_setup use ruby && ruby-ng_pkg_setup