~ruther/guix-local

7a87511bd6e4476acf95a52ed80d998c475fbf1d — Nicolas Graves 6 months ago 064a0c8
gnu: python-file: Switch to pyproject.

* gnu/packages/python-xyz.scm (python-file):
[build-system]: Switch to pyproject-build-system.
[arguments, inputs]: Improve style.
[native-inputs]: Add python-setuptools.

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

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +19 -19
@@ 18679,26 18679,26 @@ Python's @code{ctypes} foreign function interface (FFI).")
(define-public python-file
  (package/inherit file
    (name "python-file")
    (build-system python-build-system)
    (build-system pyproject-build-system)
    (arguments
     '(#:tests? #f                                ;no tests
       #:configure-flags '("--single-version-externally-managed" "--root=/")
       #:phases (modify-phases %standard-phases
                  (add-before 'build 'change-directory
                    (lambda _
                      (chdir "python")
                      #t))
                  (add-before 'build 'set-library-file-name
                    (lambda* (#:key inputs #:allow-other-keys)
                      (let ((file (assoc-ref inputs "file")))
                        (substitute* "magic.py"
                          (("find_library\\('magic'\\)")
                           (string-append "'" file "/lib/libmagic.so'")))
                        #t))))))
    (inputs `(("file" ,file)))
    (native-inputs (if (%current-target-system)
                       `(("self" ,this-package))
                       '()))
     (list
      #:tests? #f                                ;no tests
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'build 'change-directory
            (lambda _
              (chdir "python")))
          (add-before 'build 'set-library-file-name
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "magic.py"
                (("find_library\\('magic'\\)")
                 (format #f "~s" (search-input-file inputs
                                                    "lib/libmagic.so")))))))))
    (inputs (list file))
    (native-inputs (cons* python-setuptools
                          (if (%current-target-system)
                              (list this-package)
                              '())))
    (synopsis "Python bindings to the libmagic file type guesser")
    (description "This package provides Python bindings to the libmagic file
type guesser.