~ruther/guix-local

594f9970456126acaf0f66b045d5b832f6d51b06 — Nicolas Graves 4 months ago 2d41fcd
gnu: python-numpysane: Switch to pyproject.

* gnu/packages/python-xyz.scm (python-numpysane):
[build-system]: Switch to pyproject-build-system.
[arguments]<#:phases>: Improve and rewrite phase 'patch.
[native-inputs]: Add python-setuptools.
[home-page]: Relocate field.
[description]: Improve style.

Change-Id: Ib4ecd4e68fad941b2afeaa09be6231cfe3cff8a5
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
1 files changed, 31 insertions(+), 33 deletions(-)

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +31 -33
@@ 10636,40 10636,39 @@ include_dirs = ~:*~a/include~%" #$(this-package-input "openblas"))))))
  (package
    (name "python-numpysane")
    (version "0.42")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/dkogan/numpysane.git")
                     (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0s38fm88bmq08j5qxfka1wyjs2r9s9arzd1c3c4ixa8k3pisnihr"))))
    (build-system python-build-system)
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/dkogan/numpysane.git")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0s38fm88bmq08j5qxfka1wyjs2r9s9arzd1c3c4ixa8k3pisnihr"))))
    (build-system pyproject-build-system)
    (arguments
     (list #:phases
           #~(modify-phases %standard-phases
               (add-after 'unpack 'patch
                 (lambda* (#:key inputs #:allow-other-keys)
                   (substitute* "Makefile.common.header"
                    ;; numpy 2.0 has this--but we don't use numpy 2.0.
                    (("pkg-config --cflags-only-I numpy")
                     (string-append "echo -I"
                                    (assoc-ref inputs "python-numpy")
                                    "/lib/python"
                                    #$(version-major+minor
                                       (package-version python))
                                    "/site-packages/numpy/core/include")))))
               (replace 'check
                 (lambda _
                   (setenv "CC" #$(cc-for-target))
                   (invoke "make" "check"))))))
    (propagated-inputs
     (list python-numpy))
    (native-inputs
     (list perl pkg-config))
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((numpy (assoc-ref inputs "python-numpy"))
                     (site (site-packages inputs `(("out" . ,numpy)))))
                (substitute* "Makefile.common.header"
                ;; numpy 2.0 has this--but we don't use numpy 2.0.
                (("pkg-config --cflags-only-I numpy")
                 (format #f "echo -I~a/numpy/core/include" site))))))
          (replace 'check
            (lambda _
              (setenv "CC"
                      #$(cc-for-target))
              (invoke "make" "check"))))))
    (propagated-inputs (list python-numpy))
    (native-inputs (list perl pkg-config python-setuptools))
    (home-page "https://github.com/dkogan/numpysane")
    (synopsis "More-reasonable core functionality for numpy")
    (description "This package provides more-reasonable core functionality for numpy.
    (description
     "This package provides more-reasonable core functionality for numpy.

A lot of numpysane functionality is inspired by PDL (Perl Data Language).



@@ 10685,7 10684,6 @@ numpysane has:
@item broadcast-aware matrix multiplication
@end itemize
")
    (home-page "https://github.com/dkogan/numpysane")
    (license license:lgpl2.0+)))

(define-public python-numpy-documentation