~ruther/guix-local

ac1fb33ffd75ea80d063a53b74b2d9d0c0959109 — Sharlatan Hellseher 5 months ago 159931a
gnu: python-fs: Fix build on cross compilation.

* gnu/packages/python-xyz.scm (python-fs)[arguments] <test-flags>: Move
option here instead of overwriting 'check phase.
<phases>: Use default 'check; add 'pre-check.
[native-inputs]: Keep python-setuptools away from condition.

Fixes: guix/guix#3656
Change-Id: I247a70ea9d3fbc94a748973dd4a273341408fea9
1 files changed, 29 insertions(+), 21 deletions(-)

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +29 -21
@@ 17199,33 17199,41 @@ It has a flexible system of @samp{authorizers} able to manage both
    (source
     (origin
       (method git-fetch)
       (uri (git-reference (url
                            "https://github.com/PyFilesystem/pyfilesystem2/")
                           (commit (string-append "v" version))))
       (uri (git-reference
              (url "https://github.com/PyFilesystem/pyfilesystem2/")
              (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256 (base32 "1wrkhsv57kv4jcadn7w330mgbjjsimgzfvicni8cka6y1a8chbjs"))))
       (sha256
        (base32 "1wrkhsv57kv4jcadn7w330mgbjjsimgzfvicni8cka6y1a8chbjs"))))
    (build-system pyproject-build-system)
    (arguments
     (list
      ;; tests: 1995 passed, 21 skipped, 411 deselected, 14 warnings
      #:test-flags #~(list "-m" "not slow")
      #:tests? (and (not (%current-target-system))
                    (->bool (this-package-native-input "python-pytest")))
      #:phases #~(modify-phases %standard-phases
                   (replace 'check
                     (lambda* (#:key tests? #:allow-other-keys)
                       (when tests?
                         (setenv "HOME" "/tmp")
                         (invoke "pytest" "-m" "not slow")))))))
    (propagated-inputs
     (list python-appdirs python-pytz python-six))
    (native-inputs
     ;; 'python-pyftpdlib' is needed for tests but it indirectly depends Rust,
     ;; which is currently unavailable on aarch64-linux.  Remove all the test
     ;; dependencies in that case.
     (if (and (not (%current-target-system))
              (supported-package? python-pyftpdlib))
         (list python-mock python-parameterized python-pyftpdlib
               python-pytest python-setuptools)
         '()))
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'check 'pre-check
            (lambda _
              (setenv "HOME" "/tmp"))))))
    (native-inputs
     (append
      (list python-setuptools)
      ;; 'python-pyftpdlib' is needed for tests but it indirectly depends Rust,
      ;; which is currently unavailable on aarch64-linux.  Remove all the test
      ;; dependencies in that case.
      (if (and (not (%current-target-system))
               (supported-package? python-pyftpdlib))
          (list python-mock
                python-parameterized
                python-pyftpdlib
                python-pytest)
          '())))
    (propagated-inputs
     (list python-appdirs
           python-pytz
           python-six))         ;still hard itegrated
    (home-page "https://github.com/PyFilesystem/pyfilesystem2/")
    (synopsis "File system abstraction layer for Python")
    (description