[PATCH 00/12] gnu: Add python-manim

OpenSubmitted by Daniel Meißner.
Details
3 participants
  • Daniel Meißner
  • Liliana Marie Prikler
  • Xinglu Chen
Owner
unassigned
Severity
normal
D
D
Daniel Meißner wrote on 10 Sep 2021 13:22
(address . guix-patches@gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112231.6411-1-daniel.meissner-i4k@ruhr-uni-bochum.de
Hi Guix!

This patch series adds the necessary packages for Manim, an animation engine
for mathematical animations which can be used in educational maths videos. I
have read the "Submitting Patches" section in the Guix manual and have
confirmed that the packages build as expected. However, I have disabled tests
for the following packages:

* python-manim
* python-mapbox-earcut
* python-moderngl-window
* python-pyglet
* python-moderngl

This is either because they need a DISPLAY to conduct the tests or because the
tests are failing and I don't know how to fix it. Your help will be
appreciated :)

Thanks,
Daniel

Daniel Meißner (12):
gnu: Add python-cloup.
gnu: Add python-cloup-0.7.
gnu: Add python-glcontext.
gnu: Add python-moderngl.
gnu: Add python-pyglet.
gnu: Add python-multipledispatch.
gnu: Add python-pyrr.
gnu: Add python-screeninfo.
gnu: Add python-moderngl-window.
gnu: Add python-manimpango.
gnu: Add python-mapbox-earcut.
gnu: Add python-manim 0.9.0.

gnu/local.mk | 2 +
.../python-manimpango-remove-manim-dep.patch | 172 +++++++++++
gnu/packages/python-science.scm | 82 +++++
gnu/packages/python-xyz.scm | 289 ++++++++++++++++++
4 files changed, 545 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch

--
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 01/12] gnu: Add python-cloup.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-1-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup): New variable.
---
gnu/packages/python-science.scm | 1 +
gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 738b504e3b..d3730fadcc 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2021 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e98eec19bc..6c7ab10216 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3308,6 +3308,37 @@ with sensible defaults out of the box.")
         (base32 "0njsm0wn31l21bi118g5825ma5sa3rwn7v2x4wjd7yiiahkri337"))))
     (arguments `())))
 
+(define-public python-cloup
+  (package
+    (name "python-cloup")
+    (version "0.11.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "07kxw81bml137w9bfmwkjbdzbldkk1k1lws82wffz9244pp7k8ib"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  ;; test phase fails with "error: invalid command pytest"
+                  (delete 'check))))
+    (propagated-inputs
+     `(("python-click" ,python-click)))
+    (native-inputs
+     `(("python-setuptools" ,python-setuptools)
+       ("python-setuptools-scm" ,python-setuptools-scm/next)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/janLuke/cloup")
+    (synopsis "Extension library for python-click")
+    (description
+     "Cloup — originally from \"Click + option groups\" — enriches Click with
+several features that make it more expressive and configurable: option groups,
+constraints, subcommand aliases, subcommands sections and a themeable
+HelpFormatter.")
+    (license license:bsd-3)))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 02/12] gnu: Add python-cloup-0.7.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-2-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup-0.7): New variable.
---
gnu/packages/python-xyz.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6c7ab10216..75646aec7f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3339,6 +3339,18 @@ constraints, subcommand aliases, subcommands sections and a themeable
 HelpFormatter.")
     (license license:bsd-3)))
 
+(define-public python-cloup-0.7
+  (package (inherit python-cloup)
+    (name "python-cloup-0.7")
+    (version "0.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "0yyxibwlxmdkm4866fm4rwpdgy3d6y18n061992ckr54vl0cav7j"))))))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 03/12] gnu: Add python-glcontext.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-3-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-glcontext): New variable.
---
gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 75646aec7f..251aad5b61 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18884,6 +18884,52 @@ library.")
     (description
      "This is the Cython-coded accelerator module for PyOpenGL.")))
 
+(define-public python-glcontext
+  (package
+   (name "python-glcontext")
+   (version "2.3.4")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://github.com/moderngl/glcontext")
+           (commit version)))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32
+       "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
+   (build-system python-build-system)
+   (arguments
+    '(#:phases
+      (modify-phases %standard-phases
+        (add-before 'build 'fix-lib-paths
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
+              (("\"libGL.so\"")
+               (string-append "\"" (assoc-ref inputs "mesa") "/lib/libGL.so\""))
+              (("\"libEGL.so\"")
+               (string-append "\"" (assoc-ref inputs "mesa") "/lib/libEGL.so\""))
+              (("\"libX11.so\"")
+               (string-append "\"" (assoc-ref inputs "libx11") "/lib/libX11.so\"")))
+            (substitute* '("glcontext/__init__.py")
+              (("find_library\\('GL'\\)")
+               (string-append "'" (assoc-ref inputs "mesa") "/lib/libGL.so'"))
+              (("find_library\\('EGL'\\)")
+               (string-append "'" (assoc-ref inputs "mesa") "/lib/libEGL.so'"))
+              (("find_library\\(\"X11\"\\)")
+               (string-append "'" (assoc-ref inputs "libx11") "/lib/libX11.so'")))
+            #t))
+        ;; tests fail with: Exception: (standalone) XOpenDisplay: cannot open display
+        (delete 'check))))
+   (inputs
+    `(("libx11" ,libx11)
+      ("mesa" ,mesa)))
+   (home-page "https://github.com/moderngl/glcontext")
+   (synopsis "Portable OpenGL Context for ModernGL")
+   (description "Python-glcontext is a library providing OpenGL implementation
+for ModernGL on multiple platforms.")
+   (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 04/12] gnu: Add python-moderngl.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-4-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl): New variable.
---
gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 251aad5b61..394f30226f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18930,6 +18930,33 @@ library.")
 for ModernGL on multiple platforms.")
    (license license:expat)))
 
+(define-public python-moderngl
+  (package
+    (name "python-moderngl")
+    (version "5.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "moderngl" version))
+       (sha256
+        (base32
+         "1ysinnyr3rkdisbihdrn1623l3rw45nx8p2j31dgffsykxah8vcc"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-glcontext" ,python-glcontext)))
+    (home-page
+     "https://github.com/moderngl/moderngl")
+    (synopsis
+     "Python wrapper for OpenGL")
+    (description "ModernGL is a python wrapper over OpenGL 3.3+ core that
+simplifies the creation of simple graphics applications like scientific
+simulations, games or user interfaces.  Usually, acquiring in-depth knowledge
+of OpenGL requires a steep learning curve.  In contrast, ModernGL is easy to
+learn and use, moreover it is capable of rendering with high performance and
+quality, with less code written.  The majority of the moderngl code base is
+also written in C++ for high performance.")
+    (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 05/12] gnu: Add python-pyglet.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-5-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyglet): New variable.
---
gnu/packages/python-xyz.scm | 42 +++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 394f30226f..e1e676490b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18957,6 +18957,48 @@ quality, with less code written.  The majority of the moderngl code base is
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-pyglet
+  (package
+    (name "python-pyglet")
+    (version "1.5.18")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyglet" version ".zip"))
+       (sha256
+        (base32
+         "044ib8x6pv5rjwj210hq37ry7vi5bizmqkkv1zj8967prk5ii8sq"))))
+    (build-system python-build-system)
+    (arguments
+     '(;; tests fail with: TypeError: don't know how to make test from:
+       ;; <pyglet._ModuleProxy object at ...>
+       #:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (add-before 'build 'fix-lib-paths
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (substitute* '("pyglet/gl/lib_glx.py")
+                        (("'GL'")
+                         (string-append "\"" (assoc-ref inputs "mesa")
+                                        "/lib/libGL.so\""))
+                        (("'GLU'")
+                         (string-append "\"" (assoc-ref inputs "glu")
+                                        "/lib/libGLU.so\"")))
+                      #t)))))
+    (inputs
+     `(("mesa" ,mesa)
+       ("glu" ,glu)))
+    (native-inputs `(("unzip" ,unzip)))
+    (home-page
+     "https://pyglet.readthedocs.io")
+    (synopsis
+     "Cross-platform windowing and multimedia Python library")
+    (description
+     "Pyglet is a Python library for developing games and other visually-rich
+applications.  It supports windowing, user interface event handling,
+Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
+music.  All of this with a friendly Pythonic API that's simple to learn.")
+    (license license:bsd-3)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 06/12] gnu: Add python-multipledispatch.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-6-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-multipledispatch): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e1e676490b..0102dbc4bb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18957,6 +18957,26 @@ quality, with less code written.  The majority of the moderngl code base is
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-multipledispatch
+  (package
+    (name "python-multipledispatch")
+    (version "0.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "multipledispatch" version))
+       (sha256
+        (base32
+         "1slblghfjg9fdi9zpd7gmrkvfbv20nrdgnrymcnbky8bzm8i9ax7"))))
+    (build-system python-build-system)
+    (propagated-inputs `(("python-six" ,python-six)))
+    (home-page
+     "https://github.com/mrocklin/multipledispatch/")
+    (synopsis "Multiple dispatch library for Python")
+    (description "This library defines a decorator that makes dispatching on
+types more concise to write. ")
+    (license license:bsd-3)))
+
 (define-public python-pyglet
   (package
     (name "python-pyglet")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 07/12] gnu: Add python-pyrr.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-7-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyrr): New variable.
---
gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0102dbc4bb..eb0e67c98d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18977,6 +18977,31 @@ also written in C++ for high performance.")
 types more concise to write. ")
     (license license:bsd-3)))
 
+(define-public python-pyrr
+  (package
+    (name "python-pyrr")
+    (version "0.10.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyrr" version))
+       (sha256
+        (base32
+         "07byxkq8dcc8n6fc2q7g3vq3mxzzj0hqzm8hlq3gfwbf68h7n3rw"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-multipledispatch" ,python-multipledispatch)
+       ("python-numpy" ,python-numpy)))
+    (home-page
+     "https://github.com/adamlwgriffiths/Pyrr")
+    (synopsis
+     "Mathematical functions for 3D graphics using NumPy")
+    (description
+     "A collection of object-oriented and procedural interfaces for working
+with matrices, quaternions, vectors and plane/line/ray objects for 3D
+graphics.")
+    (license license:bsd-3)))
+
 (define-public python-pyglet
   (package
     (name "python-pyglet")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 08/12] gnu: Add python-screeninfo.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-8-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-screeninfo): New variable.
---
gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index eb0e67c98d..bdda967d94 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19044,6 +19044,28 @@ Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-screeninfo
+  (package
+   (name "python-screeninfo")
+   (version "0.7")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri "screeninfo" version))
+     (sha256
+      (base32
+       "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))
+   (build-system python-build-system)
+   (native-inputs `(("python-pytest" ,python-pytest)))
+   (home-page "https://github.com/rr-/screeninfo")
+   (synopsis
+    "Obtain information about physical screens")
+   (description
+    "This python module provides means to access information about physical
+screens like resolution, height and width of the screen, connecting port
+etc.")
+   (license (list license:expat license:bsd-3))))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:24
[PATCH 09/12] gnu: Add python-moderngl-window.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-9-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl-window): New variable.
---
gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bdda967d94..765b3f0a57 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19044,6 +19044,41 @@ Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-moderngl-window
+  (package
+   (name "python-moderngl-window")
+   (version "2.4.0")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/moderngl/moderngl-window")
+                  (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "1fvhm6ln3q5kl5m5q3gzfmx1kpyn054fhpcrgpqz8809dxi7pzcv"))))
+   (build-system python-build-system)
+   (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; tests fail with: TypeError: don't know how to make test from:
+         ;; <moderngl_window.resources.data.DataFiles object at ...>
+         (delete 'check))))
+   (propagated-inputs
+    `(("python-pillow" ,python-pillow)
+      ("python-pyrr" ,python-pyrr)
+      ("python-numpy" ,python-numpy)
+      ("python-moderngl" ,python-moderngl)
+      ("python-pyglet" ,python-pyglet)))
+   (home-page "https://github.com/moderngl/moderngl-window")
+   (synopsis "Cross-platform utility library for ModernGL")
+   (description "This ModernGL utility library simplifies window creation and
+resource loading.  You can create a window for ModernGL using pyglet, pygame,
+PySide2, GLFW, SDL2, PyQt5 or tkinter.  Events are unified into a single event
+system.  Resource loading includes loading of 2D textures/texture arrays,
+shaders and objects/scenes.")
+   (license license:expat)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:25
[PATCH 11/12] gnu: Add python-mapbox-earcut.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-11-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-mapbox-earcut): New variable.
---
gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 765b3f0a57..00ed032855 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19079,6 +19079,35 @@ system.  Resource loading includes loading of 2D textures/texture arrays,
 shaders and objects/scenes.")
    (license license:expat)))
 
+(define-public python-mapbox-earcut
+  (package
+    (name "python-mapbox-earcut")
+    (version "0.12.10")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mapbox_earcut" version))
+       (sha256
+        (base32
+         "0ly48lijgd9inq07x42pfp9c24fn16vn9axpmfwqrkn979krbnah"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)
+       ("setuptools-scm" ,python-setuptools-scm)
+       ("cmake" ,cmake)))
+    (home-page
+     "https://github.com/skogler/mapbox_earcut_python")
+    (synopsis
+     "Python bindings for the Mapbox Earcut C++ polygon triangulation library")
+    (description
+     "The Mapbox Earcut library is a header-only C++ library which provides a
+fast and robust triangulation of 2D polygons.  This package provides Python
+bindings for this library.")
+    (license license:isc)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:25
[PATCH 12/12] gnu: Add python-manim 0.9.0.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-12-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manim): New variable.
---
gnu/packages/python-science.scm | 53 +++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)

Toggle diff (70 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index fcd983520c..d653ebca95 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -36,6 +36,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gtk)
@@ -1010,3 +1011,55 @@ pandas code.")
      "These are Python bindings for Pango to be used with the mathematical
 animation software Manim.")
     (license license:gpl3+)))
+
+(define-public python-manim
+  (package
+    (name "python-manim")
+    (version "0.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "manim" version))
+       (sha256
+        (base32
+         "0ksp57wcy45xkjips5i4wwm690mhbs2dmlcgsbmiwx78mfk4z0r3"))))
+    (build-system python-build-system)
+    (arguments '(;; tests fail with:
+                 ;; pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect
+                 ;; to "None"
+                 #:tests? #f))
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-click-default-group"
+        ,python-click-default-group)
+       ("python-cloup" ,python-cloup-0.7)
+       ("python-colour" ,python-colour)
+       ("python-decorator" ,python-decorator)
+       ("python-manimpango" ,python-manimpango)
+       ("python-mapbox-earcut" ,python-mapbox-earcut)
+       ("python-moderngl" ,python-moderngl)
+       ("python-moderngl-window"
+        ,python-moderngl-window)
+       ("python-networkx" ,python-networkx)
+       ("python-numpy" ,python-numpy)
+       ("python-pillow" ,python-pillow)
+       ("python-pycairo" ,python-pycairo)
+       ("python-pydub" ,python-pydub)
+       ("python-pygments" ,python-pygments)
+       ("python-requests" ,python-requests)
+       ("python-rich" ,python-rich)
+       ("python-scipy" ,python-scipy)
+       ("python-screeninfo" ,python-screeninfo)
+       ("python-tqdm" ,python-tqdm)
+       ("python-watchdog" ,python-watchdog)))
+    (native-inputs
+     `(("python-wheel" ,python-wheel)))
+    (home-page "https://www.manim.community/")
+    (synopsis
+     "Python animation engine for explanatory math videos")
+    (description
+     "Manim is a Python library for creating mathematical animations.  The
+animations are written as Python code which is based on predefined objects.
+You can make animations with maths formulas (LaTeX-based), simple shapes, 3D
+objects, function graphs and more.")
+    (license license:expat)))
-- 
2.33.0
D
D
Daniel Meißner wrote on 10 Sep 2021 13:25
[PATCH 10/12] gnu: Add python-manimpango.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210910112502.6466-10-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manimpango): New variable.
---
gnu/local.mk | 2 +
.../python-manimpango-remove-manim-dep.patch | 172 ++++++++++++++++++
gnu/packages/python-science.scm | 28 +++
3 files changed, 202 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch

