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.
This commit is contained in:
Ricardo Wurmus 2023-04-26 17:01:08 +02:00
parent 2d883cbd6d
commit 5bfce83dc4
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

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