guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: python-tables: Build cython files from sourc


From: guix-commits
Subject: branch master updated: gnu: python-tables: Build cython files from source.
Date: Wed, 26 Apr 2023 11:03:38 -0400

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 5bfce83dc4 gnu: python-tables: Build cython files from source.
5bfce83dc4 is described below

commit 5bfce83dc4cddfdbb9f4bef06a26dbfe525c2838
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Wed Apr 26 17:01:08 2023 +0200

    gnu: python-tables: Build cython files from source.
    
    * gnu/packages/python-xyz.scm (python-tables)[source]: Remove generated C
    files.
    [arguments]: Remove trailing #T from build phases; use G-expression; 
override
    library directories.
    [inputs]: Add c-blosc and lzo.
---
 gnu/packages/python-xyz.scm | 81 ++++++++++++++++++++++++++-------------------
 1 file changed, 47 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index fb4a36f0b2..d43e8f4f49 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12880,47 +12880,60 @@ tasks, sockets, files, locks, and queues.")
            (for-each delete-file-recursively
                      (find-files "." "__pycache__" #:directories? #t))
            (for-each delete-file (find-files "." "\\.pyc$"))
-           #t))))
+           (for-each delete-file
+                     (list "tables/_comp_bzip2.c"
+                           "tables/_comp_lzo.c"
+                           "tables/hdf5extension.c"
+                           "tables/indexesextension.c"
+                           "tables/linkextension.c"
+                           "tables/lrucacheextension.c"
+                           "tables/tableextension.c"
+                           "tables/utilsextension.c"))))))
     (build-system python-build-system)
     (arguments
-     `(;; FIXME: python-build-system does not pass configure-flags to "build"
-       ;; or "check", so we must override the build and check phases.
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'use-gcc
-           (lambda _
-             (substitute* "setup.py"
-               (("^( +)compiler = new_compiler\\(\\)" line indent)
-                (string-append line
-                               "\n"
-                               indent
-                               "compiler.set_executables(compiler='gcc',"
-                               "compiler_so='gcc',"
-                               "linker_exe='gcc',"
-                               "linker_so='gcc -shared')")))
-             #t))
-         (add-after 'unpack 'disable-tuning
-           (lambda _
-             (substitute* "setup.py"
-               (("cpu_flags = .*")
-                "cpu_flags = ['sse2']\n"))
-             #t))
-         (replace 'build
-           (lambda* (#:key inputs #:allow-other-keys)
-             (invoke "python" "setup.py" "build"
-                     (string-append "--hdf5="
-                                    (assoc-ref inputs "hdf5")))))
-         (replace 'check
-           (lambda* (#:key inputs #:allow-other-keys)
-             (invoke "python" "setup.py" "check"
-                     (string-append "--hdf5="
-                                    (assoc-ref inputs "hdf5"))))))))
+     (list
+      #:phases
+      ;; FIXME: python-build-system does not pass configure-flags to "build"
+      ;; or "check", so we must override the build and check phases.
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-gcc
+            (lambda _
+              (substitute* "setup.py"
+                (("lib_dirs = \\[\\]")
+                 (string-append "lib_dirs = ["
+                                "'" #$(this-package-input "hdf5") "/lib',"
+                                "'" #$(this-package-input "bzip2") "/lib',"
+                                "'" #$(this-package-input "c-blosc") "/lib',"
+                                "]"))
+                (("^( +)compiler = new_compiler\\(\\)" line indent)
+                 (string-append line
+                                "\n"
+                                indent
+                                "compiler.set_executables(compiler='gcc',"
+                                "compiler_so='gcc',"
+                                "linker_exe='gcc',"
+                                "linker_so='gcc -shared')")))))
+          (add-after 'unpack 'disable-tuning
+            (lambda _
+              (substitute* "setup.py"
+                (("cpu_flags = .*")
+                 "cpu_flags = ['sse2']\n"))))
+          (replace 'build
+            (lambda* (#:key inputs #:allow-other-keys)
+              (invoke "python" "setup.py" "build"
+                      (string-append "--hdf5="
+                                     (assoc-ref inputs "hdf5")))))
+          (replace 'check
+            (lambda* (#:key inputs #:allow-other-keys)
+              (invoke "python" "setup.py" "check"
+                      (string-append "--hdf5="
+                                     (assoc-ref inputs "hdf5"))))))))
     (propagated-inputs
      (list python-numexpr python-numpy))
     (native-inputs
      (list python-cython pkg-config))
     (inputs
-     (list hdf5-1.10 bzip2 zlib))
+     (list c-blosc hdf5-1.10 bzip2 lzo zlib))
     (home-page "https://www.pytables.org/";)
     (synopsis "Hierarchical datasets for Python")
     (description "PyTables is a package for managing hierarchical datasets and



reply via email to

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