Toggle diff (243 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 175e691a63..87be4a1b0a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -44,6 +44,7 @@
 # Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 # Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 # Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
+# Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 #
 # This file is part of GNU Guix.
 #
@@ -1646,6 +1647,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyfakefs-remove-bad-test.patch	\
   %D%/packages/patches/python-flint-includes.patch		\
   %D%/packages/patches/python-libxml2-utf8.patch		\
+  %D%/packages/patches/python-manimpango-remove-manim-dep.patch \
   %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
   %D%/packages/patches/python-mox3-python3.6-compat.patch	\
diff --git a/gnu/packages/patches/python-manimpango-remove-manim-dep.patch b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
new file mode 100644
index 0000000000..579c2302d8
--- /dev/null
+++ b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
@@ -0,0 +1,172 @@
+Fix dependency on manim for tests
+
+This fixes a circular dependency between manim and manimpango.
+
+Extracted from upstream:
+https://github.com/ManimCommunity/ManimPango/commit/7e2b17aa14b10bd58af0598cc2de51a406682797
+
+diff --git a/tests/_manim.py b/tests/_manim.py
+index 3ea4676..b11d3e9 100644
+--- a/tests/_manim.py
++++ b/tests/_manim.py
+@@ -2,11 +2,12 @@
+ """This file contains helpers for the tests copied and modified
+ from Manim.
+ """
+-
++import copy
+ import os
++import re
+ from pathlib import Path
+
+-from manimpango import Alignment, MarkupUtils
++from manimpango import Alignment, MarkupUtils, TextSetting, text2svg
+
+
+ class MarkupText:
+@@ -104,3 +105,115 @@ class MarkupText:
+
+     def __repr__(self):
+         return f"MarkupText({repr(self.original_text)})"
++
++
++class Text:
++    def __init__(
++        self,
++        text: str,
++        fill_opacity: float = 1.0,
++        stroke_width: int = 0,
++        size: int = 1,
++        line_spacing: int = -1,
++        font: str = "",
++        slant: str = "NORMAL",
++        weight: str = "NORMAL",
++        gradient: tuple = None,
++        tab_width: int = 4,
++        disable_ligatures: bool = False,
++        filename: str = "text.svg",
++        **kwargs,
++    ) -> None:
++        self.size = size
++        self.filename = filename
++        self.line_spacing = line_spacing
++        self.font = font
++        self.slant = slant
++        self.weight = weight
++        self.gradient = gradient
++        self.tab_width = tab_width
++        self.original_text = text
++        self.disable_ligatures = disable_ligatures
++        text_without_tabs = text
++        self.t2f = self.t2s = self.t2w = {}
++        if text.find("\t") != -1:
++            text_without_tabs = text.replace("\t", " " * self.tab_width)
++        self.text = text_without_tabs
++        if self.line_spacing == -1:
++            self.line_spacing = self.size + self.size * 0.3
++        else:
++            self.line_spacing = self.size + self.size * self.line_spacing
++        self.text2svg()
++
++    def text2settings(self):
++        """Internally used function. Converts the texts and styles
++        to a setting for parsing."""
++        settings = []
++        t2x = [self.t2f, self.t2s, self.t2w]
++        for i in range(len(t2x)):
++            fsw = [self.font, self.slant, self.weight]
++            if t2x[i]:
++                for word, x in list(t2x[i].items()):
++                    for start, end in self.find_indexes(word, self.text):
++                        fsw[i] = x
++                        settings.append(TextSetting(start, end, *fsw))
++        # Set all text settings (default font, slant, weight)
++        fsw = [self.font, self.slant, self.weight]
++        settings.sort(key=lambda setting: setting.start)
++        temp_settings = settings.copy()
++        start = 0
++        for setting in settings:
++            if setting.start != start:
++                temp_settings.append(TextSetting(start, setting.start, *fsw))
++            start = setting.end
++        if start != len(self.text):
++            temp_settings.append(TextSetting(start, len(self.text), *fsw))
++        settings = sorted(temp_settings, key=lambda setting: setting.start)
++
++        if re.search(r"\n", self.text):
++            line_num = 0
++            for start, end in self.find_indexes("\n", self.text):
++                for setting in settings:
++                    if setting.line_num == -1:
++                        setting.line_num = line_num
++                    if start < setting.end:
++                        line_num += 1
++                        new_setting = copy.copy(setting)
++                        setting.end = end
++                        new_setting.start = end
++                        new_setting.line_num = line_num
++                        settings.append(new_setting)
++                        settings.sort(key=lambda setting: setting.start)
++                        break
++        for setting in settings:
++            if setting.line_num == -1:
++                setting.line_num = 0
++        return settings
++
++    def text2svg(self):
++        """Internally used function.
++        Convert the text to SVG using Pango
++        """
++        size = self.size * 10
++        line_spacing = self.line_spacing * 10
++        dir_name = Path(self.filename).parent
++        disable_liga = self.disable_ligatures
++        if not os.path.exists(dir_name):
++            os.makedirs(dir_name)
++        file_name = self.filename
++        settings = self.text2settings()
++        width = 600
++        height = 400
++
++        return text2svg(
++            settings,
++            size,
++            line_spacing,
++            disable_liga,
++            file_name,
++            30,
++            30,
++            width,
++            height,
++            self.text,
++        )
+diff --git a/tests/test_fonts.py b/tests/test_fonts.py
+index 51e7eb4..da42895 100644
+--- a/tests/test_fonts.py
++++ b/tests/test_fonts.py
+@@ -3,13 +3,12 @@ import sys
+ from pathlib import Path
+ from shutil import copyfile
+
+-import manim
+ import pytest
+
+ import manimpango
+
+ from . import FONT_DIR
+-from ._manim import MarkupText
++from ._manim import MarkupText, Text
+
+ font_lists = {
+     (FONT_DIR / "AdobeVFPrototype.ttf").absolute(): "Adobe Variable Font Prototype",
+@@ -38,7 +37,7 @@ def test_register_font(font_name):
+ @pytest.mark.parametrize("font_name", font_lists.values())
+ def test_warning(capfd, font_name):
+     print(font_name)
+-    manim.Text("Testing", font=font_name)
++    Text("Testing", font=font_name)
+     captured = capfd.readouterr()
+     assert "Pango-WARNING **" not in captured.err, "Looks like pango raised a warning?"
+
+--
+2.32.0
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index d3730fadcc..fcd983520c 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -38,6 +38,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
@@ -982,3 +983,30 @@ pandas notebooks, scripts, and libraries.  Unlike other distributed DataFrame
 libraries, Modin provides seamless integration and compatibility with existing
 pandas code.")
     (license license:asl2.0)))
+
+(define-public python-manimpango
+  (package
+    (name "python-manimpango")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ManimPango" version))
+       (sha256
+        (base32
+         "1j2mbhf7d82718nkc0r8x7cf35hlh13b67qkczjbbys3w24nyfsw"))
+       (patches (search-patches "python-manimpango-remove-manim-dep.patch"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("Cython" ,python-cython)
+       ("python-pytest" ,python-pytest)))
+    (inputs
+     `(("pango" ,pango)))
+    (home-page "https://manimpango.manim.community/")
+    (synopsis
+     "Bindings for pango for use with Manim")
+    (description
+     "These are Python bindings for Pango to be used with the mathematical
+animation software Manim.")
+    (license license:gpl3+)))
-- 
2.33.0
L
L
Liliana Marie Prikler wrote on 10 Sep 2021 16:40
Re: [PATCH 00/12] gnu: Add python-manim
260dd342494281f42866719c6791174608a17e61.camel@gmail.com
Hi Daniel,

Am Freitag, den 10.09.2021, 13:22 +0200 schrieb Daniel Meißner:
Toggle quote (17 lines)
> Hi Guix!
>
> This patch series adds the necessary packages for Manim, an animation
> engine for mathematical animations which can be used in educational
> maths videos. I have read the "Submitting Patches" section in the
> Guix manual and have confirmed that the packages build as
> expected. However, I have disabled tests for the following packages:
>
> * python-manim
> * python-mapbox-earcut
> * python-moderngl-window
> * python-pyglet
> * python-moderngl
>
> This is either because they need a DISPLAY to conduct the tests or
> because the tests are failing and I don't know how to fix it. Your
> help will be appreciated :)
For the tests that need DISPLAY, the usual thing we do here is to spawn
an Xvfb for display :1 and set DISPLAY accordingly. There are several
variants depending on what exactly else you need (some with dbus, some
without), simply grep for "xorg-server-for-tests" and you ought to find
one that fits your needs.

Once we find out the packages that fail regardless, that have no easy
fix, it is still acceptable to fix a few failing tests manually by
patching the test suite, or if all else fails use `#:tests? #f' with an
appropriate comment.

Regards
X
X
Xinglu Chen wrote on 11 Sep 2021 21:33
Re: [bug#50505] [PATCH 01/12] gnu: Add python-cloup.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87zgsiucuj.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (43 lines)
> * gnu/packages/python-xyz.scm (python-cloup): New variable.
> ---
> gnu/packages/python-science.scm | 1 +
> gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
> index 738b504e3b..d3730fadcc 100644
> --- a/gnu/packages/python-science.scm
> +++ b/gnu/packages/python-science.scm
> @@ -14,6 +14,7 @@
> ;;; Copyright © 2021 Roel Janssen <roel@gnu.org>
> ;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
> ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
> +;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index e98eec19bc..6c7ab10216 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -3308,6 +3308,37 @@ with sensible defaults out of the box.")
> (base32 "0njsm0wn31l21bi118g5825ma5sa3rwn7v2x4wjd7yiiahkri337"))))
> (arguments `())))
>
> +(define-public python-cloup
> + (package
> + (name "python-cloup")
> + (version "0.11.0")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "cloup" version))
> + (sha256
> + (base32
> + "07kxw81bml137w9bfmwkjbdzbldkk1k1lws82wffz9244pp7k8ib"))))
> + (build-system python-build-system)
> + (arguments
> + '(#:phases (modify-phases %standard-phases
> + ;; test phase fails with "error: invalid command pytest"
> + (delete 'check))))

The tests run after applying the attached patch. I also took the
liberty of fixing the formatting of the synopsis and description. :-)

Toggle quote (20 lines)
> + (propagated-inputs
> + `(("python-click" ,python-click)))
> + (native-inputs
> + `(("python-setuptools" ,python-setuptools)
> + ("python-setuptools-scm" ,python-setuptools-scm/next)
> + ("python-pytest" ,python-pytest)))
> + (home-page "https://github.com/janLuke/cloup")
> + (synopsis "Extension library for python-click")
> + (description
> + "Cloup — originally from \"Click + option groups\" — enriches Click with
> +several features that make it more expressive and configurable: option groups,
> +constraints, subcommand aliases, subcommands sections and a themeable
> +HelpFormatter.")
> + (license license:bsd-3)))
> +
> (define-public python-vcversioner
> (package
> (name "python-vcversioner")
> --
> 2.33.0
From 574d6706ee0472b2e5e10a42af9bf9ded017a3f1 Mon Sep 17 00:00:00 2001
Message-Id: <574d6706ee0472b2e5e10a42af9bf9ded017a3f1.1631388580.git.public@yoctocell.xyz>
From: =?UTF-8?q?Daniel=20Mei=C3=9Fner=20via=20Guix-patches=20via?=
<guix-patches@gnu.org>
Date: Fri, 10 Sep 2021 13:24:51 +0200
Subject: [PATCH] gnu: Add python-cloup.

* gnu/packages/python-xyz.scm (python-cloup): New variable.

Co-authored-by: Xinglu Chen <public@yoctocell.xyz>
---
gnu/packages/python-science.scm | 1 +
gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 738b504e3b..d3730fadcc 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2021 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7c70829de9..2db7ccc0ee 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3307,6 +3307,41 @@ with sensible defaults out of the box.")
         (base32 "0njsm0wn31l21bi118g5825ma5sa3rwn7v2x4wjd7yiiahkri337"))))
     (arguments `())))
 
