Re: [PATCH] gnu: Add coda.

2016-10-25 Thread Ludovic Courtès
Thomas Danckaert  skribis:

> From 56ba046e6c176e8f1109bb28ab75a586daa287db Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert 
> Date: Tue, 25 Oct 2016 10:56:46 +0200
> Subject: [PATCH] gnu: coda: Remove bundled libraries.
>
> * gnu/packages/maths.scm (coda): Remove bundled libraries.
> [source]: Add patch and snippet to remove bundled zlib, pcre and expat.
> [inputs]: Add system zlib, pcre and expat.
> * gnu/packages/patches/coda-use-system-libs.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.

Woow, that was fast!

> +   (snippet ;; Make sure we don't use the bundled software.
> +'(map (lambda (d)
> +(delete-file-recursively (string-append "libcoda/" d) ))
^
I changed ‘map’ to ‘for-each’, to make it clear that this expression is
used for effects, and removed the extra space above.

Pushed, thanks!

Ludo’.



Re: [PATCH] gnu: Add coda.

2016-10-25 Thread Thomas Danckaert
Thanks for applying!

From: l...@gnu.org (Ludovic Courtès)
Subject: Re: [PATCH] gnu: Add coda.
Date: Mon, 24 Oct 2016 23:24:17 +0200

> However I noticed that Coda bundles copies of zlib, pcre, and expat.

I hadn't noticed that. I've attached a patch.

cheers,

Thomas
>From 56ba046e6c176e8f1109bb28ab75a586daa287db Mon Sep 17 00:00:00 2001
From: Thomas Danckaert 
Date: Tue, 25 Oct 2016 10:56:46 +0200
Subject: [PATCH] gnu: coda: Remove bundled libraries.

* gnu/packages/maths.scm (coda): Remove bundled libraries.
[source]: Add patch and snippet to remove bundled zlib, pcre and expat.
[inputs]: Add system zlib, pcre and expat.
* gnu/packages/patches/coda-use-system-libs.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk|  1 +
 gnu/packages/maths.scm  | 13 +--
 gnu/packages/patches/coda-use-system-libs.patch | 46 +
 3 files changed, 58 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/coda-use-system-libs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 51849f4..4ffd37a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -484,6 +484,7 @@ dist_patch_DATA =		\
   %D%/packages/patches/clucene-pkgconfig.patch			\
   %D%/packages/patches/clx-remove-demo.patch			\
   %D%/packages/patches/cmake-fix-tests.patch			\
