unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix h5py.
@ 2015-10-08 11:44 Ricardo Wurmus
  2015-10-08 11:49 ` Ricardo Wurmus
  2015-10-08 11:52 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2015-10-08 11:44 UTC (permalink / raw)
  To: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-python-h5py-python2-h5py-Correct-inputs.patch --]
[-- Type: text/x-patch, Size: 1837 bytes --]

From 5f368af582d3586a7b4e3a353d9bbd75eeb83a61 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-08 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 11:44 [PATCH] Fix h5py Ricardo Wurmus
2015-10-08 11:49 ` Ricardo Wurmus
2015-10-08 14:56   ` Ludovic Courtès
2015-10-08 11:52 ` Ludovic Courtès

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