+(define-public python-cloup
+  (package
+    (name "python-cloup")
+    (version "0.11.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "07kxw81bml137w9bfmwkjbdzbldkk1k1lws82wffz9244pp7k8ib"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest")))))))
+    (propagated-inputs
+     `(("python-click" ,python-click)))
+    (native-inputs
+     `(("python-setuptools" ,python-setuptools)
+       ("python-setuptools-scm" ,python-setuptools-scm/next)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/janLuke/cloup")
+    (synopsis "Extension library for @code{python-click}")
+    (description
+     "Cloup---originally from ``Click + option groups''---enriches
+@code{python-click} with several features that make it more expressive and
+configurable: option groups, constraints, subcommand aliases, subcommands
+sections, and a themeable @code{HelpFormatter}.")
+    (license license:bsd-3)))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.33.0
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9BHQVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5XGYP/AmQVufraMhDB2RLCA/4Ya94JdZ2
NouBcpnqA+EjBqsEGDffpUaZfTYJjWkqC0BLuo4rioFmaMydPtD6xSbYDyH2cvds
P9D6mID5HyG6DVCfz2olpsbDapV2m7fgAccVSJjGP27BfEEYpWpABRPaSOHmCFNA
934WAe004wzMbv+brF3bK7O08ipoQD1o5KII4m5vWrgriDTKZr3JtX8Z4CHQ34C2
JHZaOEjzZyMb0V2HsqofK7cMha1y2Blfjk3IRqLfFaqC967YDrUGzTKz++wXnPQH
SFkFB/LKj3CvbO8dwKO9xuTZfgtDbFAnVBSgCKGdmcj63x8zCVRETq3/PUux5byy
sJxdVOxZqpL5dYcKYbWngksnr4CMfC0CeMPwQ5o+WignRER+evizeT8DDUFUhQC6
wQcSEECiMLc8G/3Dv/XE9wQAGDm2LQ14mERcu+u0KTt219zmVQm5hNY0wL8rKGRi
1ZFfr1OlB1Jhrli9OwCI5dpyYLDM8LU/W55rPJTE7U7opYjYhtOf35Mq/dlKLm46
DJfE1jbemrAP24Ac2zFIayT9v+rFkVh/DEcdob6VLsAff4aqHpYM+WqFDV5sjhSl
6w20IVITSKSFUAp95uncK8dN9JLMKJDHGv43WcI0srJyveQMUeHkYk3ABq7ADtNR
0EHiHyMDX/RWzIxh
=OF5k
-----END PGP SIGNATURE-----

X
X
Xinglu Chen wrote on 11 Sep 2021 21:42
Re: [bug#50505] [PATCH 03/12] gnu: Add python-glcontext.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87wnnmucev.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (41 lines)
> * gnu/packages/python-xyz.scm (python-glcontext): New variable.
> ---
> gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 75646aec7f..251aad5b61 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18884,6 +18884,52 @@ library.")
> (description
> "This is the Cython-coded accelerator module for PyOpenGL.")))
>
> +(define-public python-glcontext
> + (package
> + (name "python-glcontext")
> + (version "2.3.4")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/moderngl/glcontext")
> + (commit version)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
> + (build-system python-build-system)
> + (arguments
> + '(#:phases
> + (modify-phases %standard-phases
> + (add-before 'build 'fix-lib-paths
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
> + (("\"libGL.so\"")
> + (string-append "\"" (assoc-ref inputs "mesa") "/lib/libGL.so\""))
> + (("\"libEGL.so\"")
> + (string-append "\"" (assoc-ref inputs "mesa") "/lib/libEGL.so\""))
> + (("\"libX11.so\"")
> + (string-append "\"" (assoc-ref inputs "libx11") "/lib/libX11.so\"")))

Please keep lines =<80 columns wide. Also I would use a ‘let’ form to
avoid writing (assoc-ref inputs "mesa") twice.

Toggle quote (6 lines)
> + (substitute* '("glcontext/__init__.py")
> + (("find_library\\('GL'\\)")
> + (string-append "'" (assoc-ref inputs "mesa") "/lib/libGL.so'"))
> + (("find_library\\('EGL'\\)")
> + (string-append "'" (assoc-ref inputs "mesa") "/lib/libEGL.so'"))

Likewise (‘let’ form).

Toggle quote (4 lines)
> + (("find_library\\(\"X11\"\\)")
> + (string-append "'" (assoc-ref inputs "libx11") "/lib/libX11.so'")))
> + #t))

Phases don’t need to return #t once the ‘core-updates-frozen’ branch
gets merged, which should happen soon™. :-)

Toggle quote (10 lines)
> + ;; tests fail with: Exception: (standalone) XOpenDisplay: cannot open display
> + (delete 'check))))
> + (inputs
> + `(("libx11" ,libx11)
> + ("mesa" ,mesa)))
> + (home-page "https://github.com/moderngl/glcontext")
> + (synopsis "Portable OpenGL Context for ModernGL")
> + (description "Python-glcontext is a library providing OpenGL implementation
> +for ModernGL on multiple platforms.")

“providing an OpenGL implementation” (missing article).
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9BqgVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5tqAP/REzAuTKUh1nza4/oXKVGqnUxm+x
Q8yXr68WOqteSFxxOotYJJ2uuNq2cwjBMn8zW8Vng0ThIAXV2/rk4Htprh83jCOF
luEMab0YE9qcQgZ4X5HhDm3RxHItgtEtKwlh7fLMfDqChLZg/+absRkNFVgV34/1
rkURFDL9RXLV3qzTvJwENl8kZiEY6w2i8lk+DVJscMByjZtFYPcG16jqpjctGRKq
p3KKevB1qGZXyzOyVu4860/Pd5oLWVwrhAygRDfP4YqNishVIwpm2pbDt7nxZ4DE
bxKbsDAV2jI6ZikkvcjseeA8MK1I6zQMqVy01XQcdjTPnx0zxGFzgdbvBjFm8D8R
mJNfALnHj11ifvQYmPPcp5UYxJ/CWH18lH+d7PkI281Xr0uYSBTelLKlahX+Glwf
u8pm1LdKvNLdDe84WnKM0n9ZklM7mbDDXxvpdKd2MmcrzGV/wrAALx/ybv4ty8be
QrzWURDy7r65u8LQYbTEXXosbb+HBrlAfonrdJO3Ew7s3kFb88JfFD8RZSpQC8xo
oNdIMPyKKgy/xhHZDpsr+HZwO6S1b+/9R3vtLADB28M2YBGKdLG8X1wyMb7ZB2oX
NSOaZLa/8lmAMqVPRbKge9gHy3zA5tjCga/lHd7ADnxC5P7tiQufEMheVD0K50yu
53QwRv3xisLknSMn
=MEhW
-----END PGP SIGNATURE-----

X
X
Xinglu Chen wrote on 11 Sep 2021 21:46
Re: [bug#50505] [PATCH 04/12] gnu: Add python-moderngl.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87tuiquc8z.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (30 lines)
> * gnu/packages/python-xyz.scm (python-moderngl): New variable.
> ---
> gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 251aad5b61..394f30226f 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18930,6 +18930,33 @@ library.")
> for ModernGL on multiple platforms.")
> (license license:expat)))
>
> +(define-public python-moderngl
> + (package
> + (name "python-moderngl")
> + (version "5.6.4")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "moderngl" version))
> + (sha256
> + (base32
> + "1ysinnyr3rkdisbihdrn1623l3rw45nx8p2j31dgffsykxah8vcc"))))
> + (build-system python-build-system)
> + (propagated-inputs
> + `(("python-glcontext" ,python-glcontext)))
> + (home-page
> + "https://github.com/moderngl/moderngl")

Nit: no need for a newline :-)

Toggle quote (3 lines)
> + (synopsis
> + "Python wrapper for OpenGL")

Likewise.

Toggle quote (14 lines)
> + (description "ModernGL is a python wrapper over OpenGL 3.3+ core that
> +simplifies the creation of simple graphics applications like scientific
> +simulations, games or user interfaces. Usually, acquiring in-depth knowledge
> +of OpenGL requires a steep learning curve. In contrast, ModernGL is easy to
> +learn and use, moreover it is capable of rendering with high performance and
> +quality, with less code written. The majority of the moderngl code base is
> +also written in C++ for high performance.")
> + (license license:expat)))
> +
> (define-public python-rencode
> (package
> (name "python-rencode")
> --
> 2.33.0
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9B3wVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5vTQP/0VDYRTAeYJokxEULVxyEDHkfodi
FhmGIz6aFhyURDfgnZEW0I8qbNfPfcB+2Ew0S0CrNIhx6mHAhhdLN7RbY4LrPjUq
QL9GN+UCGPCggDKR1NS4vY+IQturOSbH1d7PWx3OIicOv4dwyi1cBgk1A3k4pGbA
V9c6ouGPjDGHtrUNrbuONDbTMJnnN/Er4U9V9XhP5zFYLsWZx/Mi7VqXJdQ+b/4v
w7RCiECTGwkTANHBinaSTdF9GNozgupG3XbIbwnhG69oEXFpEOYqX8ksqblvj3/R
XgQI/Yt60Ewd/HLkU8/UepuCWjNBSSSovcMMi3rtyv0uxr68EauGji/goHMgMCKb
8Lf1B2fv/zUKzH/+PTYjSntwlHEc4Vb3dK0Jm7Gsp23ZCYjU3dyi66X0T7NSxvXQ
iWOm6Lb2RddiJjCfrwtfktT2edUV1wlWvlHLCBdkulDmKzEnk3Xe2ESm+VxghUFm
AR5W2it9OZuNsuoNh2nmmy5a9lcnEhC52tTPEiihkVUD6a+4g+djUi7sny5wtyU1
BMEckTi4HpIZ/1uuPzyqdTDmEk7u0y7MtmDj2YrDTaOmdoA9tLb8P762hVXR2UDQ
VCZy+o++g00/Wen/cDNPtsgxLytC+hJQdLkqGWFe4EolILd+VtTFyKJQQsyiuvHl
/mLSWFnGxi/OgukD
=lAQ4
-----END PGP SIGNATURE-----

X
X
Xinglu Chen wrote on 11 Sep 2021 21:49
Re: [bug#50505] [PATCH 05/12] gnu: Add python-pyglet.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87r1duuc3f.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (31 lines)
> * gnu/packages/python-xyz.scm (python-pyglet): New variable.
> ---
> gnu/packages/python-xyz.scm | 42 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 394f30226f..e1e676490b 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18957,6 +18957,48 @@ quality, with less code written. The majority of the moderngl code base is
> also written in C++ for high performance.")
> (license license:expat)))
>
> +(define-public python-pyglet
> + (package
> + (name "python-pyglet")
> + (version "1.5.18")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "pyglet" version ".zip"))
> + (sha256
> + (base32
> + "044ib8x6pv5rjwj210hq37ry7vi5bizmqkkv1zj8967prk5ii8sq"))))
> + (build-system python-build-system)
> + (arguments
> + '(;; tests fail with: TypeError: don't know how to make test from:
> + ;; <pyglet._ModuleProxy object at ...>
> + #:tests? #f
> + #:phases (modify-phases %standard-phases

Nit: ‘modify-phase’ is usually on its own line.

Toggle quote (11 lines)
> + (add-before 'build 'fix-lib-paths
> + (lambda* (#:key inputs outputs #:allow-other-keys)
> + (substitute* '("pyglet/gl/lib_glx.py")
> + (("'GL'")
> + (string-append "\"" (assoc-ref inputs "mesa")
> + "/lib/libGL.so\""))
> + (("'GLU'")
> + (string-append "\"" (assoc-ref inputs "glu")
> + "/lib/libGLU.so\"")))
> + #t)))))

No need for trailing #t.

Toggle quote (7 lines)
> + (inputs
> + `(("mesa" ,mesa)
> + ("glu" ,glu)))
> + (native-inputs `(("unzip" ,unzip)))
> + (home-page
> + "https://pyglet.readthedocs.io")

No need for a newline.

Toggle quote (14 lines)
> + (synopsis
> + "Cross-platform windowing and multimedia Python library")
> + (description
> + "Pyglet is a Python library for developing games and other visually-rich
> +applications. It supports windowing, user interface event handling,
> +Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
> +music. All of this with a friendly Pythonic API that's simple to learn.")
> + (license license:bsd-3)))
> +
> (define-public python-rencode
> (package
> (name "python-rencode")
> --
> 2.33.0
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9CEQVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5zSgP/jN9cZEXD2gS/dX5JRlBI1NtZ1Xr
OW5GHIjFtogj91horHA7oN3By2TK3R72MhjXQ40R6NQKpcIOm0PbQ7wpck9yAtPy
rDZRdk9J7bbooADljGlfLWchtG3YEHstPGX2XQVt2X50gXHp3/pYRn2x1TzEm6kQ
NJE2cAcW9dY/ceqzcf+UdyscoLETPJbctTqS0K+bm/tkPz984QTpFbXe86WZnOBg
ojPkSOiyP8yzxig8UWvIQe1KqqmS6AAa5Pac8AiTVjxyqYOLGjyPJy1z1V1W1GqR
ETWWnoMeeazD0GMjlEkkIHRjK0s4igBKgTdPwlvl3m4mD/st3asUZMZg7ecsaZYR
h9cItBGVjssFyOhc1v1BNmEYM50oCZ17trzDOOqTALcqh/zyhY7+UZzU0zacrANr
Kn1Dlc/LEFMDVzqseCaa23uTloCL+M3OkjM1lr32AanD63WQCRsTEdbpSgl/qbpG
bTRpray9eBU2PLtzWSQ648jh2+pbfQBbSQrlBRC/8GvXc5NPjmSfw0uSl2ccEryL
wKomSdyERh1WK2X3OLHqSDeIr51rnWNnC8hxPtfpuYODXOKYYVFQJZA4HyoyezLu
J1DfHIqqdgddO3ICQ0GwYcsXIXydR+SpRzy4aim2iXA32fAsUutdOEmI1jytY6HZ
0XMtoq44zUqnGWYh
=Hs4k
-----END PGP SIGNATURE-----

X
X
Xinglu Chen wrote on 11 Sep 2021 21:52
Re: [bug#50505] [PATCH 06/12] gnu: Add python-multipledispatch.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87o88yubym.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (29 lines)
> * gnu/packages/python-xyz.scm (python-multipledispatch): New variable.
> ---
> gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index e1e676490b..0102dbc4bb 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18957,6 +18957,26 @@ quality, with less code written. The majority of the moderngl code base is
> also written in C++ for high performance.")
> (license license:expat)))
>
> +(define-public python-multipledispatch
> + (package
> + (name "python-multipledispatch")
> + (version "0.6.0")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "multipledispatch" version))
> + (sha256
> + (base32
> + "1slblghfjg9fdi9zpd7gmrkvfbv20nrdgnrymcnbky8bzm8i9ax7"))))
> + (build-system python-build-system)
> + (propagated-inputs `(("python-six" ,python-six)))
> + (home-page
> + "https://github.com/mrocklin/multipledispatch/")

No need for a newline.

Toggle quote (3 lines)
> + (synopsis "Multiple dispatch library for Python")
> + (description "This library defines a decorator that makes dispatching on
> +types more concise to write. ")
^
Trailing whitespace; ‘guix lint’ should have caught this. :-)

Toggle quote (7 lines)
> + (license license:bsd-3)))
> +
> (define-public python-pyglet
> (package
> (name "python-pyglet")
> --
> 2.33.0
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9CPEVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x5uYgP/jzPt6sGc2w7V3/LXpiiy8sfveD8
kSjHoBIWUDSdBDzliXJQ8kVENlBkgy9c/KhYPf34qXHK71mbgibk+4af4wM9x969
RbL0zWLRbHHORHPypXwh10uC4M7BuTSI1gheEq8K0hHqijCisqLvJyyeHn9gKagS
N6bZvx0vulgZX9ybAajy/hr2UfNik1npc4ccCa0KCKedReUTh5ZQxyQsUh+yQtW2
FIku8fnOtiSEy75QG0JeJuCIfFCULr2bNFAPNY1R7yPfWYsb3kyUUpYp7UBjsZn0
9bV9sy+q3BagkaHpw4LT9z3ziOA8Sp1yBtRvFuWSiB+Wrir0QOB9U+S13e1FTqUZ
SE3Sryl9A8tnLsFduJDW0HOTDfIN7frQEv0J1Jkf5zgvZxaSO5V3NAvg4uVDI0MR
95s7n9GQBPlpddoG1Uc/OR9MbFpLeysJ2zzXGZyQquNlEUL0N0oj7ug/pKP/xWtP
WMxaSE1Hqlr+m0O6eMz5tCZ3QR4lsb1LS6+gI8ynu/Ab7ywCCc4lmGPAVc4ooyyu
qlR/DhOHXdq7seBwgce4whTdoL0+GdEwctNX4ZVBhMMwY6Utcys7Z8A+LJwE+NYM
9Eo7DTIbEKCzRhdrlsPjOXRe2cnpfe5LkUQDDlhU4t88lQkE4075AuP1yh1ArbUU
z2Kkboav8AhyaDpg
=ym2a
-----END PGP SIGNATURE-----

X
X
Xinglu Chen wrote on 11 Sep 2021 21:58
Re: [bug#50505] [PATCH 07/12] gnu: Add python-pyrr.
(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
87lf42ubol.fsf@yoctocell.xyz
On Fri, Sep 10 2021, Daniel Meißner via Guix-patches via wrote:

Toggle quote (31 lines)
> * gnu/packages/python-xyz.scm (python-pyrr): New variable.
> ---
> gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 0102dbc4bb..eb0e67c98d 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -18977,6 +18977,31 @@ also written in C++ for high performance.")
> types more concise to write. ")
> (license license:bsd-3)))
>
> +(define-public python-pyrr
> + (package
> + (name "python-pyrr")
> + (version "0.10.3")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "pyrr" version))
> + (sha256
> + (base32
> + "07byxkq8dcc8n6fc2q7g3vq3mxzzj0hqzm8hlq3gfwbf68h7n3rw"))))
> + (build-system python-build-system)
> + (propagated-inputs
> + `(("python-multipledispatch" ,python-multipledispatch)
> + ("python-numpy" ,python-numpy)))
> + (home-page
> + "https://github.com/adamlwgriffiths/Pyrr")

No need for a newline :-)

Toggle quote (3 lines)
> + (synopsis
> + "Mathematical functions for 3D graphics using NumPy")

Likewise.

Toggle quote (5 lines)
> + (description
> + "A collection of object-oriented and procedural interfaces for working
> +with matrices, quaternions, vectors and plane/line/ray objects for 3D
> +graphics.")

The description should consist of one or more complete sentences, see
“16.4.4 Synopses and Descriptions” in the manual. Maybe

This Python package provides collection of object-oriented and
procedural interfaces for working with matrices, quaternions, vectors
and plane/line/ray objects for 3D graphics.

?
Toggle quote (2 lines)
> + (license license:bsd-3)))

The LICENSE file looks more like BSD-2.

Toggle quote (6 lines)
> +
> (define-public python-pyglet
> (package
> (name "python-pyglet")
> --
> 2.33.0
-----BEGIN PGP SIGNATURE-----

iQJJBAEBCAAzFiEEAVhh4yyK5+SEykIzrPUJmaL7XHkFAmE9CloVHHB1YmxpY0B5
b2N0b2NlbGwueHl6AAoJEKz1CZmi+1x51YYP/iO+x3kPvsqG0Jhso1+N++DVItEd
Gz/gCZdsrx1HnZlulqAuRJXrbkSSjFuhLKqZZef5ZBrQtdCih7n5HPRH5/NNIfh4
Ha7jOTv4zXz7uwWUMygX5dfYtbr5TqPGfcakkRVXOnevozNleQMHyj3w/DRx0IAx
KJBI1FTii13046r+vvFd5J8PvgGNra69QvnDI0/eErvXobSF+ZbgMa37mDIK3KuN
LNrjHI2/0OrKkq48CJIBOMtzEz6pcyilWDt9/swqptL6VWlScuuTj37pzh4n0El0
MMCmZLEII1vNeA4nR/qdA7fVo/u58nzaFlsROgBrMqewIlWOERHJGK/xRHH8TJYJ
aTuLRxyaaSNCKIgXkvFNMwl4u2yZXDv70Uyu+/wtfJY5LtMY9+asrAfMT1NapK+J
ssDfneVwyr3MjHe2SVTN6b1YlQ+RHGXrNYKm0h7rQVxcdF//aWlaYuApRzb66G2I
sFAkCs2fRKHqZ5vFpmLN9HHgnz4HHEN+DM8YU+MuwjjJwvZlS4J+ov9SqGoiJNxq
qemVFJtAuXVer1Je01nSDBXAXo3aKiZAe3Lb0iy3v07D+/uAmxxQOS25wyEdQB5L
4/sn/8oiwscnlf6argB9lVcwDaq58/kr9KI6+Z/JnKv9RSGiXI5+pr7oO9vwAsX2
Epu4ntNZFVjU/IIO
=o0tR
-----END PGP SIGNATURE-----

D
D
Daniel Meißner wrote on 13 Sep 2021 16:30
Re: [PATCH 00/12] gnu: Add python-manim
877dfky2d6.fsf@ruhr-uni-bochum.de
Hi Liliana,

Liliana writes:
Toggle quote (6 lines)
> For the tests that need DISPLAY, the usual thing we do here is to spawn
> an Xvfb for display :1 and set DISPLAY accordingly. There are several
> variants depending on what exactly else you need (some with dbus, some
> without), simply grep for "xorg-server-for-tests" and you ought to find
> one that fits your needs.

Thanks for your advice, I was able to spawn an Xvfb for display :1 like
you suggested but apparently, the tests for python-manim want to create
some type of cache folder. The tests now raise a different error:
`Failed to create //.cache for shader cache (Permission
denied)---disabling.' I have to investigate where this error message
comes from. I suppose I have to set some environment variable.
Nevertheless, what would be an appriopiate writable location for the
cache?

Toggle quote (5 lines)
> Once we find out the packages that fail regardless, that have no easy
> fix, it is still acceptable to fix a few failing tests manually by
> patching the test suite, or if all else fails use `#:tests? #f' with an
> appropriate comment.

Alright, thank you. I will give the other tests another try.

Best Daniel
L
L
Liliana Marie Prikler wrote on 13 Sep 2021 16:46
5b089d16fb11d4c507d02b742b0ac54d9e508112.camel@gmail.com
Hi Daniel,

Am Montag, den 13.09.2021, 16:30 +0200 schrieb Daniel Meißner:
Toggle quote (17 lines)
> Hi Liliana,
>
> Liliana writes:
> > For the tests that need DISPLAY, the usual thing we do here is to
> > spawn an Xvfb for display :1 and set DISPLAY accordingly. There
> > are several variants depending on what exactly else you need (some
> > with dbus, some without), simply grep for "xorg-server-for-tests"
> > and you ought to find one that fits your needs.
>
> Thanks for your advice, I was able to spawn an Xvfb for display :1
> like you suggested but apparently, the tests for python-manim want to
> create some type of cache folder. The tests now raise a different
> error: `Failed to create //.cache for shader cache (Permission
> denied)---disabling.' I have to investigate where this error message
> comes from. I suppose I have to set some environment variable.
> Nevertheless, what would be an appriopiate writable location for the
> cache?
Normally, such tests want to write to $HOME/.cache. I'm not sure why
HOME isn't homeless-shelter in this output, but setting HOME or
XDG_CACHE_HOME appropriately ought to resolve this one.

Regards,
Liliana
L
L
Liliana Marie Prikler wrote on 13 Sep 2021 16:49
9cc94eca0fb19f909c4e70643d29ce7b3473679d.camel@gmail.com
Am Montag, den 13.09.2021, 16:46 +0200 schrieb Liliana Marie Prikler:
Toggle quote (23 lines)
> Hi Daniel,
>
> Am Montag, den 13.09.2021, 16:30 +0200 schrieb Daniel Meißner:
> > Hi Liliana,
> >
> > Liliana writes:
> > > For the tests that need DISPLAY, the usual thing we do here is to
> > > spawn an Xvfb for display :1 and set DISPLAY accordingly. There
> > > are several variants depending on what exactly else you need
> > > (some with dbus, some without), simply grep for "xorg-server-for-
> > > tests" and you ought to find one that fits your needs.
> >
> > Thanks for your advice, I was able to spawn an Xvfb for display :1
> > like you suggested but apparently, the tests for python-manim want
> > to create some type of cache folder. The tests now raise a
> > different error: `Failed to create //.cache for shader cache
> > (Permission denied)---disabling.' I have to investigate where this
> > error message comes from. I suppose I have to set some environment
> > variable. Nevertheless, what would be an appriopiate writable
> > location for the cache?
> Normally, such tests want to write to $HOME/.cache. I'm not sure why
> HOME isn't homeless-shelter in this output, but setting HOME or
> XDG_CACHE_HOME appropriately ought to resolve this one.
Oops, forgot about the value, normally we do (setenv "HOME" (getcwd))
in the build directory, for XDG_CACHE_HOME that'd be (string-append
(getcwd) "/.cache"). If whatever creates this cache doesn't honour
XDG_CACHE_HOME, you'll have to find out which variable it honours or
potentially patch it.

Happy hacking!
D
D
Daniel Meißner wrote on 15 Sep 2021 16:32
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 50505@debbugs.gnu.org)
191069719784e6bd26450242799967c518841881.camel@ruhr-uni-bochum.de
Hi Liliana,

Liliana writes:
Toggle quote (10 lines)
> > Normally, such tests want to write to $HOME/.cache. I'm not sure
> > why
> > HOME isn't homeless-shelter in this output, but setting HOME or
> > XDG_CACHE_HOME appropriately ought to resolve this one.
> Oops, forgot about the value, normally we do (setenv "HOME" (getcwd))
> in the build directory, for XDG_CACHE_HOME that'd be (string-append
> (getcwd) "/.cache"). If whatever creates this cache doesn't honour
> XDG_CACHE_HOME, you'll have to find out which variable it honours or
> potentially patch it.

