From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 56366138359 for ; Mon, 6 Jul 2020 18:16:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ADA3CE093A; Mon, 6 Jul 2020 18:16:06 +0000 (UTC) Received: from smtp.gentoo.org (dev.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 88982E093A for ; Mon, 6 Jul 2020 18:16:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 7456B34F0CE for ; Mon, 6 Jul 2020 18:16:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6F0912D4 for ; Mon, 6 Jul 2020 18:16:02 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1594059324.d444c133186ee28d7b6ef65d27c692378c93a372.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/libsigrok/, sci-libs/libsigrok/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch sci-libs/libsigrok/libsigrok-0.5.2.ebuild X-VCS-Directories: sci-libs/libsigrok/files/ sci-libs/libsigrok/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: d444c133186ee28d7b6ef65d27c692378c93a372 X-VCS-Branch: master Date: Mon, 6 Jul 2020 18:16:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 03550f73-72a9-4405-a751-a383531fc235 X-Archives-Hash: 9b267b26d62d02d6a3bb7520746acc4f commit: d444c133186ee28d7b6ef65d27c692378c93a372 Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Jul 5 22:20:04 2020 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Mon Jul 6 18:15:24 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d444c133 sci-libs/libsigrok: Fix build with IUSE=ruby Closes: https://bugs.gentoo.org/705074 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner gentoo.org> .../files/libsigrok-0.5.2-ruby-swig-docs.patch | 63 ++++++++++++++++++++++ sci-libs/libsigrok/libsigrok-0.5.2.ebuild | 8 ++- 2 files changed, 69 insertions(+), 2 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 new file mode 100644 index 00000000000..808227a2fff --- /dev/null +++ b/sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch @@ -0,0 +1,63 @@ +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 diff --git a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild index 03ae49481ed..7e3111fc54d 100644 --- a/sci-libs/libsigrok/libsigrok-0.5.2.ebuild +++ b/sci-libs/libsigrok/libsigrok-0.5.2.ebuild @@ -67,8 +67,12 @@ DEPEND="${LIB_DEPEND//\[static-libs(+)]} S="${WORKDIR}"/${P} -# https://sigrok.org/bugzilla/show_bug.cgi?id=1527 -PATCHES=( "${FILESDIR}/${P}-swig-4.patch" ) +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}-ruby-swig-docs.patch" # bug 705074 +) pkg_setup() { use python && python_setup