2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
|
|
|
, cairo
|
|
|
|
, ffmpeg
|
2023-11-16 04:20:00 +00:00
|
|
|
, texliveInfraOnly
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
# According to ManimCommunity documentation manim uses tex-packages packaged
|
|
|
|
# in a custom distribution called "manim-latex",
|
|
|
|
#
|
|
|
|
# https://community.chocolatey.org/packages/manim-latex#files
|
|
|
|
#
|
|
|
|
# which includes another cutom distribution called tinytex, for which the
|
|
|
|
# package list can be found at
|
|
|
|
#
|
|
|
|
# https://github.com/yihui/tinytex/blob/master/tools/pkgs-custom.txt
|
|
|
|
#
|
|
|
|
# these two combined add up to:
|
2023-11-16 04:20:00 +00:00
|
|
|
manim-tinytex = texliveInfraOnly.withPackages (ps: with ps; [
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
# tinytex
|
2023-11-16 04:20:00 +00:00
|
|
|
amsfonts amsmath atbegshi atveryend auxhook babel bibtex
|
2022-06-16 17:23:12 +00:00
|
|
|
bigintcalc bitset booktabs cm dehyph dvipdfmx dvips ec epstopdf-pkg etex
|
|
|
|
etexcmds etoolbox euenc everyshi fancyvrb filehook firstaid float fontspec
|
|
|
|
framed geometry gettitlestring glyphlist graphics graphics-cfg graphics-def
|
|
|
|
grffile helvetic hycolor hyperref hyph-utf8 iftex inconsolata infwarerr
|
|
|
|
intcalc knuth-lib kvdefinekeys kvoptions kvsetkeys l3backend l3kernel
|
|
|
|
l3packages latex latex-amsmath-dev latex-bin latex-fonts latex-tools-dev
|
|
|
|
latexconfig latexmk letltxmacro lm lm-math ltxcmds lua-alt-getopt luahbtex
|
|
|
|
lualatex-math lualibs luaotfload luatex mdwtools metafont mfware natbib
|
|
|
|
pdfescape pdftex pdftexcmds plain psnfss refcount rerunfilecheck stringenc
|
|
|
|
tex tex-ini-files times tipa tools unicode-data unicode-math uniquecounter
|
|
|
|
url xcolor xetex xetexconfig xkeyval xunicode zapfding
|
|
|
|
|
|
|
|
# manim-latex
|
|
|
|
standalone everysel preview doublestroke ms setspace rsfs relsize ragged2e
|
|
|
|
fundus-calligra microtype wasysym physics dvisvgm jknapltx wasy cm-super
|
2023-11-16 04:20:00 +00:00
|
|
|
babel-english gnu-freefont mathastext cbfonts-fd
|
|
|
|
]);
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
python = python3;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
in python.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "manim";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.18.0.post0";
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = python3.pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ManimCommunity";
|
2023-11-16 04:20:00 +00:00
|
|
|
repo = "manim";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-4HwQ74oHloK+1KOD6SzXCzGIDD+Dc0jDabw6/+cqmos=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
|
|
|
poetry-core
|
2024-01-25 14:12:00 +00:00
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"cloup"
|
2024-04-21 15:54:59 +00:00
|
|
|
"isosurfaces"
|
2024-01-25 14:12:00 +00:00
|
|
|
"pillow"
|
|
|
|
"skia-pathops"
|
2024-04-21 15:54:59 +00:00
|
|
|
"watchdog"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
./pytest-report-header.patch
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-01-25 14:12:00 +00:00
|
|
|
--replace "--no-cov-on-fail --cov=manim --cov-report xml --cov-report term" ""
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildInputs = [ cairo ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
click
|
|
|
|
click-default-group
|
|
|
|
cloup
|
2020-04-24 23:36:52 +00:00
|
|
|
colour
|
2022-06-16 17:23:12 +00:00
|
|
|
grpcio
|
|
|
|
grpcio-tools
|
|
|
|
importlib-metadata
|
|
|
|
isosurfaces
|
|
|
|
jupyterlab
|
|
|
|
manimpango
|
|
|
|
mapbox-earcut
|
|
|
|
moderngl
|
|
|
|
moderngl-window
|
|
|
|
networkx
|
2020-04-24 23:36:52 +00:00
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
pycairo
|
|
|
|
pydub
|
2022-06-16 17:23:12 +00:00
|
|
|
pygments
|
|
|
|
pysrt
|
|
|
|
rich
|
|
|
|
scipy
|
|
|
|
screeninfo
|
|
|
|
skia-pathops
|
|
|
|
srt
|
2023-11-16 04:20:00 +00:00
|
|
|
svgelements
|
2022-06-16 17:23:12 +00:00
|
|
|
tqdm
|
|
|
|
watchdog
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
"--prefix" "PATH" ":" (lib.makeBinPath [
|
|
|
|
ffmpeg
|
2023-11-16 04:20:00 +00:00
|
|
|
manim-tinytex
|
2022-06-16 17:23:12 +00:00
|
|
|
])
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
ffmpeg
|
2023-11-16 04:20:00 +00:00
|
|
|
manim-tinytex
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ (with python.pkgs; [
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
]);
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
# about 55 of ~600 tests failing mostly due to demand for display
|
|
|
|
disabledTests = import ./failing_tests.nix;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "manim" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Animation engine for explanatory math videos - Community version";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Manim is an animation engine for explanatory math videos. It's used to
|
|
|
|
create precise animations programmatically, as seen in the videos of
|
2022-06-16 17:23:12 +00:00
|
|
|
3Blue1Brown on YouTube. This is the community maintained version of
|
|
|
|
manim.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/ManimCommunity/manim";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ friedelino ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|