about summary refs log tree commit diff
path: root/pkgs/development/python-modules/manim/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/manim/default.nix')
-rw-r--r--pkgs/development/python-modules/manim/default.nix263
1 files changed, 185 insertions, 78 deletions
diff --git a/pkgs/development/python-modules/manim/default.nix b/pkgs/development/python-modules/manim/default.nix
index 09f2953c362e..8ebb32020b1f 100644
--- a/pkgs/development/python-modules/manim/default.nix
+++ b/pkgs/development/python-modules/manim/default.nix
@@ -1,43 +1,41 @@
-{ lib
-, buildPythonPackage
-, fetchFromGitHub
-, poetry-core
-, pytest-xdist
-, pytestCheckHook
-, pythonOlder
-, pythonRelaxDepsHook
-
-, cairo
-, ffmpeg
-, texliveInfraOnly
-
-, click
-, click-default-group
-, cloup
-, colour
-, grpcio
-, grpcio-tools
-, importlib-metadata
-, isosurfaces
-, jupyterlab
-, manimpango
-, mapbox-earcut
-, moderngl
-, moderngl-window
-, networkx
-, numpy
-, pillow
-, pycairo
-, pydub
-, pygments
-, rich
-, scipy
-, screeninfo
-, skia-pathops
-, srt
-, svgelements
-, tqdm
-, watchdog
+{
+  lib,
+  buildPythonPackage,
+  fetchFromGitHub,
+  poetry-core,
+  pytest-xdist,
+  pytestCheckHook,
+  pythonOlder,
+
+  cairo,
+  ffmpeg,
+  texliveInfraOnly,
+
+  click,
+  cloup,
+  decorator,
+  isosurfaces,
+  jupyterlab,
+  manimpango,
+  mapbox-earcut,
+  moderngl,
+  moderngl-window,
+  networkx,
+  notebook,
+  numpy,
+  pillow,
+  pycairo,
+  pydub,
+  pygments,
+  rich,
+  scipy,
+  screeninfo,
+  skia-pathops,
+  srt,
+  svgelements,
+  tqdm,
+  typing-extensions,
+  watchdog,
 }:
 
 let
@@ -52,44 +50,144 @@ let
   #   https://github.com/yihui/tinytex/blob/master/tools/pkgs-custom.txt
   #
   # these two combined add up to:
-  manim-tinytex = texliveInfraOnly.withPackages (ps: with ps; [
-
-    # tinytex
-    amsfonts amsmath atbegshi atveryend auxhook babel bibtex
-    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
-    babel-english gnu-freefont mathastext cbfonts-fd
-  ]);
-
-in buildPythonPackage rec {
+  manim-tinytex = texliveInfraOnly.withPackages (
+    ps: with ps; [
+
+      # tinytex
+      amsfonts
+      amsmath
+      atbegshi
+      atveryend
+      auxhook
+      babel
+      bibtex
+      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
+      babel-english
+      gnu-freefont
+      mathastext
+      cbfonts-fd
+    ]
+  );
+in
+buildPythonPackage rec {
   pname = "manim";
   pyproject = true;
   version = "0.18.1";
   disabled = pythonOlder "3.9";
 
   src = fetchFromGitHub {
-    owner  = "ManimCommunity";
+    owner = "ManimCommunity";
     repo = "manim";
     rev = "refs/tags/v${version}";
     hash = "sha256-o+Wl3NMK6yopcsRVFtZuUE9c1GABa5d8rbQNHDJ4OiQ=";
   };
 
-  nativeBuildInputs = [
+  build-system = [
     poetry-core
-    pythonRelaxDepsHook
   ];
 
   pythonRelaxDeps = [
@@ -100,27 +198,23 @@ in buildPythonPackage rec {
     "watchdog"
   ];
 
-  patches = [
-    ./pytest-report-header.patch
-  ];
+  patches = [ ./pytest-report-header.patch ];
 
   postPatch = ''
     substituteInPlace pyproject.toml \
       --replace "--no-cov-on-fail --cov=manim --cov-report xml --cov-report term" ""
+
+    substituteInPlace manim/_config/default.cfg \
+      --replace "ffmpeg_executable = ffmpeg" "ffmpeg_executable = ${lib.getExe ffmpeg}"
   '';
 
   buildInputs = [ cairo ];
 
-  propagatedBuildInputs = [
+  dependencies = [
     click
-    click-default-group
     cloup
-    colour
-    grpcio
-    grpcio-tools
-    importlib-metadata
+    decorator
     isosurfaces
-    jupyterlab
     manimpango
     mapbox-earcut
     moderngl
@@ -138,11 +232,24 @@ in buildPythonPackage rec {
     srt
     svgelements
     tqdm
+    typing-extensions
     watchdog
   ];
 
+  optional-dependencies = {
+    jupyterlab = [
+      jupyterlab
+      notebook
+    ];
+    # TODO package dearpygui
+    # gui = [ dearpygui ];
+  };
+
   makeWrapperArgs = [
-    "--prefix" "PATH" ":" (lib.makeBinPath [
+    "--prefix"
+    "PATH"
+    ":"
+    (lib.makeBinPath [
       ffmpeg
       manim-tinytex
     ])
@@ -170,6 +277,6 @@ in buildPythonPackage rec {
     '';
     homepage = "https://github.com/ManimCommunity/manim";
     license = licenses.mit;
-    maintainers = with maintainers; [ friedelino ];
+    maintainers = [ ];
   };
 }