unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kei Kebreau <kkebreau@posteo.net>
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: 04/05: gnu: swig: Patch for Octave 4.4.
Date: Thu, 31 May 2018 13:59:24 -0400	[thread overview]
Message-ID: <876033wvsz.fsf@posteo.net> (raw)
In-Reply-To: <877enl0ycc.fsf@netris.org> (Mark H. Weaver's message of "Wed, 30 May 2018 14:53:23 -0400")


[-- Attachment #1.1: Type: text/plain, Size: 3437 bytes --]

Mark H Weaver <mhw@netris.org> writes:

> Hi Kei,
>
> Kei Kebreau <kkebreau@posteo.net> writes:
>
>> Mark H Weaver <mhw@netris.org> writes:
>>
>>> Instead, I suggest creating a different 'swig' package for octave that
>>> inherits from the primary one and adds this patch.
>>
>> I agree that this will work. Is the attached patch something like what
>> you're thinking?
>
> Yes, although I have some suggestions:
>
>> From 475a7698fd4c88ea688cb43499344e65ffaf5b84 Mon Sep 17 00:00:00 2001
>> From: Kei Kebreau <kkebreau@posteo.net>
>> Date: Wed, 30 May 2018 08:34:42 -0400
>> Subject: [PATCH] gnu: shogun: Use a patched swig for Octave 4.4.
>>
>> * gnu/packages/machine-learning.scm (swig-for-octave): New variable
>> * gnu/packages/machine-learning.scm (shogun)[inputs]: Replace swig with
>> swig-for-octave.
>> * gnu/packages/patches/swig-octave-patches.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Register patch.
> [...]
>> diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
>> index e135ee0ee..4d54584a7 100644
>> --- a/gnu/packages/machine-learning.scm
>> +++ b/gnu/packages/machine-learning.scm
>> @@ -365,6 +365,14 @@ value imputation, classifier creation, generalization error estimation and
>>  sample proximities between pairs of cases.")
>>      (license license:gpl3+)))
>>  
>> +(define swig-for-octave
>> +  (package/inherit swig
>> +    (name (string-append (package-name swig) "-for-octave"))
>> +    (source
>> +     (origin
>> +       (inherit (package-source swig))
>> +       (patches (search-patches "swig-octave-patches.patch"))))))
>
> For the patches field, how about something like this:
>
>    (patches (append (origin-patches (package-source swig))
>                     (search-patches "swig-octave-patches.patch")))
>
> so if someone adds a patch to swig, it will automatically get picked up
> by this one too.
>
> Please add a comment above the 'swig-for-octave' definition explaining
> what it's for.  I was confused at first that you didn't change the
> octave definition, but now I guess that it's for other packages that
> wish to use octave via swig, or something along those lines?  It should
> be good to explain in a comment.
>
> Also, I think it would be better to put the 'swig-for-octave' definition
> immediately after the one for 'swig', so that it's more likely to be
> noticed by people working on swig.  This package has more connection to
> swig than it does to shogun.  It has no direct connection to 'shogun'
> except that shogun is currently the only user of it.
>
> Another question: instead of adding the patch, how about changing the
> origin to build from a git checkout?  The advantage of that is that it
> requires less trust from users.  I look at this big patch and I wonder
> if I should check to make sure it matches what upstream has (I didn't).
> If it's a git checkout, there's less trust needed.  It would also make
> later upgrades easier.
>
> It might also be better to call the package "swig-git" or something,
> dunno.
>
> What do you think?  Thanks for working on it.
>
>       Mark

Other than Shogun's Python/SWIG-related build failure (attached), this
patch seems to work fairly well. There appears to be an upstream issue
related to the invalid conversion mentioned in the build failure. I'm
keeping an eye on it for any new developments.


[-- Attachment #1.2: 0001-gnu-shogun-Use-a-patched-swig-for-Octave-4.4.patch --]
[-- Type: text/plain, Size: 3036 bytes --]

From deb75abebf74be37d2afedd9e5d8f8b07c65ab06 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kkebreau@posteo.net>
Date: Wed, 30 May 2018 08:34:42 -0400
Subject: [PATCH] gnu: shogun: Use a patched swig for Octave 4.4.

* gnu/packages/swig.scm (swig-git): New variable
* gnu/packages/machine-learning.scm (shogun)[inputs]: Replace swig with
swig-git.
---
 gnu/packages/machine-learning.scm |  2 +-
 gnu/packages/swig.scm             | 34 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index e135ee0ee..bc618bad2 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -487,7 +487,7 @@ sample proximities between pairs of cases.")
        ("numpy" ,python-numpy)
        ("r-minimal" ,r-minimal)
        ("octave" ,octave)
-       ("swig" ,swig)
+       ("swig" ,swig-git)
        ("eigen" ,eigen)
        ("hdf5" ,hdf5)
        ("atlas" ,atlas)
diff --git a/gnu/packages/swig.scm b/gnu/packages/swig.scm
index b931db412..3a1139dbb 100644
--- a/gnu/packages/swig.scm
+++ b/gnu/packages/swig.scm
@@ -20,8 +20,12 @@
 (define-module (gnu packages swig)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix licenses)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages bison)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages boost)
@@ -74,3 +78,33 @@ you tailor the wrapping process to suit your application.")
 
     ;; See http://www.swig.org/Release/LICENSE for details.
     (license gpl3+)))