I couldn't find the right variable to make this error message
disappear. I am not even sure where the error message comes from. It
appears somewhere during the check phase of python-pyglet. However,
turned out that this error message was not responsible for the failing
tests and the tests now pass.

Best
Daniel
D
D
Daniel Meißner wrote on 15 Sep 2021 16:54
Re: [bug#50505] [PATCH 01/12] gnu: Add python-cloup.
(name . Xinglu Chen)(address . public@yoctocell.xyz)(address . 50505@debbugs.gnu.org)
7a58ee0d4c8d4f6c9591543721132f460c83f35f.camel@ruhr-uni-bochum.de
Hi Xinglu,

thanks for your thorough review and the fix :) I will prepare a new
patchset implementing the comments.

Best
Daniel
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 00/13] Add python-manim
(address . 50505@debbugs.gnu.org)
20210915152519.25572-1-daniel.meissner-i4k@ruhr-uni-bochum.de
Hi!

The following patchset implements the suggestions by Xinglu and Liliana.

Main points:

* fix tests for all packages
BUT: python-moderngl-window still has some failing tests
* Fix formatting as suggested by Xinglu Chen
* Fix dependencies of python-manim and python-pyglet

Open problems:

Some of the tests of python-moderngl-window fail during `guix build
--keep-failed python-moderngl-window'. However, when changing into the build
directory and running `pytest tests' in a guix environment where the
dependencies are installed, the tests pass. Any ideas?

The package python-manim has an optional LaTeX dependency to allow LaTeX
rendering of equations. The docs[1] say that the full package list they use
is:

amsmath babel-english cbfonts-fd cm-super ctex doublestroke dvisvgm everysel
fontspec frcursive fundus-calligra gnu-freefont jknapltx latex-bin
mathastext microtype ms physics preview ragged2e relsize rsfs
setspace standalone tipa wasy wasysym xcolor xetex xkeyval

Since texlive is a relatively large package: What is the best way to deal with
this optional dependency?


Daniel Meißner (13):
gnu: Add python-cloup.
gnu: Add python-cloup-0.7.
gnu: Add python-glcontext.
gnu: Add python-moderngl.
gnu: Add python-pyglet.
gnu: Add python-multipledispatch.
gnu: Add python-pyrr.
gnu: Add python-screeninfo.
gnu: Add python-moderngl-window.
gnu: Add python-manimpango.
gnu: Add python-mapbox-earcut.
gnu: Add python-screeninfo-0.6.
gnu: Add python-manim 0.9.0.

gnu/local.mk | 3 +
.../python-manimpango-remove-manim-dep.patch | 172 +++++++++
.../python-moderngl-window-skip-tests.patch | 62 ++++
gnu/packages/python-science.scm | 93 +++++
gnu/packages/python-xyz.scm | 341 ++++++++++++++++++
5 files changed, 671 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch
create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch

--
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 02/13] gnu: Add python-cloup-0.7.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-3-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup-0.7): New variable.
---
gnu/packages/python-xyz.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 202cf569d5..659a02e7e6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3343,6 +3343,18 @@ configurable: option groups, constraints, subcommand aliases, subcommands
 sections, and a themeable @code{HelpFormatter}.")
     (license license:bsd-3)))
 
+(define-public python-cloup-0.7
+  (package (inherit python-cloup)
+    (name "python-cloup-0.7")
+    (version "0.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "0yyxibwlxmdkm4866fm4rwpdgy3d6y18n061992ckr54vl0cav7j"))))))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 01/13] gnu: Add python-cloup.
(address . 50505@debbugs.gnu.org)
20210915152519.25572-2-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup): New variable.

Co-authored-by: Xinglu Chen <public@yoctocell.xyz>
---
gnu/packages/python-science.scm | 1 +
gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 738b504e3b..d3730fadcc 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2021 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e98eec19bc..202cf569d5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3308,6 +3308,41 @@ with sensible defaults out of the box.")
         (base32 "0njsm0wn31l21bi118g5825ma5sa3rwn7v2x4wjd7yiiahkri337"))))
     (arguments `())))
 
+(define-public python-cloup
+  (package
+    (name "python-cloup")
+    (version "0.11.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "07kxw81bml137w9bfmwkjbdzbldkk1k1lws82wffz9244pp7k8ib"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest")))))))
+    (propagated-inputs
+     `(("python-click" ,python-click)))
+    (native-inputs
+     `(("python-setuptools" ,python-setuptools)
+       ("python-setuptools-scm" ,python-setuptools-scm/next)
+       ("python-pytest" ,python-pytest)))
+    (home-page "https://github.com/janLuke/cloup")
+    (synopsis "Extension library for @code{python-click}")
+    (description
+     "Cloup---originally from ``Click + option groups''---enriches
+@code{python-click} with several features that make it more expressive and
+configurable: option groups, constraints, subcommand aliases, subcommands
+sections, and a themeable @code{HelpFormatter}.")
+    (license license:bsd-3)))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 04/13] gnu: Add python-moderngl.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-5-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl): New variable.
---
gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 09df43b41d..f10858d315 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18946,6 +18946,31 @@ library.")
 implementation for ModernGL on multiple platforms.")
    (license license:expat)))
 
+(define-public python-moderngl
+  (package
+    (name "python-moderngl")
+    (version "5.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "moderngl" version))
+       (sha256
+        (base32
+         "1ysinnyr3rkdisbihdrn1623l3rw45nx8p2j31dgffsykxah8vcc"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-glcontext" ,python-glcontext)))
+    (home-page "https://github.com/moderngl/moderngl")
+    (synopsis "Python wrapper for OpenGL")
+    (description "ModernGL is a python wrapper over OpenGL 3.3+ core that
+simplifies the creation of simple graphics applications like scientific
+simulations, games or user interfaces.  Usually, acquiring in-depth knowledge
+of OpenGL requires a steep learning curve.  In contrast, ModernGL is easy to
+learn and use, moreover it is capable of rendering with high performance and
+quality, with less code written.  The majority of the moderngl code base is
+also written in C++ for high performance.")
+    (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 05/13] gnu: Add python-pyglet.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-6-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyglet): New variable.
---
gnu/packages/python-xyz.scm | 58 +++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

Toggle diff (71 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f10858d315..a48c228158 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18971,6 +18971,64 @@ quality, with less code written.  The majority of the moderngl code base is
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-pyglet
+  (package
+    (name "python-pyglet")
+    (version "1.5.18")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyglet" version ".zip"))
+       (sha256
+        (base32
+         "044ib8x6pv5rjwj210hq37ry7vi5bizmqkkv1zj8967prk5ii8sq"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-lib-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* '("pyglet/gl/lib_glx.py")
+               (("'GL'")
+                (string-append "\"" (assoc-ref inputs "mesa")
+                               "/lib/libGL.so\""))
+               (("'GLU'")
+                (string-append "\"" (assoc-ref inputs "glu")
+                               "/lib/libGLU.so\"")))
+             (substitute* '("pyglet/font/freetype_lib.py")
+               (("'freetype'")
+                (string-append "\"" (assoc-ref inputs "freetype")
+                               "/lib/libfreetype.so\"")))
+             (substitute* '("pyglet/font/fontconfig.py")
+               (("'fontconfig'")
+                (string-append "\"" (assoc-ref inputs "fontconfig")
+                               "/lib/libfontconfig.so\"")))))
+         (add-before 'check 'prepare-x
+           (lambda _
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "tests/unit"))))))
+    (inputs
+     `(("mesa" ,mesa)
+       ("glu" ,glu)
+       ("freetype" ,freetype)
+       ("fontconfig" ,fontconfig)))
+    (native-inputs
+     `(("unzip" ,unzip)
+       ("python-pytest" ,python-pytest)
+       ("xorg-server" ,xorg-server-for-tests)))
+    (home-page "https://pyglet.readthedocs.io")
+    (synopsis "Cross-platform windowing and multimedia Python library")
+    (description
+     "Pyglet is a Python library for developing games and other visually-rich
+applications.  It supports windowing, user interface event handling,
+Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
+music.  All of this with a friendly Pythonic API that's simple to learn.")
+    (license license:bsd-3)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 08/13] gnu: Add python-screeninfo.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-9-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-screeninfo): New variable.
---
gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4fa193f47e..3a984eaa68 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19071,6 +19071,28 @@ Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-screeninfo
+  (package
+   (name "python-screeninfo")
+   (version "0.7")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri "screeninfo" version))
+     (sha256
+      (base32
+       "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))
+   (build-system python-build-system)
+   (native-inputs `(("python-pytest" ,python-pytest)))
+   (home-page "https://github.com/rr-/screeninfo")
+   (synopsis
+    "Obtain information about physical screens")
+   (description
+    "This python module provides means to access information about physical
+screens like resolution, height and width of the screen, connecting port
+etc.")
+   (license (list license:expat license:bsd-3))))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 06/13] gnu: Add python-multipledispatch.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-7-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-multipledispatch): New variable.
---
gnu/packages/python-xyz.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

