summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Danckaert <thomas.danckaert@gmail.com>2016-12-22 11:17:44 +0100
committerMarius Bakke <mbakke@fastmail.com>2016-12-23 14:51:56 +0100
commitd205f895caca32f2a0917f5117cea51b5385dc5f (patch)
tree2c916859211b213bc881b5f13566d8f206a597ac
parent4b4ff6938d73d7880014151efd2700c0b1f2b6bb (diff)
downloadguix-d205f895caca32f2a0917f5117cea51b5385dc5f.tar.gz
gnu: Add python-hdf4.
* gnu/packages/python.scm (python-hdf4, python2-hdf4): New variables.

Co-authored-by: Marius Bakke <mbakke@fastmail.com>
-rw-r--r--gnu/packages/python.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2dbd99fadd..4d79285937 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -33,6 +33,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -715,6 +716,51 @@ certificate returned by the server to which a connection has been established,
 and verifies that it matches the intended target hostname.")
     (license license:psfl)))
 
+(define-public python-hdf4
+  (package
+   (name "python-hdf4")
+   (version "0.9")
+   (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri name version))
+      (sha256
+       (base32
+        "1hjiyrxvxk9817qyqky3nar4y3fs4z8wxz0n884zzb5wi6skrjks"))))
+   (build-system python-build-system)
+   (native-inputs `(("nose" ,python-nose)))
+   (propagated-inputs `(("numpy" ,python-numpy)))
+   (inputs
+    `(("hdf4" ,hdf4)
+      ("libjpeg" ,libjpeg)
+      ("zlib" ,zlib)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (replace 'check
+          (lambda _
+            ;; The 'runexamples' script sets PYTHONPATH to CWD, then goes
+            ;; on to import numpy. Somehow this works on their CI system.
+            ;; Let's just manage PYTHONPATH here instead.
+            (substitute* "runexamples.sh"
+              (("export PYTHONPATH=.*") ""))
+            (setenv "PYTHONPATH"
+                    (string-append (getcwd) ":"
+                                   (getenv "PYTHONPATH")))
+            (and (zero? (system* "./runexamples.sh"))
+                 (zero? (system* "nosetests" "-v"))))))))
+   (home-page "https://github.com/fhs/python-hdf4")
+   (synopsis "Python interface to the NCSA HDF4 library")
+   (description
+    "Python-HDF4 is a python wrapper around the NCSA HDF version 4 library,
+which implements the SD (Scientific Dataset), VS (Vdata) and V (Vgroup) API’s.
+NetCDF files can also be read and modified.  Python-HDF4 is a fork of
+@url{http://hdfeos.org/software/pyhdf.php,pyhdf}.")
+   (license license:expat)))
+
+(define-public python2-hdf4
+  (package-with-python2 python-hdf4))
+
 (define-public python-h5py
   (package
     (name "python-h5py")