+
+;; This package contains upstream fixes that haven't been released as part of a
+;; stable version of SWIG.  This is necessary for software that uses SWIG to
+;; compile the correct and up-to-date programming language interfaces.
+(define-public swig-git
+  (let ((commit "12c66f9b7d884020e896ce92b9783bc3bac95d2d")
+        (revision "1"))
+    (package/inherit swig
+      (name "swig-git")
+      (version (git-version "4.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/swig/swig.git")
+               (commit commit)))
+         (sha256 (base32 "1367y47kdkly9cwyp4d60cm5d660am83g4p52k1hmzvimghwgvlp"))
+         (file-name (git-file-name name version))))
+      (arguments
+       (substitute-keyword-arguments (package-arguments swig)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'unpack 'autogen
+               (lambda _
+                 (invoke "sh" "autogen.sh")))))))
+      (native-inputs
+       `(("autoconf" ,autoconf)
+         ("automake" ,automake)
+         ("bison" ,bison)
+         ,@(package-native-inputs swig))))))
-- 
2.17.1


[-- Attachment #1.3: shogun-build-failure.txt --]
[-- Type: text/plain, Size: 10244 bytes --]

make -f src/interfaces/python/CMakeFiles/_interface_python.dir/build.make src/interfaces/python/CMakeFiles/_interface_python.dir/build
make[2]: Entering directory '/tmp/guix-build-shogun-6.1.3.drv-0/build'
[ 79%] Building CXX object src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o
cd /tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python && /gnu/store/cfdn69spjc44x4sd0acrwhxq6yay3rbc-gcc-5.5.0/bin/c++   -D_interface_python_EXPORTS -I/tmp/guix-build-shogun-6.1.3.drv-0/shogun-6.1.3/src -I/tmp/guix-build-shogun-6.1.3.drv-0/build/src -I/tmp/guix-build-shogun-6.1.3.drv-0/shogun-6.1.3/src/gpl -I/gnu/store/3lkypf5wnsnvkaidhw0pv7k3yjfh1r9g-python-3.6.3/include/python3.6m -I/gnu/store/3jmrg9f7l46q997wg46qkaqdjslb8ljb-python-numpy-1.14.3/lib/python3.6/site-packages/numpy/core/include -isystem /gnu/store/d2yy1vhcp0809wnsc91ah6rdvwyfs663-eigen-3.3.4/include/eigen3 -isystem /gnu/store/5s9am1dgn83wj5q5kwfcasqws8zd85zz-rxcpp-4.0.0 -I/gnu/store/mv9m6bxdhijhlfvxpja3km6v599b4pv5-libxml2-2.9.7/include/libxml2 -I/gnu/store/27jrvwbg5xa9la6jwnqz6ys4k7pfyykl-hdf5-1.8.19/include  -O0 -g  -Wno-c++11-narrowing -O2 -g -DNDEBUG -fPIC   -std=c++11 -o CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o -c /tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx
In file included from /gnu/store/3jmrg9f7l46q997wg46qkaqdjslb8ljb-python-numpy-1.14.3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816:0,
                 from /gnu/store/3jmrg9f7l46q997wg46qkaqdjslb8ljb-python-numpy-1.14.3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /gnu/store/3jmrg9f7l46q997wg46qkaqdjslb8ljb-python-numpy-1.14.3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from /tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:6738:
/gnu/store/3jmrg9f7l46q997wg46qkaqdjslb8ljb-python-numpy-1.14.3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:638365:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:638599:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:638833:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:639067:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:639301:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:639535:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:640003:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:640237:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:640471:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:675972:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:676216:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:676460:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:676704:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:676948:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:677192:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:677436:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:677680:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:677924:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:685107:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:685336:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:685797:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:686017:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, Py_ssize_t, bool) {aka _object* (*)(_object*, long int, bool)}’ to ‘ssizeargfunc {aka _object* (*)(_object*, long int)}’ [-fpermissive]
 };
 ^
/tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/python/shogunPYTHON_wrap.cxx:727445:1: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, bool) {aka _object* (*)(_object*, _object*, bool)}’ to ‘binaryfunc {aka _object* (*)(_object*, _object*)}’ [-fpermissive]
 };
 ^
cc1plus: warning: unrecognized command line option ‘-Wno-c++11-narrowing’
make[2]: *** [src/interfaces/python/CMakeFiles/_interface_python.dir/build.make:77: src/interfaces/python/CMakeFiles/_interface_python.dir/shogunPYTHON_wrap.cxx.o] Error 1
make[2]: Leaving directory '/tmp/guix-build-shogun-6.1.3.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:284: src/interfaces/python/CMakeFiles/_interface_python.dir/all] Error 2
make[1]: Leaving directory '/tmp/guix-build-shogun-6.1.3.drv-0/build'
make: *** [Makefile:153: all] Error 2
phase `build' failed after 3994.4 seconds
builder for `/gnu/store/qyc9xzcj7dsljw3gxb5rhm7bx2w7g50z-shogun-6.1.3.drv' failed with exit code 1
@ build-failed /gnu/store/qyc9xzcj7dsljw3gxb5rhm7bx2w7g50z-shogun-6.1.3.drv - 1 builder for `/gnu/store/qyc9xzcj7dsljw3gxb5rhm7bx2w7g50z-shogun-6.1.3.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/qyc9xzcj7dsljw3gxb5rhm7bx2w7g50z-shogun-6.1.3.drv' failed

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-05-31 17:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180529222049.16826.20591@vcs0.savannah.gnu.org>
     [not found] ` <20180529222052.5A8DA20537@vcs0.savannah.gnu.org>
2018-05-30  6:25   ` 04/05: gnu: swig: Patch for Octave 4.4 Mark H Weaver
2018-05-30 14:49     ` Kei Kebreau
2018-05-30 14:49     ` Kei Kebreau
2018-05-30 18:53       ` Mark H Weaver
2018-05-31 17:59         ` Kei Kebreau [this message]
2018-06-07 15:30           ` Kei Kebreau
2018-06-11 16:54             ` Kei Kebreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876033wvsz.fsf@posteo.net \
    --to=kkebreau@posteo.net \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).