Toggle diff (32 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a48c228158..0f445e15bc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18971,6 +18971,25 @@ quality, with less code written.  The majority of the moderngl code base is
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-multipledispatch
+  (package
+    (name "python-multipledispatch")
+    (version "0.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "multipledispatch" version))
+       (sha256
+        (base32
+         "1slblghfjg9fdi9zpd7gmrkvfbv20nrdgnrymcnbky8bzm8i9ax7"))))
+    (build-system python-build-system)
+    (propagated-inputs `(("python-six" ,python-six)))
+    (home-page "https://github.com/mrocklin/multipledispatch/")
+    (synopsis "Multiple dispatch library for Python")
+    (description "This library defines a decorator that makes dispatching on
+types more concise to write.")
+    (license license:bsd-3)))
+
 (define-public python-pyglet
   (package
     (name "python-pyglet")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 07/13] gnu: Add python-pyrr.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-8-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyrr): New variable.
---
gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0f445e15bc..4fa193f47e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18990,6 +18990,29 @@ also written in C++ for high performance.")
 types more concise to write.")
     (license license:bsd-3)))
 
+(define-public python-pyrr
+  (package
+    (name "python-pyrr")
+    (version "0.10.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyrr" version))
+       (sha256
+        (base32
+         "07byxkq8dcc8n6fc2q7g3vq3mxzzj0hqzm8hlq3gfwbf68h7n3rw"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-multipledispatch" ,python-multipledispatch)
+       ("python-numpy" ,python-numpy)))
+    (home-page "https://github.com/adamlwgriffiths/Pyrr")
+    (synopsis "Mathematical functions for 3D graphics using NumPy")
+    (description
+     "This Python package provides a collection of object-oriented and
+procedural interfaces for working with matrices, quaternions, vectors and
+plane/line/ray objects for 3D graphics.")
+    (license license:bsd-2)))
+
 (define-public python-pyglet
   (package
     (name "python-pyglet")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 13/13] gnu: Add python-manim 0.9.0.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-14-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manim): New variable.
---
gnu/packages/python-science.scm | 64 +++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)

Toggle diff (88 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index fcd983520c..df105d5103 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -36,6 +36,7 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gtk)
@@ -55,6 +56,7 @@
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages time)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -1010,3 +1012,65 @@ pandas code.")
      "These are Python bindings for Pango to be used with the mathematical
 animation software Manim.")
     (license license:gpl3+)))
+
+(define-public python-manim
+  (package
+    (name "python-manim")
+    (version "0.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "manim" version))
+       (sha256
+        (base32
+         "0ksp57wcy45xkjips5i4wwm690mhbs2dmlcgsbmiwx78mfk4z0r3"))))
+    (build-system python-build-system)
+    (arguments '(#:phases
+                 (modify-phases %standard-phases
+                   (add-before 'build 'fix-ffmpeg-path
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (substitute* '("manim/constants.py")
+                         (("FFMPEG_BIN: str = \"ffmpeg\"")
+                          (string-append "FFMPEG_BIN: str = \""
+                                         (assoc-ref inputs "ffmpeg")
+                                         "/bin/ffmpeg\"")))))
+                   ;; PyPI package contains no tests for manim but the
+                   ;; setup.py test command fails, so remove it
+                   (delete 'check))))
+    (propagated-inputs
+     `(("python-click" ,python-click)
+       ("python-click-default-group"
+        ,python-click-default-group)
+       ("python-cloup" ,python-cloup-0.7)
+       ("python-colour" ,python-colour)
+       ("python-decorator" ,python-decorator)
+       ("python-manimpango" ,python-manimpango)
+       ("python-mapbox-earcut" ,python-mapbox-earcut)
+       ("python-moderngl" ,python-moderngl)
+       ("python-moderngl-window"
+        ,python-moderngl-window)
+       ("python-networkx" ,python-networkx)
+       ("python-numpy" ,python-numpy)
+       ("python-pillow" ,python-pillow)
+       ("python-pycairo" ,python-pycairo)
+       ("python-pydub" ,python-pydub)
+       ("python-pygments" ,python-pygments)
+       ("python-requests" ,python-requests)
+       ("python-rich" ,python-rich)
+       ("python-scipy" ,python-scipy)
+       ("python-screeninfo" ,python-screeninfo-0.6)
+       ("python-tqdm" ,python-tqdm)
+       ("python-watchdog" ,python-watchdog)))
+    (inputs
+     `(("ffmpeg" ,ffmpeg)))
+    (native-inputs
+     `(("python-wheel" ,python-wheel)))
+    (home-page "https://www.manim.community/")
+    (synopsis
+     "Python animation engine for explanatory math videos")
+    (description
+     "Manim is a Python library for creating mathematical animations.  The
+animations are written as Python code which is based on predefined objects.
+You can make animations with maths formulas (LaTeX-based), simple shapes, 3D
+objects, function graphs and more.")
+    (license license:expat)))
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 11/13] gnu: Add python-mapbox-earcut.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-12-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-mapbox-earcut): New variable.
---
gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0d3efe2700..c5163d93a3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19120,6 +19120,35 @@ system.  Resource loading includes loading of 2D textures/texture arrays,
 shaders and objects/scenes.")
    (license license:expat)))
 
+(define-public python-mapbox-earcut
+  (package
+    (name "python-mapbox-earcut")
+    (version "0.12.10")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mapbox_earcut" version))
+       (sha256
+        (base32
+         "0ly48lijgd9inq07x42pfp9c24fn16vn9axpmfwqrkn979krbnah"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)
+       ("setuptools-scm" ,python-setuptools-scm)
+       ("cmake" ,cmake)))
+    (home-page
+     "https://github.com/skogler/mapbox_earcut_python")
+    (synopsis
+     "Python bindings for the Mapbox Earcut C++ polygon triangulation library")
+    (description
+     "The Mapbox Earcut library is a header-only C++ library which provides a
+fast and robust triangulation of 2D polygons.  This package provides Python
+bindings for this library.")
+    (license license:isc)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 12/13] gnu: Add python-screeninfo-0.6.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-13-daniel.meissner-i4k@ruhr-uni-bochum.de
* (python-screeninfo-0.6): New variable.
---
gnu/packages/python-xyz.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c5163d93a3..592e41f057 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19149,17 +19149,17 @@ fast and robust triangulation of 2D polygons.  This package provides Python
 bindings for this library.")
     (license license:isc)))
 
-(define-public python-screeninfo
+(define-public python-screeninfo-0.6
   (package
    (name "python-screeninfo")
-   (version "0.7")
+   (version "0.6.7")
    (source
     (origin
      (method url-fetch)
      (uri (pypi-uri "screeninfo" version))
      (sha256
       (base32
-       "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))
+       "1jv9m9xhl7zr2hzfx0w5zyw9pajn4b4zpln4rdl3zni9lcfaqjqw"))))
    (build-system python-build-system)
    (native-inputs `(("python-pytest" ,python-pytest)))
    (home-page "https://github.com/rr-/screeninfo")
@@ -19171,6 +19171,17 @@ screens like resolution, height and width of the screen, connecting port
 etc.")
    (license (list license:expat license:bsd-3))))
 
+(define-public python-screeninfo
+  (package/inherit python-screeninfo-0.6
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "screeninfo" version))
+       (sha256
+        (base32
+         "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 10/13] gnu: Add python-manimpango.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-11-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manimpango): New variable.
---
gnu/local.mk | 2 +
.../python-manimpango-remove-manim-dep.patch | 172 ++++++++++++++++++
gnu/packages/python-science.scm | 28 +++
3 files changed, 202 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch

Toggle diff (243 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index d738f97ca8..640b9e3b95 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -44,6 +44,7 @@
 # Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 # Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
 # Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
+# Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 #
 # This file is part of GNU Guix.
 #
@@ -1646,6 +1647,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyfakefs-remove-bad-test.patch	\
   %D%/packages/patches/python-flint-includes.patch		\
   %D%/packages/patches/python-libxml2-utf8.patch		\
+  %D%/packages/patches/python-manimpango-remove-manim-dep.patch \
   %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
   %D%/packages/patches/python-moderngl-window-skip-tests.patch  \
diff --git a/gnu/packages/patches/python-manimpango-remove-manim-dep.patch b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
new file mode 100644
index 0000000000..579c2302d8
--- /dev/null
+++ b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
@@ -0,0 +1,172 @@
+Fix dependency on manim for tests
+
+This fixes a circular dependency between manim and manimpango.
+
+Extracted from upstream:
+https://github.com/ManimCommunity/ManimPango/commit/7e2b17aa14b10bd58af0598cc2de51a406682797
+
+diff --git a/tests/_manim.py b/tests/_manim.py
+index 3ea4676..b11d3e9 100644
+--- a/tests/_manim.py
++++ b/tests/_manim.py
+@@ -2,11 +2,12 @@
+ """This file contains helpers for the tests copied and modified
+ from Manim.
+ """
+-
++import copy
+ import os
++import re
+ from pathlib import Path
+
+-from manimpango import Alignment, MarkupUtils
++from manimpango import Alignment, MarkupUtils, TextSetting, text2svg
+
+
+ class MarkupText:
+@@ -104,3 +105,115 @@ class MarkupText:
+
+     def __repr__(self):
+         return f"MarkupText({repr(self.original_text)})"
++
++
++class Text:
++    def __init__(
++        self,
++        text: str,
++        fill_opacity: float = 1.0,
++        stroke_width: int = 0,
++        size: int = 1,
++        line_spacing: int = -1,
++        font: str = "",
++        slant: str = "NORMAL",
++        weight: str = "NORMAL",
++        gradient: tuple = None,
++        tab_width: int = 4,
++        disable_ligatures: bool = False,
++        filename: str = "text.svg",
++        **kwargs,
++    ) -> None:
++        self.size = size
++        self.filename = filename
++        self.line_spacing = line_spacing
++        self.font = font
++        self.slant = slant
++        self.weight = weight
++        self.gradient = gradient
++        self.tab_width = tab_width
++        self.original_text = text
++        self.disable_ligatures = disable_ligatures
++        text_without_tabs = text
++        self.t2f = self.t2s = self.t2w = {}
++        if text.find("\t") != -1:
++            text_without_tabs = text.replace("\t", " " * self.tab_width)
++        self.text = text_without_tabs
++        if self.line_spacing == -1:
++            self.line_spacing = self.size + self.size * 0.3
++        else:
++            self.line_spacing = self.size + self.size * self.line_spacing
++        self.text2svg()
++
++    def text2settings(self):
++        """Internally used function. Converts the texts and styles
++        to a setting for parsing."""
++        settings = []
++        t2x = [self.t2f, self.t2s, self.t2w]
++        for i in range(len(t2x)):
++            fsw = [self.font, self.slant, self.weight]
++            if t2x[i]:
++                for word, x in list(t2x[i].items()):
++                    for start, end in self.find_indexes(word, self.text):
++                        fsw[i] = x
++                        settings.append(TextSetting(start, end, *fsw))
++        # Set all text settings (default font, slant, weight)
++        fsw = [self.font, self.slant, self.weight]
++        settings.sort(key=lambda setting: setting.start)
++        temp_settings = settings.copy()
++        start = 0
++        for setting in settings:
++            if setting.start != start:
++                temp_settings.append(TextSetting(start, setting.start, *fsw))
++            start = setting.end
++        if start != len(self.text):
++            temp_settings.append(TextSetting(start, len(self.text), *fsw))
++        settings = sorted(temp_settings, key=lambda setting: setting.start)
++
++        if re.search(r"\n", self.text):
++            line_num = 0
++            for start, end in self.find_indexes("\n", self.text):
++                for setting in settings:
++                    if setting.line_num == -1:
++                        setting.line_num = line_num
++                    if start < setting.end:
++                        line_num += 1
++                        new_setting = copy.copy(setting)
++                        setting.end = end
++                        new_setting.start = end
++                        new_setting.line_num = line_num
++                        settings.append(new_setting)
++                        settings.sort(key=lambda setting: setting.start)
++                        break
++        for setting in settings:
++            if setting.line_num == -1:
++                setting.line_num = 0
++        return settings
++
++    def text2svg(self):
++        """Internally used function.
++        Convert the text to SVG using Pango
++        """
++        size = self.size * 10
++        line_spacing = self.line_spacing * 10
++        dir_name = Path(self.filename).parent
++        disable_liga = self.disable_ligatures
++        if not os.path.exists(dir_name):
++            os.makedirs(dir_name)
++        file_name = self.filename
++        settings = self.text2settings()
++        width = 600
++        height = 400
++
++        return text2svg(
++            settings,
++            size,
++            line_spacing,
++            disable_liga,
++            file_name,
++            30,
++            30,
++            width,
++            height,
++            self.text,
++        )
+diff --git a/tests/test_fonts.py b/tests/test_fonts.py
+index 51e7eb4..da42895 100644
+--- a/tests/test_fonts.py
++++ b/tests/test_fonts.py
+@@ -3,13 +3,12 @@ import sys
+ from pathlib import Path
+ from shutil import copyfile
+
+-import manim
+ import pytest
+
+ import manimpango
+
+ from . import FONT_DIR
+-from ._manim import MarkupText
++from ._manim import MarkupText, Text
+
+ font_lists = {
+     (FONT_DIR / "AdobeVFPrototype.ttf").absolute(): "Adobe Variable Font Prototype",
+@@ -38,7 +37,7 @@ def test_register_font(font_name):
+ @pytest.mark.parametrize("font_name", font_lists.values())
+ def test_warning(capfd, font_name):
+     print(font_name)
+-    manim.Text("Testing", font=font_name)
++    Text("Testing", font=font_name)
+     captured = capfd.readouterr()
+     assert "Pango-WARNING **" not in captured.err, "Looks like pango raised a warning?"
+
+--
+2.32.0
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index d3730fadcc..fcd983520c 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -38,6 +38,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
@@ -982,3 +983,30 @@ pandas notebooks, scripts, and libraries.  Unlike other distributed DataFrame
 libraries, Modin provides seamless integration and compatibility with existing
 pandas code.")
     (license license:asl2.0)))
+
+(define-public python-manimpango
+  (package
+    (name "python-manimpango")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ManimPango" version))
+       (sha256
+        (base32
+         "1j2mbhf7d82718nkc0r8x7cf35hlh13b67qkczjbbys3w24nyfsw"))
+       (patches (search-patches "python-manimpango-remove-manim-dep.patch"))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("Cython" ,python-cython)
+       ("python-pytest" ,python-pytest)))
+    (inputs
+     `(("pango" ,pango)))
+    (home-page "https://manimpango.manim.community/")
+    (synopsis
+     "Bindings for pango for use with Manim")
+    (description
+     "These are Python bindings for Pango to be used with the mathematical
+animation software Manim.")
+    (license license:gpl3+)))
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 03/13] gnu: Add python-glcontext.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-4-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-glcontext): New variable.
---
gnu/packages/python-xyz.scm | 58 +++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+)

Toggle diff (71 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 659a02e7e6..09df43b41d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18888,6 +18888,64 @@ library.")
     (description
      "This is the Cython-coded accelerator module for PyOpenGL.")))
 
