summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-09-16 16:40:17 +0200
committerMarius Bakke <marius@gnu.org>2022-09-16 18:42:20 +0200
commitd1c60dd89228197cd0a34c5316f287058f919857 (patch)
tree272ec4cff4d0341e5d41ba504648efb0f21e3fbb
parentfff525acca82bfbf2449686b5bf4977f29386788 (diff)
gnu: Add python-glyphslib.
* gnu/packages/fontutils.scm (python-glyphslib): New variable.
-rw-r--r--gnu/packages/fontutils.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 6f0cc4f586..6e89124d5e 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -542,6 +542,67 @@ process. FontParts is the successor of RoboFab.")
(alist-delete 'hidden?
(package-properties python-fontparts-bootstrap)))))
+(define-public python-glyphslib
+ (package
+ (name "python-glyphslib")
+ (version "6.0.7")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "glyphsLib" version))
+ (sha256
+ (base32
+ "0mkkwd09g76hvif603ij5aqicxh47zvhgyyd0pjcjmpdy6dr70yw"))))
+ (build-system python-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"
+ )))))))
+ (native-inputs
+ (list python-pypa-build
+ python-setuptools-scm
+ python-wheel
+
+ ;; For tests.
+ python-pytest
+ python-xmldiff))
+ (propagated-inputs
+ (list python-defcon
+ python-fonttools-next
+ python-openstep-plist
+ python-ufolib2
+ python-ufo2ft
+ python-ufonormalizer))
+ (home-page "https://github.com/googlefonts/glyphsLib")
+ (synopsis "Bridge Glyphs source files to UFOs")
+ (description
+ "This package provides a bridge from Glyphs source files (@file{.glyphs})
+to UFOs and DesignSpace files via @code{defcon} and @code{designspaceLib}.")
+ (license license:asl2.0)))
+
(define-public python-opentype-sanitizer
(package
(name "python-opentype-sanitizer")