summaryrefslogtreecommitdiff
path: root/sci-libs/libsigrok
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-09-01 12:01:16 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-09-01 12:01:16 +0100
commit4d37b8aa4c6b04fa417e8f87f276f7e08a411ee0 (patch)
treea53cac2dfa1e2a70dea6c0d6d6e1d7ff3bde743d /sci-libs/libsigrok
parent5b7f6475da27c05b30659a00ecb49636aca2bece (diff)
gentoo auto-resync : 01:09:2024 - 12:01:15
Diffstat (limited to 'sci-libs/libsigrok')
-rw-r--r--sci-libs/libsigrok/Manifest5
-rw-r--r--sci-libs/libsigrok/files/libsigrok-0.5.2-ruby-swig-docs.patch63
-rw-r--r--sci-libs/libsigrok/libsigrok-0.5.2-r5.ebuild47
-rw-r--r--sci-libs/libsigrok/libsigrok-9999.ebuild46
4 files changed, 147 insertions, 14 deletions
diff --git a/sci-libs/libsigrok/Manifest b/sci-libs/libsigrok/Manifest
index 6a6c6871d3b3..27a93931e6ba 100644
--- a/sci-libs/libsigrok/Manifest
+++ b/sci-libs/libsigrok/Manifest
@@ -1,8 +1,9 @@
AUX libsigrok-0.5.2-check-0.15.patch 917 BLAKE2B 39d042e99dc5a71fa79def033f7a30621967294ed8198b00ca9e7a21caf7ee77f07e3f6d1e27c3a4d2629539835ec1b4e7bc3fdfe2ce1e98d7e97b4a897131ce SHA512 1729653f153ebdec08c0b987a0cf15a50ed6ce8948805b2a9ddf122ba591426e830329bfb47527ef253c19f9b8e98693ab0258e9ac19906473d3605d61c8983d
AUX libsigrok-0.5.2-py313.patch 1897 BLAKE2B b4221654e1a056e9e2bcf04b79685f231204984eb40e31eecd09d04774956fc6e9fd474c0070255a130dbd67e9b191b013da8fc6568b3673bae759ca7e6d253d SHA512 081674a2d92b4562efadf812b70fece9d9a2373ff31c34e42189ea3ba5a9f49ce10f4bed70a24efdee77834f0a105fa3f54231669ff7ba8216e8761472150fe7
+AUX libsigrok-0.5.2-ruby-swig-docs.patch 3085 BLAKE2B 865f38a8230762f58620c06b91dda8bfda405057c6733ef8dc27dbc7094817709ce03a3db1904e4c4ce3ecbdc82da6d16c5719a3f93410a84f07cd4c4018a9ea SHA512 aa3fd492f736c0fe7af1c2ba4e41307731589cef78c480426113dcbae8abbf0ecc07bdc5e1b251103d5aa813f120c5ff7f76dd6d5e577ca8f2b9f29eac008025
AUX libsigrok-0.5.2-swig-4.1.patch 377 BLAKE2B f795f46bce213e9444ea3d8b362a4d82d3e34676a9aae49f45764679effa388afcc15bc04e14fdc89cb25fbd700ca3bf80234b291c3607b0454ecf997d20997d SHA512 0334cbb95fbba961d9f16b18978dd15dbf68b80b897af54d25660dd0bcb049d21ea681f39bae3884c4869ecce4efd2601bce7825fbd41160ddddbe92ad678740
AUX libsigrok-0.5.2-swig-4.patch 1484 BLAKE2B 94c9bbde14f3175252677dedd50a7f3ff17bcc734382d93fbe3c65c71989dc72d0568535343bcb7764053075a2bac9c9f2d4e480d582a5371ac0d4a12bcab4a2 SHA512 34e568351624aeada4c3894be8a60cc0111be7c20ebe8e5395a1f81b2fc453a6a8228f575b95faad5140162a9d4fc5fc570546f42673f7275cb3910c73ffc8de
DIST libsigrok-0.5.2.tar.gz 1779465 BLAKE2B fc6fdde1054e9ac50bc42249c34b3dbfff1e89d77f0db5a8762e52fcf2ea5ea69b2defcf1cde4ed7b1edd1e21770002ed661a470c8d666904daa48a84a2bbfc5 SHA512 cf673dad6280302d69050c29490621f66c6d6a73932d019a53ec3501316d3f2e23e7667a04f866dbe6ed73f86a63de73d2173e2b6cea563631d705e06f887092
-EBUILD libsigrok-0.5.2-r5.ebuild 3509 BLAKE2B ed3a3abdca28db5b1f4e6c0da4994e6273d4d6d9a0401d7a9c018b4fdeeb7077f228d2a9ea46bf8b0aef6dc4c1d8b41090c8b2f059f0f8261bd7bdf168fc2c22 SHA512 c0484adf935f8087ad62b24000e01902a0c49892a3f6deeceed92da73582603e2c1b59127fed85807d7b650e104a58957eb95e500601c10dae3b19bcfe015a37
-EBUILD libsigrok-9999.ebuild 3329 BLAKE2B 4f3a222ed15a2a2b057b7fa65114b2a44bc3741e3d7e9b01d44d517421954a972be2b0eb9790913124d7a53d3fba7595e5d599f3114484a02ceb0a2b08c0d137 SHA512 e10bab831369b9fbf2ad20366fc59eec2dacb77787ec2cbe3d4b249de4a0dae3004a18f1597d19d97d7ba914996c1c2f8aa5c880953844b5db070200a86703da
+EBUILD libsigrok-0.5.2-r5.ebuild 4286 BLAKE2B 6a3413121a1b071d5ae32756a89a3f3b796499b19c044e5835c3cc11b52af622754971d795e6c01daf31195b86990a9a0aa8414d39877f2bb7fa82d61404bdc5 SHA512 bee3e7f000527bc58ea6434554aa36e27890021a673172531bd0c59d6450e64ef86ab8660eea1c6d6d4a1dca2466ab4e0198c85eff2aa007b6f26d51e01cffc8
+EBUILD libsigrok-9999.ebuild 4065 BLAKE2B d97ff86bb9d4ca1ca39d6bccd39c4b4170ea2ff821bcaaf3534dc60545cb2cfacdeae5426c1a56ee0d6e73b974ef211674eff54d3887c5a55df4e429efd66016 SHA512 a2e5a32916bf8e442aa3b8f95e04c8b0a8eb151cfc66773760af16fd0672b265063c1c134f3071a03d31af547531649bdf458b6f736dbc7bfc4811290a03c48b
MISC metadata.xml 886 BLAKE2B cb7cece1f79a4affb612e55f147eb93895a805e43aed6bbabfed2e3b925b0714d64651c00294da2742f8c09ce9984a58888b89025d73712400c8bd026296b2cb SHA512 79c9697b3fe6954108cb60ae79c06cee280ef6d73bcd9e35ab148750a4fa55c8e5118c21cdb4e3ae009d4c160a26c98132448476ef90ac6d7a19a79138c3b2f6
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 000000000000..808227a2fffb
--- /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 <anatol.pomozov@gmail.com>
+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 <anatol.pomozov@gmail.com>
+---
+ 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-r5.ebuild b/sci-libs/libsigrok/libsigrok-0.5.2-r5.ebuild
index 61b96e87fe2a..29150532d1a4 100644
--- a/sci-libs/libsigrok/libsigrok-0.5.2-r5.ebuild
+++ b/sci-libs/libsigrok/libsigrok-0.5.2-r5.ebuild
@@ -5,10 +5,13 @@ EAPI="8"
PYTHON_COMPAT=( python3_{10..13} )
-inherit autotools python-r1 java-pkg-opt-2 udev xdg-utils
+USE_RUBY="ruby31 ruby32"
+RUBY_OPTIONAL="yes"
+
+inherit autotools python-r1 java-pkg-opt-2 ruby-ng udev xdg-utils
if [[ ${PV} == *9999* ]]; then
- EGIT_REPO_URI="git://sigrok.org/${PN}"
+ EGIT_REPO_URI="https://github.com/sigrokproject/${PN}.git"
inherit git-r3
else
SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"
@@ -20,9 +23,10 @@ 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"
+IUSE="bluetooth +cxx ftdi hidapi java parport python ruby serial static-libs test +udev usb"
REQUIRED_USE="java? ( cxx )
- python? ( cxx ${PYTHON_REQUIRED_USE} )"
+ python? ( cxx ${PYTHON_REQUIRED_USE} )
+ ruby? ( cxx || ( $(ruby_get_use_targets) ) )"
RESTRICT="!test? ( test )"
@@ -39,6 +43,7 @@ LIB_DEPEND="
${PYTHON_DEPS}
>=dev-python/pygobject-3.0.0[${PYTHON_USEDEP}]
)
+ ruby? ( $(ruby_implementations_depend) )
serial? ( >=dev-libs/libserialport-0.1.1[static-libs(+)] )
usb? ( virtual/libusb:1[static-libs(+)] )
"
@@ -58,6 +63,7 @@ DEPEND="${LIB_DEPEND//\[static-libs(+)]}
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
)
+ ruby? ( >=dev-lang/swig-3.0.8 )
test? ( >=dev-libs/check-0.9.4 )
virtual/pkgconfig
"
@@ -68,6 +74,7 @@ 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"
"${FILESDIR}/${P}-check-0.15.patch"
# https://bugs.gentoo.org/878395
"${FILESDIR}/${PN}-0.5.2-swig-4.1.patch"
@@ -77,6 +84,7 @@ PATCHES=(
pkg_setup() {
use python && python_setup
+ use ruby && ruby-ng_pkg_setup
java-pkg-opt-2_pkg_setup
}
@@ -88,7 +96,17 @@ sigrok_src_prepare() {
eautoreconf
}
+each_ruby_prepare() {
+ sigrok_src_prepare
+}
+
src_prepare() {
+ if use ruby; then
+ # copy source to where ruby-ng_src_unpack puts it
+ cp -rl "${S}" "${WORKDIR}"/all || die
+ # ruby-ng_src_prepare calls default by itself
+ ruby-ng_src_prepare
+ fi
default
sigrok_src_prepare
use python && python_copy_sources
@@ -96,6 +114,8 @@ src_prepare() {
sigrok_src_configure() {
econf \
+ --disable-python \
+ --disable-ruby \
$(use_with bluetooth libbluez) \
$(use_with ftdi libftdi) \
$(use_with hidapi libhidapi) \
@@ -110,12 +130,17 @@ sigrok_src_configure() {
each_python_configure() {
cd "${BUILD_DIR}"
- sigrok_src_configure --disable-ruby --enable-python
+ sigrok_src_configure --enable-python
+}
+
+each_ruby_configure() {
+ RUBY="${RUBY}" sigrok_src_configure --enable-ruby
}
src_configure() {
- sigrok_src_configure --disable-ruby --disable-python
+ sigrok_src_configure
use python && python_foreach_impl each_python_configure
+ use ruby && ruby-ng_src_configure
}
each_python_compile() {
@@ -123,9 +148,14 @@ each_python_compile() {
emake python-build
}
+each_ruby_compile() {
+ emake ruby-build
+}
+
src_compile() {
default
use python && python_foreach_impl each_python_compile
+ use ruby && ruby-ng_src_compile
}
src_test() {
@@ -138,9 +168,14 @@ each_python_install() {
python_optimize
}
+each_ruby_install() {
+ emake ruby-install DESTDIR="${D}"
+}
+
src_install() {
default
use python && python_foreach_impl each_python_install
+ use ruby && ruby-ng_src_install
use udev && udev_dorules contrib/*.rules
find "${D}" -name '*.la' -type f -delete || die
}
diff --git a/sci-libs/libsigrok/libsigrok-9999.ebuild b/sci-libs/libsigrok/libsigrok-9999.ebuild
index 951d87e75bb6..908f3fbda84e 100644
--- a/sci-libs/libsigrok/libsigrok-9999.ebuild
+++ b/sci-libs/libsigrok/libsigrok-9999.ebuild
@@ -5,10 +5,13 @@ EAPI="8"
PYTHON_COMPAT=( python3_{10..13} )
-inherit python-r1 java-pkg-opt-2 udev xdg-utils
+USE_RUBY="ruby31 ruby32"
+RUBY_OPTIONAL="yes"
+
+inherit python-r1 java-pkg-opt-2 ruby-ng udev xdg-utils
if [[ ${PV} == *9999* ]]; then
- EGIT_REPO_URI="git://sigrok.org/${PN}"
+ EGIT_REPO_URI="https://github.com/sigrokproject/${PN}.git"
inherit git-r3 autotools
else
SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"
@@ -20,9 +23,10 @@ HOMEPAGE="https://sigrok.org/wiki/Libsigrok"
LICENSE="GPL-3"
SLOT="0/9999"
-IUSE="bluetooth +cxx ftdi hidapi java nettle parport python serial static-libs test +udev usb"
+IUSE="bluetooth +cxx ftdi hidapi java nettle parport python ruby serial static-libs test +udev usb"
REQUIRED_USE="java? ( cxx )
- python? ( cxx ${PYTHON_REQUIRED_USE} )"
+ python? ( cxx ${PYTHON_REQUIRED_USE} )
+ ruby? ( cxx || ( $(ruby_get_use_targets) ) )"
RESTRICT="!test? ( test )"
@@ -40,6 +44,7 @@ LIB_DEPEND="
${PYTHON_DEPS}
>=dev-python/pygobject-3.0.0[${PYTHON_USEDEP}]
)
+ ruby? ( $(ruby_implementations_depend) )
serial? ( >=dev-libs/libserialport-0.1.1[static-libs(+)] )
usb? ( virtual/libusb:1[static-libs(+)] )
"
@@ -59,6 +64,7 @@ DEPEND="${LIB_DEPEND//\[static-libs(+)]}
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/setuptools[${PYTHON_USEDEP}]
)
+ ruby? ( >=dev-lang/swig-3.0.8 )
test? ( >=dev-libs/check-0.9.4 )
virtual/pkgconfig
"
@@ -67,6 +73,7 @@ S="${WORKDIR}"/${P}
pkg_setup() {
use python && python_setup
+ use ruby && ruby-ng_pkg_setup
java-pkg-opt-2_pkg_setup
}
@@ -78,7 +85,17 @@ sigrok_src_prepare() {
[[ ${PV} == *9999* ]] && eautoreconf
}
+each_ruby_prepare() {
+ sigrok_src_prepare
+}
+
src_prepare() {
+ if use ruby; then
+ # copy source to where ruby-ng_src_unpack puts it
+ cp -rl "${S}" "${WORKDIR}"/all || die
+ # ruby-ng_src_prepare calls default by itself
+ ruby-ng_src_prepare
+ fi
default
sigrok_src_prepare
use python && python_copy_sources
@@ -86,6 +103,8 @@ src_prepare() {
sigrok_src_configure() {
econf \
+ --disable-python \
+ --disable-ruby \
$(use_with bluetooth libbluez) \
$(use_with ftdi libftdi) \
$(use_with hidapi libhidapi) \
@@ -101,12 +120,17 @@ sigrok_src_configure() {
each_python_configure() {
cd "${BUILD_DIR}"
- sigrok_src_configure --disable-ruby --enable-python
+ sigrok_src_configure --enable-python
+}
+
+each_ruby_configure() {
+ RUBY="${RUBY}" sigrok_src_configure --enable-ruby
}
src_configure() {
- sigrok_src_configure --disable-ruby --disable-python
+ sigrok_src_configure
use python && python_foreach_impl each_python_configure
+ use ruby && ruby-ng_src_configure
}
each_python_compile() {
@@ -114,9 +138,14 @@ each_python_compile() {
emake python-build
}
+each_ruby_compile() {
+ emake ruby-build
+}
+
src_compile() {
default
use python && python_foreach_impl each_python_compile
+ use ruby && ruby-ng_src_compile
}
src_test() {
@@ -129,9 +158,14 @@ each_python_install() {
python_optimize
}
+each_ruby_install() {
+ emake ruby-install DESTDIR="${D}"
+}
+
src_install() {
default
use python && python_foreach_impl each_python_install
+ use ruby && ruby-ng_src_install
use udev && udev_dorules contrib/*.rules
find "${D}" -name '*.la' -type f -delete || die
}