+(define-public python-glcontext
+  (package
+   (name "python-glcontext")
+   (version "2.3.4")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://github.com/moderngl/glcontext")
+           (commit version)))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32
+       "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
+   (build-system python-build-system)
+   (arguments
+    '(#:phases
+      (modify-phases %standard-phases
+        (add-before 'build 'fix-lib-paths
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (let ((mesa (assoc-ref inputs "mesa"))
+                  (libx11 (assoc-ref inputs "libx11")))
+              (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
+                (("\"libGL.so\"")
+                 (string-append "\"" mesa  "/lib/libGL.so\""))
+                (("\"libEGL.so\"")
+                 (string-append "\"" mesa "/lib/libEGL.so\""))
+                (("\"libX11.so\"")
+                 (string-append "\"" libx11 "/lib/libX11.so\"")))
+              (substitute* '("glcontext/__init__.py")
+                (("find_library\\('GL'\\)")
+                 (string-append "'" mesa "/lib/libGL.so'"))
+                (("find_library\\('EGL'\\)")
+                 (string-append "'" mesa "/lib/libEGL.so'"))
+                (("find_library\\(\"X11\"\\)")
+                 (string-append "'" libx11 "/lib/libX11.so'"))))))
+        (add-before 'check 'prepare-x
+          (lambda _
+            (system "Xvfb :1 &")
+            (setenv "DISPLAY" ":1")))
+        (replace 'check
+          (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+            (when tests?
+              (add-installed-pythonpath inputs outputs)
+              (invoke "pytest" "tests")))))))
+   (inputs
+    `(("libx11" ,libx11)
+      ("mesa" ,mesa)))
+   (native-inputs
+    `(("xorg-server" ,xorg-server-for-tests)
+      ("python-pytest" ,python-pytest)
+      ("python-psutil" ,python-psutil)))
+   (home-page "https://github.com/moderngl/glcontext")
+   (synopsis "Portable OpenGL Context for ModernGL")
+   (description "Python-glcontext is a library providing an OpenGL
+implementation for ModernGL on multiple platforms.")
+   (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.33.0
D
D
Daniel Meißner wrote on 15 Sep 2021 17:25
[PATCH v2 09/13] gnu: Add python-moderngl-window.
(address . 50505@debbugs.gnu.org)(name . Daniel Meißner)(address . daniel.meissner-i4k@ruhr-uni-bochum.de)
20210915152519.25572-10-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl-window): New variable.
---
gnu/local.mk | 1 +
.../python-moderngl-window-skip-tests.patch | 62 +++++++++++++++++++
gnu/packages/python-xyz.scm | 49 +++++++++++++++
3 files changed, 112 insertions(+)
create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch

Toggle diff (142 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 175e691a63..d738f97ca8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1648,6 +1648,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-libxml2-utf8.patch		\
   %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
+  %D%/packages/patches/python-moderngl-window-skip-tests.patch  \
   %D%/packages/patches/python-mox3-python3.6-compat.patch	\
   %D%/packages/patches/python-testtools.patch			\
   %D%/packages/patches/python-packaging-test-arch.patch		\
diff --git a/gnu/packages/patches/python-moderngl-window-skip-tests.patch b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
new file mode 100644
index 0000000000..cbfefa6c3a
--- /dev/null
+++ b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
@@ -0,0 +1,62 @@
+Skip tests for optional dependencies
+
+The Python packages pywavefront and trimesh are optional dependencies and not
+yet packaged in Guix but the tests try to load the modules anyway.  Therefore
+skip them.
+
+diff --git a/tests/test_docs.py b/tests/test_docs.py
+index e4a38df..99a2aa0 100644
+--- a/tests/test_docs.py
++++ b/tests/test_docs.py
+@@ -133,20 +133,11 @@ class TestCase(unittest.TestCase):
+ 
+     # --- Loaders : Scene ---
+ 
+-    def test_loaders_wavefront(self):
+-        self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.wavefront', 'Loader')
+-
+     def test_loaders_gltf(self):
+         self.validate('loaders/gltf2.rst', 'moderngl_window.loaders.scene.gltf2', 'Loader')
+ 
+-    def test_loaders_stl(self):
+-        self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.stl', 'Loader')
+-
+     # --- Loaders : Program ---
+ 
+-    def test_loader_single(self):
+-        self.validate('loaders/single.rst', 'moderngl_window.loaders.program.single', 'Loader')
+-
+     def test_loader_separate(self):
+         self.validate('loaders/separate.rst', 'moderngl_window.loaders.program.separate', 'Loader')
+ 
+diff --git a/tests/test_loaders_scene.py b/tests/test_loaders_scene.py
+index c577315..2eef889 100644
+--- a/tests/test_loaders_scene.py
++++ b/tests/test_loaders_scene.py
+@@ -16,16 +16,6 @@ class SceneLoadersTestCase(HeadlessTestCase):
+     window_size = (16, 16)
+     aspect_ratio = 1.0
+ 
+-    def test_wavefront(self):
+-        """Load wavefront file"""
+-        scene = resources.scenes.load(SceneDescription(path='scenes/crate/crate.obj'))
+-        self.assertIsInstance(scene, Scene)
+-
+-    def test_wavefont_not_found(self):
+-        """Ensure ImproperlyConfigured is raised when wavefront is not found"""
+-        with self.assertRaises(ImproperlyConfigured):
+-            resources.scenes.load(SceneDescription(path='scenes/doesnotexist.obj'))
+-
+     def test_gltf(self):
+         """Load standard gltf"""
+         scene = resources.scenes.load(SceneDescription(path='scenes/BoxTextured/glTF/BoxTextured.gltf'))
+@@ -45,7 +35,3 @@ class SceneLoadersTestCase(HeadlessTestCase):
+         """Attempt to load nonexisting gltf"""
+         with self.assertRaises(ImproperlyConfigured):
+             resources.scenes.load(SceneDescription(path='scenes/doesnotexist.gltf'))
+-
+-    def test_stl(self):
+-        scene = resources.scenes.load(SceneDescription(path='scenes/uplink.stl'))
+-        self.assertIsInstance(scene, Scene)
+-- 
+2.33.0
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3a984eaa68..0d3efe2700 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19071,6 +19071,55 @@ Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-moderngl-window
+  (package
+   (name "python-moderngl-window")
+   (version "2.4.0")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/moderngl/moderngl-window")
+                  (commit version)))
+            (file-name (git-file-name name version))
+            (patches
+             (search-patches "python-moderngl-window-skip-tests.patch"))
+            (sha256
+             (base32
+              "1fvhm6ln3q5kl5m5q3gzfmx1kpyn054fhpcrgpqz8809dxi7pzcv"))))
+   (build-system python-build-system)
+   (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'prepare-x
+           (lambda _
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")))
+         (add-before 'check 'fix-test
+           (lambda _
+             (substitute* '("tests/test_windowconfig.py")
+               (("terrain_Vs.glsl") "terrain_vs.glsl"))))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             (invoke "pytest" "tests" ))))))
+   (propagated-inputs
+    `(("python-pillow" ,python-pillow)
+      ("python-pyrr" ,python-pyrr)
+      ("python-numpy" ,python-numpy)
+      ("python-moderngl" ,python-moderngl)
+      ("python-pyglet" ,python-pyglet)))
+   (native-inputs
+    `(("python-pytest" ,python-pytest)
+      ("xorg-server" ,xorg-server-for-tests)))
+   (home-page "https://github.com/moderngl/moderngl-window")
+   (synopsis "Cross-platform utility library for ModernGL")
+   (description "This ModernGL utility library simplifies window creation and
+resource loading.  You can create a window for ModernGL using pyglet, pygame,
+PySide2, GLFW, SDL2, PyQt5 or tkinter.  Events are unified into a single event
+system.  Resource loading includes loading of 2D textures/texture arrays,
+shaders and objects/scenes.")
+   (license license:expat)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.33.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 00/13] Add python-manim and its missing dependencies
(address . 50505@debbugs.gnu.org)
20220101235155.5754-1-daniel.meissner-i4k@ruhr-uni-bochum.de
Hi Liliana, hi Xinglu,

I have adapted the patch set to the new input field style and I would be very
happy if you could, once more, review the patches and push them to master if
they look fine to you.

Thanks,
Daniel

Daniel Meißner (13):
gnu: Add python-cloup.
gnu: Add python-cloup-0.7.
gnu: Add python-glcontext.
gnu: Add python-moderngl.
gnu: Add python-pyglet.
gnu: Add python-multipledispatch.
gnu: Add python-pyrr.
gnu: Add python-screeninfo.
gnu: Add python-moderngl-window.
gnu: Add python-manimpango.
gnu: Add python-mapbox-earcut.
gnu: Add python-screeninfo-0.6.
gnu: Add python-manim 0.9.0.

gnu/local.mk | 3 +
.../python-manimpango-remove-manim-dep.patch | 172 ++++++++++
.../python-moderngl-window-skip-tests.patch | 146 +++++++++
gnu/packages/python-science.scm | 88 +++++
gnu/packages/python-xyz.scm | 303 ++++++++++++++++++
5 files changed, 712 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch
create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch

--
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 01/12] gnu: Add python-cloup.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-2-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup): New variable.

Co-authored-by: Xinglu Chen <public@yoctocell.xyz>
---
gnu/packages/python-science.scm | 1 +
gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 1311fbad0c..65f1dbf014 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2021 Paul Garlick <pgarlick@tourbillion-technology.com>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 27f8c11c9c..db511a178f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3430,6 +3430,39 @@ (define-public python-cligj
 well-tested and interoperable CLIs for handling GeoJSON.")
     (license license:bsd-3)))
 
+(define-public python-cloup
+  (package
+    (name "python-cloup")
+    (version "0.11.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "07kxw81bml137w9bfmwkjbdzbldkk1k1lws82wffz9244pp7k8ib"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest")))))))
+    (propagated-inputs
+     (list python-click))
+    (native-inputs
+     (list python-setuptools python-setuptools-scm python-pytest))
+    (home-page "https://github.com/janLuke/cloup")
+    (synopsis "Extension library for @code{python-click}")
+    (description
+     "Cloup---originally from ``Click + option groups''---enriches
+@code{python-click} with several features that make it more expressive and
+configurable: option groups, constraints, subcommand aliases, subcommands
+sections, and a themeable @code{HelpFormatter}.")
+    (license license:bsd-3)))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 02/12] gnu: Add python-cloup-0.7.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-3-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-cloup-0.7): New variable.
---
gnu/packages/python-xyz.scm | 12 ++++++++++++
1 file changed, 12 insertions(+)

Toggle diff (25 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index db511a178f..deff85e797 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -3463,6 +3463,18 @@ (define-public python-cloup
 sections, and a themeable @code{HelpFormatter}.")
     (license license:bsd-3)))
 
+(define-public python-cloup-0.7
+  (package (inherit python-cloup)
+    (name "python-cloup-0.7")
+    (version "0.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cloup" version))
+       (sha256
+        (base32
+         "0yyxibwlxmdkm4866fm4rwpdgy3d6y18n061992ckr54vl0cav7j"))))))
+
 (define-public python-vcversioner
   (package
     (name "python-vcversioner")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 03/12] gnu: Add python-glcontext.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-4-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-glcontext): New variable.
---
gnu/packages/python-xyz.scm | 53 +++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)

Toggle diff (66 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index deff85e797..d8e6fa070e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19555,6 +19555,59 @@ (define-public python-pyopengl-accelerate
     (description
      "This is the Cython-coded accelerator module for PyOpenGL.")))
 
+(define-public python-glcontext
+  (package
+   (name "python-glcontext")
+   (version "2.3.4")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://github.com/moderngl/glcontext")
+           (commit version)))
+     (file-name (git-file-name name version))
+     (sha256
+      (base32
+       "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
+   (build-system python-build-system)
+   (arguments
+    '(#:phases
+      (modify-phases %standard-phases
+        (add-before 'build 'fix-lib-paths
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (let ((mesa (assoc-ref inputs "mesa"))
+                  (libx11 (assoc-ref inputs "libx11")))
+              (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
+                (("\"libGL.so\"")
+                 (string-append "\"" mesa  "/lib/libGL.so\""))
+                (("\"libEGL.so\"")
+                 (string-append "\"" mesa "/lib/libEGL.so\""))
+                (("\"libX11.so\"")
+                 (string-append "\"" libx11 "/lib/libX11.so\"")))
+              (substitute* '("glcontext/__init__.py")
+                (("find_library\\('GL'\\)")
+                 (string-append "'" mesa "/lib/libGL.so'"))
+                (("find_library\\('EGL'\\)")
+                 (string-append "'" mesa "/lib/libEGL.so'"))
+                (("find_library\\(\"X11\"\\)")
+                 (string-append "'" libx11 "/lib/libX11.so'"))))))
+        (replace 'check
+          (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+            (when tests?
+              (system "Xvfb :1 &")
+              (setenv "DISPLAY" ":1")
+              (add-installed-pythonpath inputs outputs)
+              (invoke "pytest" "tests")))))))
+   (inputs
+    (list libx11 mesa))
+   (native-inputs
+    (list xorg-server-for-tests python-pytest python-psutil))
+   (home-page "https://github.com/moderngl/glcontext")
+   (synopsis "Portable OpenGL Context for ModernGL")
+   (description "Python-glcontext is a library providing an OpenGL
+implementation for ModernGL on multiple platforms.")
+   (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 04/12] gnu: Add python-moderngl.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-5-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl): New variable.
---
gnu/packages/python-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d8e6fa070e..21cf780338 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19608,6 +19608,31 @@ (define-public python-glcontext
 implementation for ModernGL on multiple platforms.")
    (license license:expat)))
 
+(define-public python-moderngl
+  (package
+    (name "python-moderngl")
+    (version "5.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "moderngl" version))
+       (sha256
+        (base32
+         "1ysinnyr3rkdisbihdrn1623l3rw45nx8p2j31dgffsykxah8vcc"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     (list python-glcontext))
+    (home-page "https://github.com/moderngl/moderngl")
+    (synopsis "Python wrapper for OpenGL")
+    (description "ModernGL is a python wrapper over OpenGL 3.3+ core that
+simplifies the creation of simple graphics applications like scientific
+simulations, games or user interfaces.  Usually, acquiring in-depth knowledge
+of OpenGL requires a steep learning curve.  In contrast, ModernGL is easy to
+learn and use, moreover it is capable of rendering with high performance and
+quality, with less code written.  The majority of the moderngl code base is
+also written in C++ for high performance.")
+    (license license:expat)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 05/12] gnu: Add python-pyglet.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-6-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyglet): New variable.
---
gnu/packages/python-xyz.scm | 55 +++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 21cf780338..e0d65daf91 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19633,6 +19633,61 @@ (define-public python-moderngl
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-pyglet
+  (package
+    (name "python-pyglet")
+    (version "1.5.18")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyglet" version ".zip"))
+       (sha256
+        (base32
+         "044ib8x6pv5rjwj210hq37ry7vi5bizmqkkv1zj8967prk5ii8sq"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-lib-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* '("pyglet/gl/lib_glx.py")
+               (("'GL'")
+                (string-append "\"" (assoc-ref inputs "mesa")
+                               "/lib/libGL.so\""))
+               (("'GLU'")
+                (string-append "\"" (assoc-ref inputs "glu")
+                               "/lib/libGLU.so\"")))
+             (substitute* '("pyglet/font/freetype_lib.py")
+               (("'freetype'")
+                (string-append "\"" (assoc-ref inputs "freetype")
+                               "/lib/libfreetype.so\"")))
+             (substitute* '("pyglet/font/fontconfig.py")
+               (("'fontconfig'")
+                (string-append "\"" (assoc-ref inputs "fontconfig")
+                               "/lib/libfontconfig.so\"")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (system "Xvfb :1 &")
+               (setenv "DISPLAY" ":1")
+               (add-installed-pythonpath inputs outputs)
+               (invoke "pytest" "tests/unit")))))))
+    (inputs
+     `(("mesa" ,mesa)
+       ("glu" ,glu)
+       ("freetype" ,freetype)
+       ("fontconfig" ,fontconfig)))
+    (native-inputs
+     (list unzip python-pytest xorg-server-for-tests))
+    (home-page "https://pyglet.readthedocs.io")
+    (synopsis "Cross-platform windowing and multimedia Python library")
+    (description
+     "Pyglet is a Python library for developing games and other visually-rich
+applications.  It supports windowing, user interface event handling,
+Joysticks, OpenGL graphics, loading images and videos, and playing sounds and
+music.  All of this with a friendly Pythonic API that's simple to learn.")
+    (license license:bsd-3)))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 06/12] gnu: Add python-pyrr.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-7-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-pyrr): New variable.
---
gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e0d65daf91..d706d208af 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19633,6 +19633,28 @@ (define-public python-moderngl
 also written in C++ for high performance.")
     (license license:expat)))
 
+(define-public python-pyrr
+  (package
+    (name "python-pyrr")
+    (version "0.10.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyrr" version))
+       (sha256
+        (base32
+         "07byxkq8dcc8n6fc2q7g3vq3mxzzj0hqzm8hlq3gfwbf68h7n3rw"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     (list python-multipledispatch python-numpy))
+    (home-page "https://github.com/adamlwgriffiths/Pyrr")
+    (synopsis "Mathematical functions for 3D graphics using NumPy")
+    (description
+     "This Python package provides a collection of object-oriented and
+procedural interfaces for working with matrices, quaternions, vectors and
+plane/line/ray objects for 3D graphics.")
+    (license license:bsd-2)))
+
 (define-public python-pyglet
   (package
     (name "python-pyglet")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 07/12] gnu: Add python-screeninfo.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-8-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-screeninfo): New variable.
---
gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d706d208af..0dbc9db830 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19710,6 +19710,28 @@ (define-public python-pyglet
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-screeninfo
+  (package
+   (name "python-screeninfo")
+   (version "0.7")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (pypi-uri "screeninfo" version))
+     (sha256
+      (base32
+       "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))
+   (build-system python-build-system)
+   (native-inputs `(("python-pytest" ,python-pytest)))
+   (home-page "https://github.com/rr-/screeninfo")
+   (synopsis
+    "Obtain information about physical screens")
+   (description
+    "This python module provides means to access information about physical
+screens like resolution, height and width of the screen, connecting port
+etc.")
+   (license (list license:expat license:bsd-3))))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 09/12] gnu: Add python-manimpango.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-10-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manimpango): New variable.
---
gnu/local.mk | 2 +
.../python-manimpango-remove-manim-dep.patch | 172 ++++++++++++++++++
gnu/packages/python-science.scm | 26 +++
3 files changed, 200 insertions(+)
create mode 100644 gnu/packages/patches/python-manimpango-remove-manim-dep.patch

