From 7a87511bd6e4476acf95a52ed80d998c475fbf1d Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sun, 19 Oct 2025 17:26:15 +0200 Subject: [PATCH] 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 --- gnu/packages/python-xyz.scm | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1551ea9c28387c216105d7a81093ca8ae4feb3ba..4ceefbff0416898f3f2e9e847dad0691a7c46b53 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -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.