+  %D%/packages/patches/coda-use-system-libs.patch		\
   %D%/packages/patches/cpio-CVE-2016-2037.patch			\
   %D%/packages/patches/cpufrequtils-fix-aclocal.patch		\
   %D%/packages/patches/cracklib-CVE-2016-6318.patch		\
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2928cb6..70a6212 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -123,18 +123,27 @@ interactive dialogs to guide them.")
(uri (string-append "https://github.com/stcorp/coda/releases/download/";
version "/coda-" version ".tar.gz"))
(sha256
-(base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"
+(base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"))
+   (patches (search-patches "coda-use-system-libs.patch"))
+   (modules '((guix build utils)))
+   (snippet ;; Make sure we don't use the bundled software.
+'(map (lambda (d)
+(delete-file-recursively (string-append "libcoda/" d) ))
+  '("zlib" "pcre" "expat")
 (native-inputs
  `(("fortran" ,gfortran)
("python" ,python)
("python-numpy" ,python-numpy)))
 (inputs
  `(("zlib" ,zlib)
+   ("pcre" ,pcre)
+   ("expat" ,expat)
("hdf4" ,hdf4-alt)
("hdf5" ,hdf5)))
 (build-system gnu-build-system)
 (arguments
- '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python")))
+ '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python"
+   "LIBS= -lz -lpcre -lexpat")))
 (synopsis "A common interface to various earth observation data formats")
 (description
  "The Common Data Access toolbox (CODA) provides a set of interfaces for
diff --git a/gnu/packages/patches/coda-use-system-libs.patch b/gnu/packages/patches/coda-use-system-libs.patch
new file mode 100644
index 000..fbf8441
--- /dev/null
+++ b/gnu/packages/patches/coda-use-system-libs.patch
@@ -0,0 +1,46 @@
+Remove dependencies on bundled zlib, pcre and expat.
+
+diff --git a/Makefile.in b/Makefile.in
+index 4360a26..80f9f59 100644
+--- a/Makefile.in
 b/Makefile.in
+@@ -210,8 +210,7 @@ coda_matlab_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ @BUILD_MATLAB_TRUE@@SUBPACKAGE_MODE_FALSE@	-rpath \
+ @BUILD_MATLAB_TRUE@@SUBPACKAGE_MODE_FALSE@	$(matlabmexexecdir)
+ am__DEPENDENCIES_1 =
+-libcoda_la_DEPENDENCIES = @LTLIBOBJS@ libexpat_internal.la \
+-	libpcre_internal.la libz_internal.la $(am__DEPENDENCIES_1) \
++libcoda_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \
+ 	$(am__DEPENDENCIES_1)
+ am__libcoda_la_SOURCES_DIST = libcoda/coda-ascbin-cursor.c \
+ 	libcoda/coda-ascbin.h libcoda/coda-ascii-cursor.c \
+@@ -306,8 +305,7 @@ libcoda_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ 	$(libcoda_la_LDFLAGS) $(LDFLAGS) -o $@
+ @SUBPACKAGE_MODE_FALSE@am_libcoda_la_rpath = -rpath $(libdir)
+-am__DEPENDENCIES_2 = @LTLIBOBJS@ libexpat_internal.la \
+-	libpcre_internal.la libz_internal.la $(am__DEPENDENCIES_1) \
++am__DEPENDENCIES_2 = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \
+ 	$(am__DEPENDENCIES_1)
+ libcoda_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+ am__libcoda_internal_la_SOURCES_DIST = libcoda/coda-ascbin-cursor.c

Re: [PATCH] gnu: Add coda.

2016-10-24 Thread Ludovic Courtès
Thomas Danckaert  skribis:

> From: l...@gnu.org (Ludovic Courtès)
> Subject: Re: [PATCH] gnu: Add coda.
> Date: Wed, 19 Oct 2016 22:13:42 +0200
>
>>> +(native-search-paths
>>> + (list (search-path-specification
>>> +(variable "PYTHONPATH")
>>> +(files '("lib/python3.4/site-packages")
>>
>> Unless I’m mistaken this is not needed: this ‘native-search-paths’
>> entry
>> belongs in Python itself, not in users of Python.
>
> I used ipython to test the interface, and noticed the PYTHONPATH
> setting was missing.  That's why I added it here.  So probably this
> native-search-paths entry could/should be added to the ipython
> package?

Probably not.  I think the problem is as described in
<http://bugs.gnu.org/22138>.

>>> +(synopsis "Common interface to various earth observation data
>>> formats")
>>> +(description
>>> + "The Common Data Access toolbox (CODA) provides a set of
>>> interfaces for
>>> +reading remote sensing data from earth observation data files.
>>> These
>>> +interfaces consist of command line applications, libraries,
>>> interfaces to
>>> +scientific applications (such as IDL and MATLAB), and interfaces
>>> to
>>
>> Let’s remove MATLAB; we can replace it with Octave if it’s valid.
>
> I removed IDL as well, because it's the same story as Matlab
> (proprietary scripting language for scientific applications).  I don't
> think there's an Octave interface, unless Octave can automatically use
> interfaces written for Matlab (unlikely? I have no experience with
> either).

OK.  ISTR Octave can work with “MEX files”, but I’m no expert.

> From f521132ac56e3ad6f7e6169fa1a0fcd56beb77f6 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert 
> Date: Wed, 19 Oct 2016 11:44:33 +0200
> Subject: [PATCH] gnu: Add coda.
>
> * gnu/packages/maths.scm (coda): New variable.

Applied, thanks!

However I noticed that Coda bundles copies of zlib, pcre, and expat.

Could you send a patch that (1) adds those as inputs and makes sure the
bundled copies are not used (using ‘guix gc --references’ on the
result), and (2) removes the corresponding directories from the source
tree in a ‘snippet’, if possible?

Ludo’.



Re: [PATCH] gnu: Add coda.

2016-10-21 Thread Thomas Danckaert

From: l...@gnu.org (Ludovic Courtès)
Subject: Re: [PATCH] gnu: Add coda.
Date: Wed, 19 Oct 2016 22:13:42 +0200


+(native-search-paths
+ (list (search-path-specification
+(variable "PYTHONPATH")
+(files '("lib/python3.4/site-packages")


Unless I’m mistaken this is not needed: this ‘native-search-paths’ 
entry

belongs in Python itself, not in users of Python.


I used ipython to test the interface, and noticed the PYTHONPATH 
setting was missing.  That's why I added it here.  So probably this 
native-search-paths entry could/should be added to the ipython 
package?


+(synopsis "Common interface to various earth observation data 
formats")

+(description
+ "The Common Data Access toolbox (CODA) provides a set of 
interfaces for
+reading remote sensing data from earth observation data files.  
These
+interfaces consist of command line applications, libraries, 
interfaces to
+scientific applications (such as IDL and MATLAB), and interfaces 
to


Let’s remove MATLAB; we can replace it with Octave if it’s valid.


I removed IDL as well, because it's the same story as Matlab 
(proprietary scripting language for scientific applications).  I 
don't think there's an Octave interface, unless Octave can 
automatically use interfaces written for Matlab (unlikely? I have no 
experience with either).



+(license license:gpl2)))


Version 2 only?  That is, is the “or any later version” wording 
missing

from license headers?


gpl2+, indeed.

I've attached an updated patch.

cheers,

Thomas
>From f521132ac56e3ad6f7e6169fa1a0fcd56beb77f6 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert 
Date: Wed, 19 Oct 2016 11:44:33 +0200
Subject: [PATCH] gnu: Add coda.

* gnu/packages/maths.scm (coda): New variable.
---
 gnu/packages/maths.scm | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 07934e3..c3c5b68 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -113,6 +113,37 @@ interactive dialogs to guide them.")
(license license:gpl3+)
(home-page "http://www.gnu.org/software/c-graph/";)))
 
+(define-public coda
+  (package
+(name "coda")
+(version "2.17.3")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/stcorp/coda/releases/download/";
+   version "/coda-" version ".tar.gz"))
+   (sha256
+(base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"
+(native-inputs
+ `(("fortran" ,gfortran)
+   ("python" ,python)
+   ("python-numpy" ,python-numpy)))
+(inputs
+ `(("zlib" ,zlib)
+   ("hdf4" ,hdf4-alt)
+   ("hdf5" ,hdf5)))
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python")))
+(synopsis "A common interface to various earth observation data formats")
+(description
+ "The Common Data Access toolbox (CODA) provides a set of interfaces for
+reading remote sensing data from earth observation data files.  It consists of
+command line applications and interfaces to the C, Fortran, Python, and Java
+programming languages.")
+(home-page "https://stcorp.nl/coda";)
+(license license:gpl2+)))
+
 (define-public units
   (package
(name "units")
-- 
2.7.4



Re: [PATCH] gnu: Add coda.

2016-10-19 Thread Ludovic Courtès
Thomas Danckaert  skribis:

> This is a C library wich also presents a python interface.  It can be
> used just as well without python, so I've made python only a native
> input, not a regular input.  There's currently a non-determinism issue
> for the python interface, related to
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22533
>
> I also tried to automatically generate the string
> “lib/python3.4/site-packages”, so it's updated automatically when the
> python version changes, but didn't manage to do that (for example I
> tried
>
>   (version-major+minor (package-version python))
>
> but the package variable “python” is not available when the build
> expression is turned into a derivation, as far as I understand
> it?). Advice welcome.

I think this is not needed; see below.

> From edb38dfcc09afdef4279728c84d10688b9d0fc71 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert 
> Date: Wed, 19 Oct 2016 11:44:33 +0200
> Subject: [PATCH] gnu: Add coda.
>
> * gnu/packages/maths.scm (coda): New variable.

[...]

> +(native-search-paths
> + (list (search-path-specification
> +(variable "PYTHONPATH")
> +(files '("lib/python3.4/site-packages")

Unless I’m mistaken this is not needed: this ‘native-search-paths’ entry
belongs in Python itself, not in users of Python.

> +(synopsis "Common interface to various earth observation data formats")
> +(description
> + "The Common Data Access toolbox (CODA) provides a set of interfaces for
> +reading remote sensing data from earth observation data files.  These
> +interfaces consist of command line applications, libraries, interfaces to
> +scientific applications (such as IDL and MATLAB), and interfaces to

Let’s remove MATLAB; we can replace it with Octave if it’s valid.

> +(license license:gpl2)))

Version 2 only?  That is, is the “or any later version” wording missing
from license headers?

Otherwise LGTM.

Could you send an updated patch?

Thank you!

Ludo’.



[PATCH] gnu: Add coda.

2016-10-19 Thread Thomas Danckaert
This is a C library wich also presents a python interface.  It can be 
used just as well without python, so I've made python only a native 
input, not a regular input.  There's currently a non-determinism 
issue for the python interface, related to 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22533


I also tried to automatically generate the string 
“lib/python3.4/site-packages”, so it's updated automatically when the 
python version changes, but didn't manage to do that (for example I 
tried


  (version-major+minor (package-version python))

but the package variable “python” is not available when the build 
expression is turned into a derivation, as far as I understand it?). 
Advice welcome.


Thomas
>From edb38dfcc09afdef4279728c84d10688b9d0fc71 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert 
Date: Wed, 19 Oct 2016 11:44:33 +0200
Subject: [PATCH] gnu: Add coda.

* gnu/packages/maths.scm (coda): New variable.
---
 gnu/packages/maths.scm | 36 
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 07934e3..f28d8b4 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -113,6 +113,42 @@ interactive dialogs to guide them.")
(license license:gpl3+)
(home-page "http://www.gnu.org/software/c-graph/";)))
 
+(define-public coda
+  (package
+(name "coda")
+(version "2.17.3")
+(source
+ (origin
+   (method url-fetch)
+   (uri (string-append "https://github.com/stcorp/coda/releases/download/";
+   version "/coda-" version ".tar.gz"))
+   (sha256
+(base32 "04b9l3wzcix0mnfq77mwnil6cbr8h2mki8myvy0lzn236qcwaq1h"
+(native-inputs
+ `(("fortran" ,gfortran)
+   ("python" ,python)
+   ("python-numpy" ,python-numpy)))
+(inputs
+ `(("zlib" ,zlib)
+   ("hdf4" ,hdf4-alt)
+   ("hdf5" ,hdf5)))
+(build-system gnu-build-system)
+(arguments
+ '(#:configure-flags '("--with-hdf4" "--with-hdf5" "--enable-python")))
+(native-search-paths
+ (list (search-path-specification
+(variable "PYTHONPATH")
+(files '("lib/python3.4/site-packages")
+(synopsis "Common interface to various earth observation data formats")
+(description
+ "The Common Data Access toolbox (CODA) provides a set of interfaces for
+reading remote sensing data from earth observation data files.  These
+interfaces consist of command line applications, libraries, interfaces to
+scientific applications (such as IDL and MATLAB), and interfaces to
+programming languages (such as C, Fortran, Python, and Java).")
+(home-page "https://stcorp.nl/coda";)
+(license license:gpl2)))
+
 (define-public units
   (package
(name "units")
-- 
2.7.4