Toggle diff (241 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ff3e80ea68..c5fe7d87b8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -47,6 +47,7 @@
 # Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
 # Copyright © 2021 Andrew Tropin <andrew@trop.in>
 # Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+# Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 #
 # This file is part of GNU Guix.
 #
@@ -1683,6 +1684,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-flint-includes.patch		\
   %D%/packages/patches/python-libxml2-utf8.patch		\
   %D%/packages/patches/python-magic-python-bytecode.patch	\
+  %D%/packages/patches/python-manimpango-remove-manim-dep.patch \
   %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
   %D%/packages/patches/python-moderngl-window-skip-tests.patch  \
diff --git a/gnu/packages/patches/python-manimpango-remove-manim-dep.patch b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
new file mode 100644
index 0000000000..579c2302d8
--- /dev/null
+++ b/gnu/packages/patches/python-manimpango-remove-manim-dep.patch
@@ -0,0 +1,172 @@
+Fix dependency on manim for tests
+
+This fixes a circular dependency between manim and manimpango.
+
+Extracted from upstream:
+https://github.com/ManimCommunity/ManimPango/commit/7e2b17aa14b10bd58af0598cc2de51a406682797
+
+diff --git a/tests/_manim.py b/tests/_manim.py
+index 3ea4676..b11d3e9 100644
+--- a/tests/_manim.py
++++ b/tests/_manim.py
+@@ -2,11 +2,12 @@
+ """This file contains helpers for the tests copied and modified
+ from Manim.
+ """
+-
++import copy
+ import os
++import re
+ from pathlib import Path
+
+-from manimpango import Alignment, MarkupUtils
++from manimpango import Alignment, MarkupUtils, TextSetting, text2svg
+
+
+ class MarkupText:
+@@ -104,3 +105,115 @@ class MarkupText:
+
+     def __repr__(self):
+         return f"MarkupText({repr(self.original_text)})"
++
++
++class Text:
++    def __init__(
++        self,
++        text: str,
++        fill_opacity: float = 1.0,
++        stroke_width: int = 0,
++        size: int = 1,
++        line_spacing: int = -1,
++        font: str = "",
++        slant: str = "NORMAL",
++        weight: str = "NORMAL",
++        gradient: tuple = None,
++        tab_width: int = 4,
++        disable_ligatures: bool = False,
++        filename: str = "text.svg",
++        **kwargs,
++    ) -> None:
++        self.size = size
++        self.filename = filename
++        self.line_spacing = line_spacing
++        self.font = font
++        self.slant = slant
++        self.weight = weight
++        self.gradient = gradient
++        self.tab_width = tab_width
++        self.original_text = text
++        self.disable_ligatures = disable_ligatures
++        text_without_tabs = text
++        self.t2f = self.t2s = self.t2w = {}
++        if text.find("\t") != -1:
++            text_without_tabs = text.replace("\t", " " * self.tab_width)
++        self.text = text_without_tabs
++        if self.line_spacing == -1:
++            self.line_spacing = self.size + self.size * 0.3
++        else:
++            self.line_spacing = self.size + self.size * self.line_spacing
++        self.text2svg()
++
++    def text2settings(self):
++        """Internally used function. Converts the texts and styles
++        to a setting for parsing."""
++        settings = []
++        t2x = [self.t2f, self.t2s, self.t2w]
++        for i in range(len(t2x)):
++            fsw = [self.font, self.slant, self.weight]
++            if t2x[i]:
++                for word, x in list(t2x[i].items()):
++                    for start, end in self.find_indexes(word, self.text):
++                        fsw[i] = x
++                        settings.append(TextSetting(start, end, *fsw))
++        # Set all text settings (default font, slant, weight)
++        fsw = [self.font, self.slant, self.weight]
++        settings.sort(key=lambda setting: setting.start)
++        temp_settings = settings.copy()
++        start = 0
++        for setting in settings:
++            if setting.start != start:
++                temp_settings.append(TextSetting(start, setting.start, *fsw))
++            start = setting.end
++        if start != len(self.text):
++            temp_settings.append(TextSetting(start, len(self.text), *fsw))
++        settings = sorted(temp_settings, key=lambda setting: setting.start)
++
++        if re.search(r"\n", self.text):
++            line_num = 0
++            for start, end in self.find_indexes("\n", self.text):
++                for setting in settings:
++                    if setting.line_num == -1:
++                        setting.line_num = line_num
++                    if start < setting.end:
++                        line_num += 1
++                        new_setting = copy.copy(setting)
++                        setting.end = end
++                        new_setting.start = end
++                        new_setting.line_num = line_num
++                        settings.append(new_setting)
++                        settings.sort(key=lambda setting: setting.start)
++                        break
++        for setting in settings:
++            if setting.line_num == -1:
++                setting.line_num = 0
++        return settings
++
++    def text2svg(self):
++        """Internally used function.
++        Convert the text to SVG using Pango
++        """
++        size = self.size * 10
++        line_spacing = self.line_spacing * 10
++        dir_name = Path(self.filename).parent
++        disable_liga = self.disable_ligatures
++        if not os.path.exists(dir_name):
++            os.makedirs(dir_name)
++        file_name = self.filename
++        settings = self.text2settings()
++        width = 600
++        height = 400
++
++        return text2svg(
++            settings,
++            size,
++            line_spacing,
++            disable_liga,
++            file_name,
++            30,
++            30,
++            width,
++            height,
++            self.text,
++        )
+diff --git a/tests/test_fonts.py b/tests/test_fonts.py
+index 51e7eb4..da42895 100644
+--- a/tests/test_fonts.py
++++ b/tests/test_fonts.py
+@@ -3,13 +3,12 @@ import sys
+ from pathlib import Path
+ from shutil import copyfile
+
+-import manim
+ import pytest
+
+ import manimpango
+
+ from . import FONT_DIR
+-from ._manim import MarkupText
++from ._manim import MarkupText, Text
+
+ font_lists = {
+     (FONT_DIR / "AdobeVFPrototype.ttf").absolute(): "Adobe Variable Font Prototype",
+@@ -38,7 +37,7 @@ def test_register_font(font_name):
+ @pytest.mark.parametrize("font_name", font_lists.values())
+ def test_warning(capfd, font_name):
+     print(font_name)
+-    manim.Text("Testing", font=font_name)
++    Text("Testing", font=font_name)
+     captured = capfd.readouterr()
+     assert "Pango-WARNING **" not in captured.err, "Looks like pango raised a warning?"
+
+--
+2.32.0
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 65f1dbf014..61628ec956 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -39,6 +39,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages check)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
@@ -1037,3 +1038,28 @@ (define-public python-modin
 libraries, Modin provides seamless integration and compatibility with existing
 pandas code.")
     (license license:asl2.0)))
+
+(define-public python-manimpango
+  (package
+    (name "python-manimpango")
+    (version "0.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ManimPango" version))
+       (sha256
+        (base32
+         "1j2mbhf7d82718nkc0r8x7cf35hlh13b67qkczjbbys3w24nyfsw"))
+       (patches (search-patches "python-manimpango-remove-manim-dep.patch"))))
+    (build-system python-build-system)
+    (native-inputs
+     (list pkg-config python-cython python-pytest))
+    (inputs
+     (list pango))
+    (home-page "https://manimpango.manim.community/")
+    (synopsis
+     "Bindings for pango for use with Manim")
+    (description
+     "These are Python bindings for Pango to be used with the mathematical
+animation software Manim.")
+    (license license:gpl3+)))
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 10/12] gnu: Add python-mapbox-earcut.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-11-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-mapbox-earcut): New variable.
---
gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index eee2fc0077..5e43b0ca03 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19754,6 +19754,32 @@ (define-public python-moderngl-window
 shaders and objects/scenes.")
    (license license:expat)))
 
+(define-public python-mapbox-earcut
+  (package
+    (name "python-mapbox-earcut")
+    (version "0.12.10")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mapbox_earcut" version))
+       (sha256
+        (base32
+         "0ly48lijgd9inq07x42pfp9c24fn16vn9axpmfwqrkn979krbnah"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     (list python-numpy))
+    (native-inputs
+     (list python-pytest python-wheel python-setuptools-scm cmake))
+    (home-page
+     "https://github.com/skogler/mapbox_earcut_python")
+    (synopsis
+     "Python bindings for the Mapbox Earcut C++ polygon triangulation library")
+    (description
+     "The Mapbox Earcut library is a header-only C++ library which provides a
+fast and robust triangulation of 2D polygons.  This package provides Python
+bindings for this library.")
+    (license license:isc)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 08/12] gnu: Add python-moderngl-window.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-9-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-xyz.scm (python-moderngl-window): New variable.
---
gnu/local.mk | 1 +
.../python-moderngl-window-skip-tests.patch | 146 ++++++++++++++++++
gnu/packages/python-xyz.scm | 44 ++++++
3 files changed, 191 insertions(+)
create mode 100644 gnu/packages/patches/python-moderngl-window-skip-tests.patch

Toggle diff (221 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 852f9f3246..ff3e80ea68 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1685,6 +1685,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-magic-python-bytecode.patch	\
   %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
+  %D%/packages/patches/python-moderngl-window-skip-tests.patch  \
   %D%/packages/patches/python-mox3-python3.6-compat.patch	\
   %D%/packages/patches/python-typing-inspect-fix.patch		\
   %D%/packages/patches/python-packaging-test-arch.patch		\
diff --git a/gnu/packages/patches/python-moderngl-window-skip-tests.patch b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
new file mode 100644
index 0000000000..aee4b71e2a
--- /dev/null
+++ b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
@@ -0,0 +1,146 @@
+Skip failing tests and tests for optional dependencies
+
+The Python packages pywavefront and trimesh are optional dependencies and not
+yet packaged in Guix but the tests try to load the modules anyway.  Therefore
+skip them.
+
+The tests test_texture_mimpamps, test_texture_abspath, test_load_texture_2d
+and test_load_texture_array fail when Guix builds the package.  This is not
+the case when running the tests directly from a source tree.
+
+diff --git a/tests/test_docs.py b/tests/test_docs.py
+index e4a38df..99a2aa0 100644
+--- a/tests/test_docs.py
++++ b/tests/test_docs.py
+@@ -133,20 +133,11 @@ class TestCase(unittest.TestCase):
+ 
+     # --- Loaders : Scene ---
+ 
+-    def test_loaders_wavefront(self):
+-        self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.wavefront', 'Loader')
+-
+     def test_loaders_gltf(self):
+         self.validate('loaders/gltf2.rst', 'moderngl_window.loaders.scene.gltf2', 'Loader')
+ 
+-    def test_loaders_stl(self):
+-        self.validate('loaders/wavefront.rst', 'moderngl_window.loaders.scene.stl', 'Loader')
+-
+     # --- Loaders : Program ---
+ 
+-    def test_loader_single(self):
+-        self.validate('loaders/single.rst', 'moderngl_window.loaders.program.single', 'Loader')
+-
+     def test_loader_separate(self):
+         self.validate('loaders/separate.rst', 'moderngl_window.loaders.program.separate', 'Loader')
+ 
+diff --git a/tests/test_loaders_scene.py b/tests/test_loaders_scene.py
+index c577315..2eef889 100644
+--- a/tests/test_loaders_scene.py
++++ b/tests/test_loaders_scene.py
+@@ -16,16 +16,6 @@ class SceneLoadersTestCase(HeadlessTestCase):
+     window_size = (16, 16)
+     aspect_ratio = 1.0
+ 
+-    def test_wavefront(self):
+-        """Load wavefront file"""
+-        scene = resources.scenes.load(SceneDescription(path='scenes/crate/crate.obj'))
+-        self.assertIsInstance(scene, Scene)
+-
+-    def test_wavefont_not_found(self):
+-        """Ensure ImproperlyConfigured is raised when wavefront is not found"""
+-        with self.assertRaises(ImproperlyConfigured):
+-            resources.scenes.load(SceneDescription(path='scenes/doesnotexist.obj'))
+-
+     def test_gltf(self):
+         """Load standard gltf"""
+         scene = resources.scenes.load(SceneDescription(path='scenes/BoxTextured/glTF/BoxTextured.gltf'))
+@@ -45,7 +35,3 @@ class SceneLoadersTestCase(HeadlessTestCase):
+         """Attempt to load nonexisting gltf"""
+         with self.assertRaises(ImproperlyConfigured):
+             resources.scenes.load(SceneDescription(path='scenes/doesnotexist.gltf'))
+-
+-    def test_stl(self):
+-        scene = resources.scenes.load(SceneDescription(path='scenes/uplink.stl'))
+-        self.assertIsInstance(scene, Scene)
+diff --git a/tests/test_loaders_texture.py b/tests/test_loaders_texture.py
+index fcd4d72..8e13037 100644
+--- a/tests/test_loaders_texture.py
++++ b/tests/test_loaders_texture.py
+@@ -55,39 +55,3 @@ class TextureLoadersTestCase(HeadlessTestCase):
+             kind='cube',
+         ))
+         self.assertIsInstance(texture, moderngl.TextureCube)
+-
+-    def test_texture_mimpamps(self):
+-        """Load texture with mipmapping and anisotropy"""
+-        desc = TextureDescription(
+-            path='textures/crate.png',
+-            mipmap_levels=(0, 2),
+-            anisotropy=4.0,
+-        )
+-        texture = resources.textures.load(desc)
+-        self.assertEqual(texture.anisotropy, 4.0)
+-        self.assertEqual(desc.mipmap, True)
+-
+-        # Texture Array
+-        desc = TextureDescription(
+-            path='textures/array.png',
+-            kind="array",
+-            layers=10,
+-            mipmap_levels=(0, 5),
+-            anisotropy=8.0,
+-        )
+-        texture = resources.textures.load(desc)
+-        self.assertEqual(texture.anisotropy, 8.0)
+-        self.assertEqual(desc.mipmap, True)
+-
+-    def test_texture_abspath(self):
+-        """Strip search directories and use absolute path"""
+-        path = (Path(__file__).parent / "fixtures/resources/textures/crate.png").resolve()
+-        with resources.temporary_dirs([]):
+-            desc = TextureDescription(
+-                path=path,
+-                mipmap_levels=(0, 2),
+-                anisotropy=4.0,
+-            )
+-            texture = resources.textures.load(desc)
+-            self.assertEqual(texture.anisotropy, 4.0)
+-            self.assertEqual(desc.mipmap, True)
+diff --git a/tests/test_windowconfig.py b/tests/test_windowconfig.py
+index 185c36e..2eb6f39 100644
+--- a/tests/test_windowconfig.py
++++ b/tests/test_windowconfig.py
+@@ -94,31 +94,6 @@ class WindowConfigTestCase(WindowConfigTestCase):
+         with self.assertRaises(ValueError):
+             self.window.resize_func = "Hello"
+ 
+-    def test_load_texture_2d(self):
+-        """Load texture with shortcut method"""
+-        texture = self.config.load_texture_2d(
+-            "textures/crate.png",
+-            flip=True,
+-            mipmap_levels=(0, 2),
+-            anisotropy=4.0,
+-        )
+-        self.assertIsInstance(texture, moderngl.Texture)
+-        self.assertEqual(texture.anisotropy, 4.0)
+-
+-    def test_load_texture_array(self):
+-        """Load texture array with shortcut method"""
+-        texture = self.config.load_texture_array(
+-            'textures/array.png',
+-            layers=10,
+-            flip=True,
+-            mipmap=False,
+-            mipmap_levels=(0, 2),
+-            anisotropy=4.0,
+-        )
+-        self.assertIsInstance(texture, moderngl.TextureArray)
+-        self.assertEqual(texture.anisotropy, 4.0)
+-        self.assertEqual(texture.layers, 10)
+-
+     def test_load_program_single(self):
+         """Load a single glsl program"""
+         prog = self.config.load_program(path='programs/white.glsl')
+-- 
+2.33.0
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0dbc9db830..eee2fc0077 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19710,6 +19710,50 @@ (define-public python-pyglet
 music.  All of this with a friendly Pythonic API that's simple to learn.")
     (license license:bsd-3)))
 
+(define-public python-moderngl-window
+  (package
+   (name "python-moderngl-window")
+   (version "2.4.0")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://github.com/moderngl/moderngl-window")
+                  (commit version)))
+            (file-name (git-file-name name version))
+            (patches
+             (search-patches "python-moderngl-window-skip-tests.patch"))
+            (sha256
+             (base32
+              "1fvhm6ln3q5kl5m5q3gzfmx1kpyn054fhpcrgpqz8809dxi7pzcv"))))
+   (build-system python-build-system)
+   (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'fix-test
+           (lambda _
+             (substitute* '("tests/test_windowconfig.py")
+               (("terrain_Vs.glsl") "terrain_vs.glsl"))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (system "Xvfb :1 &")
+               (setenv "DISPLAY" ":1")
+               (add-installed-pythonpath inputs outputs)
+               (invoke "pytest" "tests" )))))))
+   (propagated-inputs
+    (list python-pillow python-pyrr python-numpy python-moderngl
+          python-pyglet))
+   (native-inputs
+    (list python-pytest xorg-server-for-tests))
+   (home-page "https://github.com/moderngl/moderngl-window")
+   (synopsis "Cross-platform utility library for ModernGL")
+   (description "This ModernGL utility library simplifies window creation and
+resource loading.  You can create a window for ModernGL using pyglet, pygame,
+PySide2, GLFW, SDL2, PyQt5 or tkinter.  Events are unified into a single event
+system.  Resource loading includes loading of 2D textures/texture arrays,
+shaders and objects/scenes.")
+   (license license:expat)))
+
 (define-public python-screeninfo
   (package
    (name "python-screeninfo")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 11/12] gnu: Add python-screeninfo-0.6.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-12-daniel.meissner-i4k@ruhr-uni-bochum.de
* (python-screeninfo-0.6): New variable.
---
gnu/packages/python-xyz.scm | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)

