Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-06-11 Thread Kei Kebreau
Kei Kebreau  writes:

> Kei Kebreau  writes:
>
>> 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.
>
> FYI, this is an updated patch that bypasses the Python interface issue
> and runs into an issue with R.

I haven't been able to crack the issue with Shogun and R.  The attached
patch explicitly disables the R interface which allows shogun to build
properly while the R problem is resolved.

From a364bc3122ac9d3903a0d84a579d477334a59ac8 Mon Sep 17 00:00:00 2001
From: Kei Kebreau 
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)[arguments]: Add
'fix-python-compiler-flags' phase.  Disable R interface.
[inputs]: Replace swig with swig-git.  Remove r-minimal.
---
 gnu/packages/machine-learning.scm | 13 +---
 gnu/packages/swig.scm | 34 +++
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index 15e4d4574..65dd9d31b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -469,6 +469,13 @@ sample proximities between pairs of cases.")
(mkdir-p rxcpp-dir)
(install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
#t)))
+ (add-after 'unpack 'fix-python-compiler-flags
+   (lambda _
+ ;; This prevents a set of function conversions from stopping the
+ ;; build with an error.
+ (substitute* "src/interfaces/python/CMakeLists.txt"
+   (("Wno-c\\+\\+11-narrowing") "fpermissive"))
+ #t))
  (add-before 'build 'set-HOME
;; $HOME needs to be set at some point during the build phase
(lambda _ (setenv "HOME" "/tmp") #t)))
@@ -482,13 +489,13 @@ sample proximities between pairs of cases.")
  ;;"-DINTERFACE_LUA=ON"  ;fails because lua doesn't build 
pkgconfig file
  "-DINTERFACE_OCTAVE=ON"
  "-DINTERFACE_PYTHON=ON"
- "-DINTERFACE_R=ON")))
+ "-DINTERFACE_R=OFF")))  ;temporarily off due to unknown issues.
 (inputs
  `(("python" ,python)
("numpy" ,python-numpy)
-   ("r-minimal" ,r-minimal)
+   ;;("r-minimal" ,r-minimal) ;re-enable when interface issues are resolved
("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



signature.asc
Description: PGP signature


Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-06-07 Thread Kei Kebreau
Kei Kebreau  writes:

> 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.

FYI, this is an updated patch that bypasses the Python interface issue
and runs into an issue with R.

From f4fa63249bec73a385bba1b95bc53cac8f96420c Mon Sep 17 00:00:00 2001
From: Kei Kebreau 
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)[arguments]: Add
'fix-python-compiler-flags' phase.
[inputs]: Replace swig with swig-git.
---
 gnu/packages/machine-learning.scm |  9 +++-
 gnu/packages/swig.scm | 34 +++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index 15e4d4574..d992a2fe5 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -469,6 +469,13 @@ sample proximities between pairs of cases.")
(mkdir-p rxcpp-dir)
(install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
#t)))
+ (add-after 'unpack 'fix-python-compiler-flags
+   (lambda _
+ ;; This prevents a set of function conversions from stopping the
+ ;; build with an error.
+ (substitute* "src/interfaces/python/CMakeLists.txt"
+   (("Wno-c\\+\\+11-narrowing") "fpermissive"))
+ #t))
  (add-before 'build 'set-HOME
;; $HOME needs to be set at some point during the build phase
(lambda _ (setenv "HOME" "/tmp") #t)))
@@ -488,7 +495,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

[ 79%] Linking CXX shared module shogun.so
cd /tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/r && 
/gnu/store/8mycww9vx11vidzka3g5gghwq11alk4w-cmake-3.7.2/bin/cmake -E 
cmake_link_script CMakeFiles/interface_r.dir/link.txt --verbose=1
/gnu/store/cfdn69spjc44x4sd0acrwhxq6yay3rbc-gcc-5.5.0/bin/c++  -fPIC -O0 -g  
-I/gnu/store/42j0p3x4v2gbwqyx6iv1j83qckndm799-r-minimal-3.5.0/lib/R/include -O2 
-g -DNDEBUG  -shared  -o shogun.so 
CMakeFiles/interface_r.dir/shogunR_wrap.cxx.o 
CMakeFiles/interface_r.dir/sg_print_functions.cpp.o  
-L/gnu/store/42j0p3x4v2gbwqyx6iv1j83qckndm799-r-minimal-3.5.0/lib/R/lib 
-Wl,-rpath,/gnu/store/km7w7j4f9qsmnrsag3g94nc6fb20vrxw-shogun-6.1.3/lib:/gnu/store/42j0p3x4v2gbwqyx6iv1j83qckndm799-r-minimal-3.5.0/lib/R/lib
 ../../shogun/libshogun.so.18.0 -lR -lxml2 -lhdf5 -lz -ldl -lm 
Generating shogun.RData
cd /tmp/guix-build-shogun-6.1.3.drv-0/build/src/interfaces/r && echo 

Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-05-31 Thread Kei Kebreau
Mark H Weaver  writes:

> Hi Kei,
>
> Kei Kebreau  writes:
>
>> Mark H Weaver  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 
>> 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.

From deb75abebf74be37d2afedd9e5d8f8b07c65ab06 Mon Sep 17 00:00:00 2001
From: Kei Kebreau 
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.
  

Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-05-30 Thread Mark H Weaver
Hi Kei,

Kei Kebreau  writes:

> Mark H Weaver  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 
> 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



Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-05-30 Thread Kei Kebreau
Mark H Weaver  writes:

> kkebr...@posteo.net (Kei Kebreau) writes:
>
>> kkebreau pushed a commit to branch master
>> in repository guix.
>>
>> commit 3771000f893d4b53e302f5bca07afeba69e76cd4
>> Author: Kei Kebreau 
>> Date:   Fri May 25 22:25:21 2018 -0400
>>
>> gnu: swig: Patch for Octave 4.4.
>
> On the core-updates branch, "guix refresh -l swig" reports that updating
> swig requires 1453 rebuilds.  That's too many, so I reverted it.
>
> Instead, I suggest creating a different 'swig' package for octave that
> inherits from the primary one and adds this patch.
>
> What do you think?
>
>   Mark

I agree that this will work. Is the attached patch something like what
you're thinking?

(Apologies if you get two of these messages; it seems to me like the
first one didn't go through.)

From 475a7698fd4c88ea688cb43499344e65ffaf5b84 Mon Sep 17 00:00:00 2001
From: Kei Kebreau 
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.
---
 gnu/local.mk  |1 +
 gnu/packages/machine-learning.scm |   10 +-
 .../patches/swig-octave-patches.patch | 1119 +
 3 files changed, 1129 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/swig-octave-patches.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7734586f0..895d33012 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1106,6 +1106,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/steghide-fixes.patch\
   %D%/packages/patches/strace-kernel-4.16.patch\
   %D%/packages/patches/superlu-dist-scotchmetis.patch  \
+  %D%/packages/patches/swig-octave-patches.patch   \
   %D%/packages/patches/swish-e-search.patch\
   %D%/packages/patches/swish-e-format-security.patch   \
   %D%/packages/patches/synfigstudio-fix-ui-with-gtk3.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"))
+
 (define-public shogun
   (package
 (name "shogun")
@@ -487,7 +495,7 @@ sample proximities between pairs of cases.")
("numpy" ,python-numpy)
("r-minimal" ,r-minimal)
("octave" ,octave)
-   ("swig" ,swig)
+   ("swig" ,swig-for-octave)
("eigen" ,eigen)
("hdf5" ,hdf5)
("atlas" ,atlas)
diff --git a/gnu/packages/patches/swig-octave-patches.patch 
b/gnu/packages/patches/swig-octave-patches.patch
new file mode 100644
index 0..9fb64a7b1
--- /dev/null
+++ b/gnu/packages/patches/swig-octave-patches.patch
@@ -0,0 +1,1119 @@
+This patch represents the recently added support for Octave version 4.4 found
+here:
+
+https://github.com/swig/swig/commit/12c66f9b7d884020e896ce92b9783bc3bac95d2d
+
+diff -urN swig-3.0.12.old/CHANGES.current swig-3.0.12.new/CHANGES.current
+--- swig-3.0.12.old/CHANGES.current2017-01-27 18:52:02.0 -0500
 swig-3.0.12.new/CHANGES.current2018-05-26 08:40:06.501850058 -0400
+@@ -4,6 +4,14 @@
+ Issue # numbers mentioned below can be found on Github. For more details, add
+ the issue number to the end of the URL: https://github.com/swig/swig/issues/
+ 
++Version 4.0.0 (in progress)
++===
++
++2018-05-12: kwwette
++[Octave] add support for version 4.4
++- Should not introduce any user-visible incompatibilities
++
++
+ Version 3.0.12 (27 Jan 2017)
+ 
+ 
+diff -urN swig-3.0.12.old/Examples/Makefile.in 
swig-3.0.12.new/Examples/Makefile.in
+--- swig-3.0.12.old/Examples/Makefile.in   2017-01-27 18:52:02.0 
-0500
 swig-3.0.12.new/Examples/Makefile.in   2018-05-26 08:39:16.510124553 
-0400
+@@ -463,7 +463,7 @@
+ # -
+ 
+ octave_run:
+-  OCTAVE_HISTFILE=/dev/null $(RUNTOOL) $(OCTAVE) $(OCTAVE_SCRIPT) 
$(RUNPIPE)
++  env OCTAVE_PATH= OCTAVE_HISTFILE=/dev/null $(RUNTOOL) $(OCTAVE) 
$(OCTAVE_SCRIPT) $(RUNPIPE)
+ 
+ # -
+ # Version display
+diff -urN 

Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-05-30 Thread Kei Kebreau
Mark H Weaver  writes:

> kkebr...@posteo.net (Kei Kebreau) writes:
>
>> kkebreau pushed a commit to branch master
>> in repository guix.
>>
>> commit 3771000f893d4b53e302f5bca07afeba69e76cd4
>> Author: Kei Kebreau 
>> Date:   Fri May 25 22:25:21 2018 -0400
>>
>> gnu: swig: Patch for Octave 4.4.
>
> On the core-updates branch, "guix refresh -l swig" reports that updating
> swig requires 1453 rebuilds.  That's too many, so I reverted it.
>
> Instead, I suggest creating a different 'swig' package for octave that
> inherits from the primary one and adds this patch.
>
> What do you think?
>
>   Mark

I agree that this will work. Is the attached patch something like what
you're thinking?
From 475a7698fd4c88ea688cb43499344e65ffaf5b84 Mon Sep 17 00:00:00 2001
From: Kei Kebreau 
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.
---
 gnu/local.mk  |1 +
 gnu/packages/machine-learning.scm |   10 +-
 .../patches/swig-octave-patches.patch | 1119 +
 3 files changed, 1129 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/swig-octave-patches.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7734586f0..895d33012 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1106,6 +1106,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/steghide-fixes.patch\
   %D%/packages/patches/strace-kernel-4.16.patch\
   %D%/packages/patches/superlu-dist-scotchmetis.patch  \
+  %D%/packages/patches/swig-octave-patches.patch   \
   %D%/packages/patches/swish-e-search.patch\
   %D%/packages/patches/swish-e-format-security.patch   \
   %D%/packages/patches/synfigstudio-fix-ui-with-gtk3.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"))
+
 (define-public shogun
   (package
 (name "shogun")
@@ -487,7 +495,7 @@ sample proximities between pairs of cases.")
("numpy" ,python-numpy)
("r-minimal" ,r-minimal)
("octave" ,octave)
-   ("swig" ,swig)
+   ("swig" ,swig-for-octave)
("eigen" ,eigen)
("hdf5" ,hdf5)
("atlas" ,atlas)
diff --git a/gnu/packages/patches/swig-octave-patches.patch 
b/gnu/packages/patches/swig-octave-patches.patch
new file mode 100644
index 0..9fb64a7b1
--- /dev/null
+++ b/gnu/packages/patches/swig-octave-patches.patch
@@ -0,0 +1,1119 @@
+This patch represents the recently added support for Octave version 4.4 found
+here:
+
+https://github.com/swig/swig/commit/12c66f9b7d884020e896ce92b9783bc3bac95d2d
+
+diff -urN swig-3.0.12.old/CHANGES.current swig-3.0.12.new/CHANGES.current
+--- swig-3.0.12.old/CHANGES.current2017-01-27 18:52:02.0 -0500
 swig-3.0.12.new/CHANGES.current2018-05-26 08:40:06.501850058 -0400
+@@ -4,6 +4,14 @@
+ Issue # numbers mentioned below can be found on Github. For more details, add
+ the issue number to the end of the URL: https://github.com/swig/swig/issues/
+ 
++Version 4.0.0 (in progress)
++===
++
++2018-05-12: kwwette
++[Octave] add support for version 4.4
++- Should not introduce any user-visible incompatibilities
++
++
+ Version 3.0.12 (27 Jan 2017)
+ 
+ 
+diff -urN swig-3.0.12.old/Examples/Makefile.in 
swig-3.0.12.new/Examples/Makefile.in
+--- swig-3.0.12.old/Examples/Makefile.in   2017-01-27 18:52:02.0 
-0500
 swig-3.0.12.new/Examples/Makefile.in   2018-05-26 08:39:16.510124553 
-0400
+@@ -463,7 +463,7 @@
+ # -
+ 
+ octave_run:
+-  OCTAVE_HISTFILE=/dev/null $(RUNTOOL) $(OCTAVE) $(OCTAVE_SCRIPT) 
$(RUNPIPE)
++  env OCTAVE_PATH= OCTAVE_HISTFILE=/dev/null $(RUNTOOL) $(OCTAVE) 
$(OCTAVE_SCRIPT) $(RUNPIPE)
+ 
+ # -
+ # Version display
+diff -urN swig-3.0.12.old/Examples/octave/module_load/runme.m 
swig-3.0.12.new/Examples/octave/module_load/runme.m
+--- 

Re: 04/05: gnu: swig: Patch for Octave 4.4.

2018-05-30 Thread Mark H Weaver
kkebr...@posteo.net (Kei Kebreau) writes:

> kkebreau pushed a commit to branch master
> in repository guix.
>
> commit 3771000f893d4b53e302f5bca07afeba69e76cd4
> Author: Kei Kebreau 
> Date:   Fri May 25 22:25:21 2018 -0400
>
> gnu: swig: Patch for Octave 4.4.

On the core-updates branch, "guix refresh -l swig" reports that updating
swig requires 1453 rebuilds.  That's too many, so I reverted it.

Instead, I suggest creating a different 'swig' package for octave that
inherits from the primary one and adds this patch.

What do you think?

  Mark