Add sampl_t and lsaml_t array_class()es to comedi.i.
authorW. Trevor King <wking@drexel.edu>
Sat, 18 Dec 2010 20:25:08 +0000 (15:25 -0500)
committerW. Trevor King <wking@drexel.edu>
Sat, 18 Dec 2010 20:39:08 +0000 (15:39 -0500)
sci-libs/comedilib/Manifest
sci-libs/comedilib/comedilib-9999.ebuild
sci-libs/comedilib/files/comedilib-9999-comedi.i.patch [new file with mode: 0644]

index 5af2a5a17db6340170b0b3927fafc655cc837d2a..eaf1f97496571582d976d3eccef1f0baea76806c 100644 (file)
@@ -1,4 +1,5 @@
+AUX comedilib-9999-comedi.i.patch 919 RMD160 f4302074d6fe2a0a75eea2ab329f2067d479e7e1 SHA1 75b80d40bf5363bd1478fb8516f10bdc78c83276 SHA256 ef975b802a94330d60d607b79b2b330106d7ef841bdeb168e84769d298d306cd
 AUX comedilib-9999-demo-Makefile.patch 2505 RMD160 76278a724696a5fc3f4fb9e1b297018b6ce83953 SHA1 bc3401ed2c69ac87144621eba6bbe825b16e679f SHA256 25fd857769c8c5390289db546cd8e7686372edcdbdea0ffd989b45689a8ba6b1
-EBUILD comedilib-9999.ebuild 3666 RMD160 4c096847ec57306a51af6dc3dc0ff446608b68ca SHA1 2d038c231991b90bebbfc06d8632df1c00fa3bdf SHA256 873b8bb13820b9f6872d3de3b091da0cac9546d5f9ed26ac8b358aa5a4fb6b8b
+EBUILD comedilib-9999.ebuild 3708 RMD160 395cdd4bc53ef51908136cd18d78ea7660f55b34 SHA1 6726ccb54e9f4c7b0a4829bffab68d63ab327d48 SHA256 d3a6478b0ce0ded91c1a96b24ed54f161610f9d56546a1b6a82a974ce9502a20
 MISC ChangeLog 1168 RMD160 62c9992630de85e02a25d5a4cc077386211b8859 SHA1 bc9d91fff9c4f05804d564f5e55fd63ed99c3426 SHA256 6766a0d3f76055ed559975a91df6f2876289f129248fa739853da0d2606bec9f
 MISC metadata.xml 247 RMD160 6735f3a5dd2d7a2b70589d1693f35d54291b7147 SHA1 c015969fe50967340dd050a44cb9f8a30b5e34a5 SHA256 9e65060e5f9d0a50d28c7a69d9c27fed6c3037fdd3e420cc276627fde2794f72
index b1263cce2b02611f5f9bbaa33907a97d28ac4192..154ee68606cdef0045584e276caeede678bd5905 100644 (file)
@@ -51,6 +51,7 @@ src_prepare()
        if [ "${PV}" == "9999" ] ; then
                ./autogen.sh
        fi
+       epatch "${FILESDIR}/${P}-comedi.i.patch"
        if use python ; then
                pushd "${S}/swig/python" || die "failed to pushd"
                distutils_src_prepare
diff --git a/sci-libs/comedilib/files/comedilib-9999-comedi.i.patch b/sci-libs/comedilib/files/comedilib-9999-comedi.i.patch
new file mode 100644 (file)
index 0000000..42dccdc
--- /dev/null
@@ -0,0 +1,31 @@
+--- a/swig/comedi.i    2010-12-17 19:53:09.000000000 -0500
++++ b/swig/comedi.i    2010-12-18 15:05:18.000000000 -0500
+@@ -55,8 +55,6 @@
+ }
+ %}
+-%array_class(unsigned int, chanlist);
+-
+ #ifdef SWIGRUBY
+ %typemap(argout) comedi_cmd *INOUT(VALUE info) {
+     $result = output_helper($result, $arg);
+@@ -66,3 +64,19 @@
+ %include "comedi.h"
+ %include "comedilib.h"
++/* These typedefs work around limitations in SWIG's array_class().
++ * Without them, you get errors like:
++ * >>> import comedi
++ * >>> cmd = comedi.comedi_cmd_struct()
++ * >>> data = comedi.sampl_array(3)
++ * >>> cmd.data = data
++ * Traceback (most recent call last):
++ *   ...
++ * TypeError: in method 'comedi_cmd_struct_data_set', argument 2 of type 'sampl_t *'
++ */
++typedef unsigned short sampl_array;
++typedef unsigned int lsampl_array;
++
++%array_class(unsigned int, chanlist);
++%array_class(sampl_t, sampl_array);
++%array_class(lsampl_t, lsampl_array);