guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix h5py.


From: Ricardo Wurmus
Subject: [PATCH] Fix h5py.
Date: Thu, 8 Oct 2015 13:44:44 +0200

Hi Guix,

python-h5py is currently broken.

   guix environment --ad-hoc python-2.7.10 python2-h5py
   python
   >>> import h5py
   [weird error]

The immediate reason here is that an Egg archive is built and installed
instead of a directory.  Python doesn’t seem to know how to import
modules whose contents are trapped in an Egg archive (or is this only
the case when setuptools are not in the profile?).

I found that removing ‘python-setuptools’ from the ‘native-inputs’ field
changes the behaviour such that no Egg archive is built and the library
files are installed plainly.

Another problem with h5py was that it didn’t actually build against our
hdf5 library, because it looked for the library and the headers under
‘/opt/local’ and ‘/usr/local’.  I fixed this by adding an additional
build phase.

The commit message is a little ugly, but I think it is correct.  I’m not
a Pythonista but it seems that python-h5py now works fine (at least
there are no weird error messages anymore).

~~ Ricardo

>From 5f368af582d3586a7b4e3a353d9bbd75eeb83a61 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Thu, 8 Oct 2015 13:30:23 +0200
Subject: [PATCH 1/2] gnu: python-h5py, python2-h5py: Correct inputs.

* gnu/packages/python.scm (python-h5py)
  [inputs]: Remove python-cython and python-numpy.
  [propagated-inputs]: New field.
  [native-inputs]: Drop python-setuptools and add python-cython.
  (python2-h5py): Replace "inputs" with "propagated-inputs".
---
 gnu/packages/python.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 46fcb4a..1865477 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -596,12 +596,12 @@ and verifies that it matches the intended target 
hostname.")
        (base32
         "0q4f9l8grf6pwp64xbv8bmyxx416s7h4522nnxac056ap3savbps"))))
     (build-system python-build-system)
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
     (inputs
-     `(("python-cython" ,python-cython)
-       ("python-numpy" ,python-numpy)
-       ("hdf5" ,hdf5)))
+     `(("hdf5" ,hdf5)))
     (native-inputs
-     `(("python-setuptools" ,python-setuptools)))
+     `(("python-cython" ,python-cython)))
     (arguments `(#:tests? #f)) ; no test target
     (home-page "http://www.h5py.org/";)
     (synopsis "Read and write HDF5 files from Python")
@@ -616,11 +616,11 @@ concepts.")
 (define-public python2-h5py
   (let ((h5py (package-with-python2 python-h5py)))
     (package (inherit h5py)
-      (inputs
+      (propagated-inputs
        `(("python2-numpy" ,python2-numpy)
          ,@(alist-delete
             "python-numpy"
-            (package-inputs h5py)))))))
+            (package-propagated-inputs h5py)))))))
 
 (define-public python-lockfile
   (package
-- 
2.1.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]