1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 texliveInfraOnly,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 addict,
12 appdirs,
13 colour,
14 diskcache,
15 fonttools,
16 ipython,
17 isosurfaces,
18 manimpango,
19 mapbox-earcut,
20 matplotlib,
21 moderngl,
22 moderngl-window,
23 numpy,
24 pillow,
25 pydub,
26 pygments,
27 pyopengl,
28 pyperclip,
29 pyyaml,
30 rich,
31 scipy,
32 screeninfo,
33 skia-pathops,
34 svgelements,
35 sympy,
36 tqdm,
37 typing-extensions,
38 validators,
39
40 # tests
41 ffmpeg,
42}:
43
44let
45 # This is a list of all LaTeX packages used by manimgl according to manimlib/tex_templates.yml
46 manim-tinytex = texliveInfraOnly.withPackages (
47 ps: with ps; [
48
49 # tinytex
50 amsfonts
51 amsmath
52 atbegshi
53 atveryend
54 auxhook
55 babel
56 bibtex
57 bigintcalc
58 bitset
59 booktabs
60 cm
61 dehyph
62 dvipdfmx
63 dvips
64 ec
65 epstopdf-pkg
66 etex
67 etexcmds
68 etoolbox
69 euenc
70 everyshi
71 fancyvrb
72 filehook
73 firstaid
74 float
75 fontspec
76 framed
77 geometry
78 gettitlestring
79 glyphlist
80 graphics
81 graphics-cfg
82 graphics-def
83 grffile
84 helvetic
85 hycolor
86 hyperref
87 hyph-utf8
88 iftex
89 inconsolata
90 infwarerr
91 intcalc
92 knuth-lib
93 kvdefinekeys
94 kvoptions
95 kvsetkeys
96 l3backend
97 l3kernel
98 l3packages
99 latex
100 latex-amsmath-dev
101 latex-bin
102 latex-fonts
103 latex-tools-dev
104 latexconfig
105 latexmk
106 letltxmacro
107 lm
108 lm-math
109 ltxcmds
110 lua-alt-getopt
111 luahbtex
112 lualatex-math
113 lualibs
114 luaotfload
115 luatex
116 mdwtools
117 metafont
118 mfware
119 natbib
120 pdfescape
121 pdftex
122 pdftexcmds
123 plain
124 psnfss
125 refcount
126 rerunfilecheck
127 stringenc
128 tex
129 tex-ini-files
130 times
131 tipa
132 tools
133 unicode-data
134 unicode-math
135 uniquecounter
136 url
137 xcolor
138 xetex
139 xetexconfig
140 xkeyval
141 xunicode
142 zapfding
143
144 # manim-latex
145 standalone
146 everysel
147 preview
148 doublestroke
149 setspace
150 rsfs
151 relsize
152 ragged2e
153 fundus-calligra
154 microtype
155 wasysym
156 physics
157 dvisvgm
158 jknapltx
159 wasy
160 cm-super
161 babel-english
162 gnu-freefont
163 mathastext
164 cbfonts-fd
165 ]
166 );
167in
168buildPythonPackage {
169 pname = "manimgl";
170 pyproject = true;
171 version = "1.7.2";
172
173 # Using hash rev because the tarball for the tag v1.7.2 gives the source to 1.7.1
174 src = fetchFromGitHub {
175 owner = "3b1b";
176 repo = "manim";
177 rev = "0c69ab6a32d4193f03ba9a604278eb3ce9699518";
178 hash = "sha256-mh55R0uTuPz86+dJNlHcgJP1KWXoBYi2p8NUCnu4gEo=";
179 };
180
181 build-system = [
182 setuptools
183 ];
184
185 dependencies = [
186 addict
187 appdirs
188 colour
189 diskcache
190 fonttools
191 ipython
192 isosurfaces
193 manimpango
194 mapbox-earcut
195 matplotlib
196 moderngl
197 moderngl-window
198 numpy
199 pillow
200 pydub
201 pygments
202 pyopengl
203 pyperclip
204 pyyaml
205 rich
206 setuptools
207 scipy
208 screeninfo
209 skia-pathops
210 svgelements
211 sympy
212 tqdm
213 typing-extensions
214 validators
215 ];
216
217 makeWrapperArgs = [
218 "--prefix"
219 "PATH"
220 ":"
221 (lib.makeBinPath [
222 ffmpeg
223 manim-tinytex
224 ])
225 ];
226
227 doCheck = false;
228
229 meta = {
230 description = "Animation engine for explanatory math videos";
231 longDescription = ''
232 Manim is an engine for precise programmatic animations, designed for creating
233 explanatory math videos, as seen in the videos of 3Blue1Brown on Youtube.
234 This is the original version that is maintained by Grant Sanderson which is
235 based on OpenGL.
236 '';
237 changelog = "https://3b1b.github.io/manim/development/changelog.html";
238 homepage = "https://github.com/3b1b/manim";
239 license = lib.licenses.mit;
240 maintainers = with lib.maintainers; [
241 L0L1P0P
242 osbm
243 ];
244 mainProgram = "manimgl";
245 };
246}