gnu: python-fitsio: Update to 1.2.0.

* gnu/packages/astronomy.scm (python-fitsio): Update to 1.2.0.
[arguments]{phases}: Swap 'unbundle-cfitsio to 'set-env as there is
support for system CFitsio library provided.
[inputs]: Add zlib.

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Sharlatan Hellseher 2023-09-07 23:32:18 +01:00 committed by Christopher Baines
parent 8b6d84a81c
commit 815d0c00d5
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -534,45 +534,42 @@ (define-public python-astroml
(define-public python-fitsio (define-public python-fitsio
(package (package
(name "python-fitsio") (name "python-fitsio")
(version "1.1.10") (version "1.2.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "fitsio" version)) (uri (pypi-uri "fitsio" version))
(sha256 (sha256
(base32 "0dv2vjj8qn3rq5sr99x5yjjch5h867c8q7zh73i67dzdsk7ix0jf")) (base32 "04fbg1ffj7qrlzw50xzzkfnlk6qjjqq96j0im7phprmwb1rbvzzh"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
;; Remove the bundled cfitsio ;; Remove the bundled cfitsio. When update the package check the
;; current bundled version.
#~(begin #~(begin
(delete-file-recursively "cfitsio3490") (delete-file-recursively "cfitsio-4.2.0")
(substitute* "MANIFEST.in" (substitute* "MANIFEST.in"
(("recursive-include cfitsio3490.*$\n") "")))))) (("recursive-include cfitsio-4.2.0.*$\n") ""))))))
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'unbundle-cfitsio (add-before 'build 'set-env
(lambda _ (lambda _
(let* ((cfitsio #$(this-package-input "cfitsio")) (setenv "FITSIO_USE_SYSTEM_FITSIO" "True")
(includedir (string-append "\"" cfitsio "/include\"")) (setenv "FITSIO_SYSTEM_FITSIO_INCLUDEDIR"
(libdir (string-append "\"" cfitsio "/lib\""))) (string-append
;; Use Guix' cfitsio instead of the bundled one #$(this-package-input "cfitsio") "/include"))
(substitute* "setup.py" (setenv "FITSIO_SYSTEM_FITSIO_LIBDIR"
(("self.use_system_fitsio = False") "pass") (string-append
(("self.system_fitsio_includedir = None") "pass") #$(this-package-input "cfitsio") "/lib"))))
(("self.system_fitsio_libdir = None") "pass")
(("self.use_system_fitsio") "True")
(("self.system_fitsio_includedir") includedir)
(("self.system_fitsio_libdir") libdir)))))
(add-before 'check 'build-extensions (add-before 'check 'build-extensions
(lambda _ (lambda _
(invoke "python" "setup.py" "build_ext" "--inplace")))))) (invoke "python" "setup.py" "build_ext" "--inplace"))))))
(native-inputs (native-inputs
(list python-pytest)) (list python-pytest))
(inputs (inputs
(list curl cfitsio)) (list curl cfitsio zlib))
(propagated-inputs (propagated-inputs
(list python-numpy)) (list python-numpy))
(home-page "https://github.com/esheldon/fitsio") (home-page "https://github.com/esheldon/fitsio")