Toggle diff (48 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5e43b0ca03..640edabd23 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19780,19 +19780,19 @@ (define-public python-mapbox-earcut
 bindings for this library.")
     (license license:isc)))
 
-(define-public python-screeninfo
+(define-public python-screeninfo-0.6
   (package
    (name "python-screeninfo")
-   (version "0.7")
+   (version "0.6.7")
    (source
     (origin
      (method url-fetch)
      (uri (pypi-uri "screeninfo" version))
      (sha256
       (base32
-       "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))
+       "1jv9m9xhl7zr2hzfx0w5zyw9pajn4b4zpln4rdl3zni9lcfaqjqw"))))
    (build-system python-build-system)
-   (native-inputs `(("python-pytest" ,python-pytest)))
+   (native-inputs (list python-pytest))
    (home-page "https://github.com/rr-/screeninfo")
    (synopsis
     "Obtain information about physical screens")
@@ -19802,6 +19802,17 @@ (define-public python-screeninfo
 etc.")
    (license (list license:expat license:bsd-3))))
 
+(define-public python-screeninfo
+  (package/inherit python-screeninfo-0.6
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "screeninfo" version))
+       (sha256
+        (base32
+         "007m7sqv30qak56885dxbijksrg2hd121hfpvg2llm734wspra8j"))))))
+
 (define-public python-rencode
   (package
    (name "python-rencode")
-- 
2.34.0
D
D
Daniel Meißner wrote on 2 Jan 00:51 +0100
[PATCH v3 12/12] gnu: Add python-manim 0.9.0.
(address . 50505@debbugs.gnu.org)
20220101235155.5754-13-daniel.meissner-i4k@ruhr-uni-bochum.de
* gnu/packages/python-science.scm (python-manim): New variable.
---
gnu/packages/python-science.scm | 61 +++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)

Toggle diff (85 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 61628ec956..ce451a3d28 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -37,6 +37,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gtk)
@@ -56,6 +57,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages time)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -1063,3 +1065,62 @@ (define-public python-manimpango
      "These are Python bindings for Pango to be used with the mathematical
 animation software Manim.")
     (license license:gpl3+)))
+
+(define-public python-manim
+  (package
+    (name "python-manim")
+    (version "0.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "manim" version))
+       (sha256
+        (base32
+         "0ksp57wcy45xkjips5i4wwm690mhbs2dmlcgsbmiwx78mfk4z0r3"))))
+    (build-system python-build-system)
+    (arguments '(#:phases
+                 (modify-phases %standard-phases
+                   (add-before 'build 'fix-ffmpeg-path
+                     (lambda* (#:key inputs outputs #:allow-other-keys)
+                       (substitute* '("manim/constants.py")
+                         (("FFMPEG_BIN: str = \"ffmpeg")
+                          (string-append "FFMPEG_BIN: str = \""
+                                         (search-input-file inputs "/bin/ffmpeg"))))))
+                   ;; PyPI package contains no tests for manim but the
+                   ;; setup.py test command fails, so remove it
+                   (delete 'check))))
+    (propagated-inputs
+     (list python-click
+           python-click-default-group
+           python-cloup-0.7
+           python-colour
+           python-decorator
+           python-manimpango
+           python-mapbox-earcut
+           python-moderngl
+           python-moderngl-window
+           python-networkx
+           python-numpy
+           python-pillow
+           python-pycairo
+           python-pydub
+           python-pygments
+           python-requests
+           python-rich
+           python-scipy
+           python-screeninfo-0.6
+           python-tqdm
+           python-watchdog))
+    (inputs
+     (list ffmpeg))
+    (native-inputs
+     (list python-wheel))
+    (home-page "https://www.manim.community/")
+    (synopsis
+     "Python animation engine for explanatory math videos")
+    (description
+     "Manim is a Python library for creating mathematical animations.  The
+animations are written as Python code which is based on predefined objects.
+You can make animations with maths formulas (LaTeX-based), simple shapes, 3D
+objects, function graphs and more.")
+    (license license:expat)))
-- 
2.34.0
L
L
Liliana Marie Prikler wrote on 2 Jan 01:31 +0100
Re: [PATCH v3 03/12] gnu: Add python-glcontext.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
79a030a27221f4091e006457bec898ea98106c10.camel@gmail.com
Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:
Toggle quote (49 lines)
> * gnu/packages/python-xyz.scm (python-glcontext): New variable.
> ---
>  gnu/packages/python-xyz.scm | 53 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index deff85e797..d8e6fa070e 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -19555,6 +19555,59 @@ (define-public python-pyopengl-accelerate
>      (description
>       "This is the Cython-coded accelerator module for PyOpenGL.")))
>  
> +(define-public python-glcontext
> +  (package
> +   (name "python-glcontext")
> +   (version "2.3.4")
> +   (source
> +    (origin
> +     (method git-fetch)
> +     (uri (git-reference
> +           (url "https://github.com/moderngl/glcontext")
> +           (commit version)))
> +     (file-name (git-file-name name version))
> +     (sha256
> +      (base32
> +       "1m2zkl696vqmgrd5k1c5kl0krk6qgjgsz88qhahwva0l40bswvhp"))))
> +   (build-system python-build-system)
> +   (arguments
> +    '(#:phases
> +      (modify-phases %standard-phases
> +        (add-before 'build 'fix-lib-paths
> +          (lambda* (#:key inputs outputs #:allow-other-keys)
> +            (let ((mesa (assoc-ref inputs "mesa"))
> +                  (libx11 (assoc-ref inputs "libx11")))
> +              (substitute* '("glcontext/x11.cpp" "glcontext/egl.cpp")
> +                (("\"libGL.so\"")
> +                 (string-append "\"" mesa  "/lib/libGL.so\""))
> +                (("\"libEGL.so\"")
> +                 (string-append "\"" mesa "/lib/libEGL.so\""))
> +                (("\"libX11.so\"")
> +                 (string-append "\"" libx11 "/lib/libX11.so\"")))
> +              (substitute* '("glcontext/__init__.py")
> +                (("find_library\\('GL'\\)")
> +                 (string-append "'" mesa "/lib/libGL.so'"))
> +                (("find_library\\('EGL'\\)")
> +                 (string-append "'" mesa "/lib/libEGL.so'"))
> +                (("find_library\\(\"X11\"\\)")
> +                 (string-append "'" libx11 "/lib/libX11.so'"))))))
Use of (assoc-ref inputs input) in new code is discouraged in favour of
this-package-input or search-input-file. Leo Famulari started a thread
on which of the two to prefer over in guix-devel [1]. My personal
opinion is that search-input-file ought to be fine here.

L
L
Liliana Marie Prikler wrote on 2 Jan 01:33 +0100
Re: [PATCH v3 04/12] gnu: Add python-moderngl.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
876463ca1b7db3845d865f23736a3a8afc573473.camel@gmail.com
Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:
Toggle quote (13 lines)
> +    (description "ModernGL is a python wrapper over OpenGL 3.3+ core
> that
> +simplifies the creation of simple graphics applications like
> scientific
> +simulations, games or user interfaces.  Usually, acquiring in-depth
> knowledge
> +of OpenGL requires a steep learning curve.  In contrast, ModernGL is
> easy to
> +learn and use, moreover it is capable of rendering with high
> performance and
> +quality, with less code written.  The majority of the moderngl code
> base is
> +also written in C++ for high performance.")
The first sentence is enough, we don't need ads :)
L
L
Liliana Marie Prikler wrote on 2 Jan 01:36 +0100
Re: [PATCH v3 05/12] gnu: Add python-pyglet.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
d76362fcf723f36d3136ee4b0b1f622f557b2c63.camel@gmail.com
Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:
Toggle quote (17 lines)
> +         (add-before 'build 'fix-lib-paths
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (substitute* '("pyglet/gl/lib_glx.py")
> +               (("'GL'")
> +                (string-append "\"" (assoc-ref inputs "mesa")
> +                               "/lib/libGL.so\""))
> +               (("'GLU'")
> +                (string-append "\"" (assoc-ref inputs "glu")
> +                               "/lib/libGLU.so\"")))
> +             (substitute* '("pyglet/font/freetype_lib.py")
> +               (("'freetype'")
> +                (string-append "\"" (assoc-ref inputs "freetype")
> +                               "/lib/libfreetype.so\"")))
> +             (substitute* '("pyglet/font/fontconfig.py")
> +               (("'fontconfig'")
> +                (string-append "\"" (assoc-ref inputs "fontconfig")
> +                               "/lib/libfontconfig.so\"")))))
Here as well, friendship ended with assoc-ref ;)

Toggle quote (7 lines)
> +         (replace 'check
> +           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
> +             (when tests?
> +               (system "Xvfb :1 &")
> +               (setenv "DISPLAY" ":1")
> +               (add-installed-pythonpath inputs outputs)
> +               (invoke "pytest" "tests/unit")))))))
We typically use a pre-check phase to set things up. Does python
support #:test-target?

Toggle quote (8 lines)
> +    (description
> +     "Pyglet is a Python library for developing games and other
> visually-rich
> +applications.  It supports windowing, user interface event handling,
> +Joysticks, OpenGL graphics, loading images and videos, and playing
> sounds and
> +music.  All of this with a friendly Pythonic API that's simple to
> learn.")
Last sentence sounds like an ad statement, the others can stay.
L
L
Liliana Marie Prikler wrote on 2 Jan 01:47 +0100
Re: [PATCH v3 08/12] gnu: Add python-moderngl-window.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
1bd1592f71c17d017b573445388223313e667388.camel@gmail.com
Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:
Toggle quote (21 lines)
> * gnu/packages/python-xyz.scm (python-moderngl-window): New variable.
> ---
>  gnu/local.mk                                  |   1 +
>  .../python-moderngl-window-skip-tests.patch   | 146
> ++++++++++++++++++
>  gnu/packages/python-xyz.scm                   |  44 ++++++
>  3 files changed, 191 insertions(+)
>  create mode 100644 gnu/packages/patches/python-moderngl-window-skip-
> tests.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 852f9f3246..ff3e80ea68 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1685,6 +1685,7 @@ dist_patch_DATA
> =                                         \
>    %D%/packages/patches/python-magic-python-bytecode.patch      \
>    %D%/packages/patches/python-matplotlib-run-under-wayland-
> gtk3.patch  \
>    %D%/packages/patches/python-memcached-syntax-warnings.patch  \
> +  %D%/packages/patches/python-moderngl-window-skip-tests.patch  \
Document this addition as well as the file itself (New file.) in the
commit log.
Toggle quote (19 lines)
>    %D%/packages/patches/python-mox3-python3.6-compat.patch      \
>    %D%/packages/patches/python-typing-inspect-fix.patch         \
>    %D%/packages/patches/python-packaging-test-
> arch.patch                \
> diff --git a/gnu/packages/patches/python-moderngl-window-skip-
> tests.patch b/gnu/packages/patches/python-moderngl-window-skip-
> tests.patch
> new file mode 100644
> index 0000000000..aee4b71e2a
> --- /dev/null
> +++ b/gnu/packages/patches/python-moderngl-window-skip-tests.patch
> @@ -0,0 +1,146 @@
> +Skip failing tests and tests for optional dependencies
> +
> +The Python packages pywavefront and trimesh are optional
> dependencies and not
> +yet packaged in Guix but the tests try to load the modules anyway. 
> Therefore
> +skip them.
Okay.

Toggle quote (6 lines)
> +The tests test_texture_mimpamps, test_texture_abspath,
> test_load_texture_2d
> +and test_load_texture_array fail when Guix builds the package.  This
> is not
> +the case when running the tests directly from a source tree.
> +
You might be missing an X extension here. Try adjusting the Xvfb call.

Btw. I checked python-build-system and it relies on setup.py to do
tests, so the check phase can stay, both here and where I previously
criticised it. Sorry for the noise.
L
L
Liliana Marie Prikler wrote on 2 Jan 01:52 +0100
Re: [PATCH v3 12/12] gnu: Add python-manim 0.9.0.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
bc7e467146300b9b57139ba08abee51c21697a21.camel@gmail.com
Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:

Toggle quote (4 lines)
> +                   ;; PyPI package contains no tests for manim but
> the
> +                   ;; setup.py test command fails, so remove it
> +                   (delete 'check))))
Use #:tests? #f then, either with the same comment or a shortened one.
D
D
Daniel Meißner wrote on 10 Jan 09:40 +0100
Re: [PATCH v3 08/12] gnu: Add python-moderngl-window.
(name . Xinglu Chen)(address . public@yoctocell.xyz)
87czl0asre.fsf@ruhr-uni-bochum.de
Hi Liliana,

Liliana Marie Prikler writes:
Toggle quote (9 lines)
> Am Sonntag, dem 02.01.2022 um 00:51 +0100 schrieb Daniel Meißner:
>> +The tests test_texture_mimpamps, test_texture_abspath,
>> test_load_texture_2d
>> +and test_load_texture_array fail when Guix builds the package.  This
>> is not
>> +the case when running the tests directly from a source tree.
>> +
> You might be missing an X extension here. Try adjusting the Xvfb call.

After some research on the internet and grepping Guix sources I adjusted
the invocation of Xvfb to the following:

Xvfb :1 +extension GLX &

as used for example in the package definition of gtk. However, the same
four tests still fail. Do you have an idea what other X extensions
might be missing?

Thanks,
Daniel
?