guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit a32441f62907b7cb414dc4b3b4cfd6776ecc576c
Author: Nicolas Graves <[email protected]>
AuthorDate: Sun Nov 2 02:19:46 2025 +0100

    gnu: mallard-ducktype: Build with a custom build-system.
    
    * gnu/packages/documentation.scm (mallard-ducktype)
    [build-system, arguments]: Build using a custom build-system.
    
    Change-Id: I56bc352ab62bf143bbe5d370dd68ff2b2e2bb75e
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/documentation.scm | 44 ++++++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 104199a79e..77a23edb3d 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -455,21 +455,45 @@ inspired by Dash.")
        ;; git-reference because tests are not included in pypi source tarball
        ;; https://issues.guix.gnu.org/issue/36755#2
        (uri (git-reference
-             (url "https://github.com/projectmallard/mallard-ducktype";)
-             (commit version)))
+              (url "https://github.com/projectmallard/mallard-ducktype";)
+              (commit version)))
        (file-name (git-file-name name version))
        (sha256
         (base32
          "1jk9bfz7g04ip78s03b0xak6d54rj4h9zpgadkziy1ji216g6y4c"))))
-    (build-system pyproject-build-system)
+    (build-system gnu-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (with-directory-excursion "tests"
-               (invoke "sh" "runtests")))))))
-    (native-inputs (list python-setuptools))
+     (list
+      ;; Essentially a lighter copy of the former python-build-system.
+      ;; Using it rather than pyproject-build-system allows to edit the latter
+      ;; without a texlive + haskell world rebuild.
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'bootstrap)
+          (delete 'configure)
+          (replace 'build
+            (lambda _
+              (invoke "python" "./setup.py" "build")))
+          (replace 'install
+            (lambda _
+              (invoke "python" "./setup.py" "install"
+                      (string-append "--prefix=" #$output) "--no-compile")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output)))
+          (add-after 'install 'wrap
+            (lambda _
+              (let* ((parser (car (find-files #$output "^parser\\.py$")))
+                     (site (dirname (dirname (dirname parser)))))
+                (wrap-program (string-append #$output "/bin/ducktype")
+                  #:sh (which "bash")
+                  `("GUIX_PYTHONPATH" ":" = (,site))))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (if tests?
+                  (with-directory-excursion "tests"
+                    (invoke "sh" "runtests"))
+                  (format #t "test suite not run.~%")))))))
+    (native-inputs (list python-setuptools-bootstrap python-wrapper))
     (home-page "http://projectmallard.org";)
     (synopsis "Convert Ducktype to Mallard documentation markup")
     (description

Reply via email to