@@ -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)))