unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] Fix h5py.
Date: Thu, 8 Oct 2015 13:49:52 +0200	[thread overview]
Message-ID: <idj1td537hb.fsf@bimsb-sys02.mdc-berlin.net> (raw)
In-Reply-To: <idj37xl37pv.fsf@bimsb-sys02.mdc-berlin.net>

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

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

... and that’s done in this patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-python-h5py-Fix-path-to-hdf5-library.patch --]
[-- Type: text/x-patch, Size: 1864 bytes --]

From 9a503dbcda17186161d040531b06a0e7cf9b2a0f Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Thu, 8 Oct 2015 13:34:11 +0200
Subject: [PATCH 2/2] gnu: python-h5py: Fix path to hdf5 library.

* gnu/packages/python.scm (python-h5py)[arguments]: Add "fix-hdf5-paths"
  phase.
---
 gnu/packages/python.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 1865477..cdf0207 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -596,13 +596,28 @@ and verifies that it matches the intended target hostname.")
        (base32
         "0q4f9l8grf6pwp64xbv8bmyxx416s7h4522nnxac056ap3savbps"))))
     (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; no test target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-hdf5-paths
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((prefix (assoc-ref inputs "hdf5")))
+              (substitute* "setup_build.py"
+                (("\\['/opt/local/lib', '/usr/local/lib'\\]")
+                 (string-append "['" prefix "/lib" "']"))
+                (("'/opt/local/include', '/usr/local/include'")
+                 (string-append "'" prefix "/include" "'")))
+              (substitute* "setup_configure.py"
+                (("\\['/usr/local/lib', '/opt/local/lib'\\]")
+                 (string-append "['" prefix "/lib" "']")))
+              #t))))))
     (propagated-inputs
      `(("python-numpy" ,python-numpy)))
     (inputs
      `(("hdf5" ,hdf5)))
     (native-inputs
      `(("python-cython" ,python-cython)))
-    (arguments `(#:tests? #f)) ; no test target
     (home-page "http://www.h5py.org/")
     (synopsis "Read and write HDF5 files from Python")
     (description
-- 
2.1.0


  reply	other threads:[~2015-10-08 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 11:44 [PATCH] Fix h5py Ricardo Wurmus
2015-10-08 11:49 ` Ricardo Wurmus [this message]
2015-10-08 14:56   ` Ludovic Courtès
2015-10-08 11:52 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=idj1td537hb.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).