diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2020-07-06 00:06:48 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2020-07-06 20:15:24 +0200 |
commit | 2d67ebbf58c156b92a1ef37bec35e3d780a5f746 (patch) | |
tree | 2b61056cc186de0545fc4bb0cc29b3dd6e1f3da0 /sci-libs/libsigrok | |
parent | sci-libs/libsigrok: Drop 0.4.0, 0.5.1 (diff) | |
download | gentoo-2d67ebbf58c156b92a1ef37bec35e3d780a5f746.tar.gz gentoo-2d67ebbf58c156b92a1ef37bec35e3d780a5f746.tar.bz2 gentoo-2d67ebbf58c156b92a1ef37bec35e3d780a5f746.zip |
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 <asturm@gentoo.org>
Diffstat (limited to 'sci-libs/libsigrok')
-rw-r--r-- | sci-libs/libsigrok/files/libsigrok-0.5.2-swig-4.patch | 37 | ||||
-rw-r--r-- | sci-libs/libsigrok/libsigrok-0.5.2.ebuild | 3 |
2 files changed, 40 insertions, 0 deletions
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 000000000000..3c5dd85a5100 --- /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 <uwe@hermann-uwe.de> +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<sigrok::HardwareDevice>, HardwareDevice) + "java.util.Map<JKey, JValue>" + + %typemap(javain, ++/* SWIG 4.0.0 changed the std::map wrappers in an incompatible way. */ ++#if SWIG_VERSION >= 0x040000 ++ pre=" $javaclassname temp$javainput = new $javaclassname(); ++ for (java.util.Map.Entry<JKey, JValue> 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<JKey, JValue> 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 ba30bc5fe2d2..03ae49481eda 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 |