git.iko.soy/typeable/nixpkgs
on master help sign in
manim: init at 0.1.10
commitc6960f41c9f723c677eb31d46869a523038c1f11 authorDaniel Schaefer <git@danielschaefer.me> dateWed 6 Nov 2019, 13:03 (7 years ago) parent16281a9
3 files changed+94
pkgs/applications/video/manim/default.nix+64 pkgs/applications/video/manim/remove-dependency-constraints.patch+26 pkgs/top-level/all-packages.nix+4
pkgs/applications/video/manim/default.nixnew file+64
@@ -0,0 +1,64 @@
1+{ lib, buildPythonApplication, fetchFromGitHub, pythonOlder, file, fetchpatch
2+, cairo, ffmpeg, sox, xdg_utils, texlive
3+, colour, numpy, pillow, progressbar, scipy, tqdm, opencv , pycairo, pydub
4+, pbr, fetchPypi
5+}:
6+buildPythonApplication rec {
7+ pname = "manim";
8+ version = "0.1.10";
9+
10+ src = fetchPypi {
11+ pname = "manimlib";
12+ inherit version;
13+ sha256 = "0vg9b3rwypq5zir74pi0pmj47yqlcg7hrvscwrpjzjbqq2yihn49";
14+ };
15+
16+ patches = [ ./remove-dependency-constraints.patch ];
17+
18+ nativeBuildInputs = [ pbr ];
19+
20+ propagatedBuildInputs = [
21+ colour
22+ numpy
23+ pillow
24+ progressbar
25+ scipy
26+ tqdm
27+ opencv
28+ pycairo
29+ pydub
30+
31+ cairo sox ffmpeg xdg_utils
32+ ];
33+
34+ # Test with texlive to see whether it works but don't propagate
35+ # because it's huge and optional
36+ # TODO: Use smaller TexLive distribution
37+ # Doesn't need everything but it's hard to figure out what it needs
38+ checkInputs = [ cairo sox ffmpeg xdg_utils texlive.combined.scheme-full ];
39+
40+ # Simple test and complex test with LaTeX
41+ checkPhase = ''
42+ for scene in SquareToCircle OpeningManimExample
43+ do
44+ python3 manim.py example_scenes.py $scene -l
45+ tail -n 20 files/Tex/*.log # Print potential LaTeX erorrs
46+ ${file}/bin/file videos/example_scenes/480p15/$scene.mp4 \
47+ | tee | grep -F "ISO Media, MP4 Base Media v1 [IS0 14496-12:2003]"
48+ done
49+ '';
50+
51+ disabled = pythonOlder "3.7";
52+
53+ meta = {
54+ description = "Animation engine for explanatory math videos";
55+ longDescription = ''
56+ Manim is an animation engine for explanatory math videos. It's used to
57+ create precise animations programmatically, as seen in the videos of
58+ 3Blue1Brown on YouTube.
59+ '';
60+ homepage = https://github.com/3b1b/manim;
61+ license = lib.licenses.mit;
62+ maintainers = with lib.maintainers; [ johnazoidberg ];
63+ };
64+}
pkgs/applications/video/manim/remove-dependency-constraints.patchnew file+26
@@ -0,0 +1,26 @@
1+diff --git i/requirements.txt w/requirements.txt
2+index 556122ad..11fd49d5 100644
3+--- i/requirements.txt
4++++ w/requirements.txt
5+@@ -1,11 +1,10 @@
6+-argparse==1.4.0
7+-colour==0.1.5
8+-numpy==1.15.0
9+-Pillow==5.2.0
10+-progressbar==2.5
11+-scipy==1.1.0
12+-tqdm==4.24.0
13+-opencv-python==3.4.2.17
14+-pycairo==1.17.1; sys_platform == 'linux'
15+-pycairo>=1.18.0; sys_platform == 'win32'
16+-pydub==0.23.0
17++colour
18++numpy
19++Pillow
20++progressbar
21++scipy
22++tqdm
23++pycairo
24++pycairo>=1.18.1; sys_platform == 'win32'
25++pydub
26++pyreadline==2.1; sys_platform == 'win32'
pkgs/top-level/all-packages.nix+4
@@ -19002,6 +19002,10 @@ in
1900219002
1900319003 m32edit = callPackage ../applications/audio/midas/m32edit.nix {};
1900419004
19005+ manim = python37Packages.callPackage ../applications/video/manim {
19006+ opencv = python37Packages.opencv3;
19007+ };
19008+
1900519009 manuskript = libsForQt5.callPackage ../applications/editors/manuskript { };
1900619010
1900719011 manul = callPackage ../development/tools/manul { };