Subject: [PATCH v3 10/22] gnu: python-glyphslib: Use pyproject-build-system.

From: Marius Bakke <[email-masked]>
Date: Sun, 23 Oct 2022 00:20:48 +0200

* gnu/packages/fontutils.scm (python-glyphslib)[build-system]: Switch to
PYPROJECT-BUILD-SYSTEM.
[arguments]: Add #:test-flags.  Remove #:phases.
[native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL.
---
 gnu/packages/fontutils.scm | 42 ++++++++++----------------------------
 1 file changed, 11 insertions(+), 31 deletions(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 9b7f1ac879..eefde1d893 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -76,8 +76,9 @@ (define-module (gnu packages fontutils)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system python)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system pyproject)
+  #:use-module (guix build-system python)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1))
 
@@ -591,39 +592,18 @@ (define-public python-glyphslib
               (sha256
                (base32
                 "0mkkwd09g76hvif603ij5aqicxh47zvhgyyd0pjcjmpdy6dr70yw"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
      (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (replace 'build
-            (lambda _
-              ;; The Zip format does not support pre-1980 time stamps.
-              (let ((circa-1980 (* 10 366 24 60 60)))
-                (setenv "SOURCE_DATE_EPOCH" (number->string circa-1980))
-                (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))))
-          (replace 'install
-            (lambda _
-              (let ((whl (car (find-files "dist" "\\.whl$"))))
-                (invoke "pip" "--no-cache-dir" "--no-input"
-                        "install" "--no-deps" "--prefix" #$output whl))))
-          (replace 'check
-            (lambda* (#:key tests? #:allow-other-keys)
-              (when tests?
-                (setenv "GUIX_PYTHONPATH"
-                        (string-append (getcwd) ":" (getenv "GUIX_PYTHONPATH")))
-                (invoke "pytest" "-vv"
-                        ;; These fail because the test data has not yet been
-                        ;; updated for newer FontTools:
-                        ;;   https://github.com/googlefonts/glyphsLib/issues/787
-                        ;; Re-enable for versions > 6.0.7.
-                        "--ignore=tests/builder/designspace_gen_test.py"
-                        "--ignore=tests/builder/interpolation_test.py"
-                        )))))))
+      #:test-flags #~'("-vv"
+                       ;; These fail because the test data has not yet been
+                       ;; updated for newer FontTools:
+                       ;;   https://github.com/googlefonts/glyphsLib/issues/787
+                       ;; Re-enable for versions > 6.0.7.
+                       "--ignore=tests/builder/designspace_gen_test.py"
+                       "--ignore=tests/builder/interpolation_test.py")))
     (native-inputs
-     (list python-pypa-build
-           python-setuptools-scm
-           python-wheel
+     (list python-setuptools-scm
 
            ;; For tests.
            python-pytest
-- 
2.38.0