[bug#77895,5/7] gnu: python-skranger: Improve phase 'build-extensions.

Message ID 20250418114642.2538-5-ngraves@ngraves.fr
State New
Headers
Series [bug#77895,1/7] gnu: Add python-lark. |

Commit Message

Nicolas Graves April 18, 2025, 11:46 a.m. UTC
  * gnu/packages/python-xyz.scm (python-skranger)
[arguments]{phases}: Improve phase 'build-extensions with
site-packages procedure.
---
 gnu/packages/python-xyz.scm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f9b98d7dd5..14a95de25d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -2605,14 +2605,12 @@  (define-public python-skranger
                 (("from sklearn.datasets import load_boston") "")
                 (("^_boston_X.*") "_boston_X, _boston_Y = (True, True)\n"))))
           (add-before 'check 'build-extensions
-            (lambda _
+            (lambda* (#:key inputs outputs #:allow-other-keys)
               ;; Cython extensions have to be built before running the tests.
               (invoke "python" "buildpre.py")
               (invoke "python" "build.py" "build_ext" "--inplace")
-              (let ((site (string-append #$output "/lib/python"
-                                         #$(version-major+minor
-                                            (package-version python))
-                                         "/site-packages/skranger"))
+              (let ((site (string-append (site-packages inputs outputs)
+                                         "/skranger"))
                     (lib (match (find-files "build" "\\.so")
                            ((the-lib) the-lib)
                            (_ (error "could not find .so")))))