Unverified Commit 12c397c8 authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

python3Packages.manim: don't override av (#461602)

parents a438c4b9 813140d8
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
  stdenv,
  fetchFromGitHub,
  installShellFiles,
  python312,
  python3,

  # Override Python packages using
  # self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); }
@@ -13,21 +13,11 @@
let
  defaultOverrides = [
    (self: super: {
      av = (
        super.av.overridePythonAttrs rec {
          version = "13.1.0";
          src = fetchFromGitHub {
            owner = "PyAV-Org";
            repo = "PyAV";
            tag = "v${version}";
            hash = "sha256-x2a9SC4uRplC6p0cD7fZcepFpRidbr6JJEEOaGSWl60=";
          };
        }
      );
      av = self.av_13;
    })
  ];

  python = python312.override {
  python = python3.override {
    self = python;
    packageOverrides = lib.composeManyExtensions (defaultOverrides ++ [ packageOverrides ]);
  };
+14 −0
Original line number Diff line number Diff line
{
  python3Packages,
}:

let
  pythonPackages = python3Packages.overrideScope (
    self: super: {
      av = self.av_13;
    }
  );
in
(pythonPackages.toPythonApplication pythonPackages.manim-slides).overridePythonAttrs (oldAttrs: {
  dependencies = oldAttrs.dependencies ++ oldAttrs.optional-dependencies.pyqt6-full;
})
+12 −0
Original line number Diff line number Diff line
{
  python3Packages,
}:

let
  pythonPackages = python3Packages.overrideScope (
    self: super: {
      av = self.av_13;
    }
  );
in
pythonPackages.toPythonApplication pythonPackages.manim
+90 −0
Original line number Diff line number Diff line
{
  buildPythonPackage,
  cython,
  fetchFromGitHub,
  fetchurl,
  ffmpeg_7-headless,
  lib,
  linkFarm,
  numpy,
  pillow,
  pkg-config,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "av";
  version = "13.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "PyAV-Org";
    repo = "PyAV";
    tag = "v${version}";
    hash = "sha256-x2a9SC4uRplC6p0cD7fZcepFpRidbr6JJEEOaGSWl60=";
  };

  build-system = [
    cython
    setuptools
  ];

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ ffmpeg_7-headless ];

  preCheck =
    let
      testSamples = linkFarm "pyav-test-samples" (
        lib.mapAttrs (_: fetchurl) (lib.importTOML ../av/test-samples.toml)
      );
    in
    ''
      # ensure we import the built version
      rm -r av
      ln -s ${testSamples} tests/assets
    '';

  nativeCheckInputs = [
    numpy
    pillow
    pytestCheckHook
  ];

  __darwinAllowLocalNetworking = true;

  pythonImportsCheck = [
    "av"
    "av.audio"
    "av.buffer"
    "av.bytesource"
    "av.codec"
    "av.container"
    "av._core"
    "av.datasets"
    "av.descriptor"
    "av.dictionary"
    "av.error"
    "av.filter"
    "av.format"
    "av.frame"
    "av.logging"
    "av.option"
    "av.packet"
    "av.plane"
    "av.stream"
    "av.subtitles"
    "av.utils"
    "av.video"
  ];

  meta = {
    changelog = "https://github.com/PyAV-Org/PyAV/blob/${src.tag}/CHANGELOG.rst";
    description = "Pythonic bindings for FFmpeg";
    homepage = "https://github.com/PyAV-Org/PyAV";
    license = lib.licenses.bsd2;
    mainProgram = "pyav";
    maintainers = [ lib.maintainers.dotlambda ];
  };
}
+3 −11
Original line number Diff line number Diff line
@@ -183,16 +183,6 @@ let
      cbfonts-fd
    ]
  );
  # https://github.com/ManimCommunity/manim/pull/4037
  av_13_1 = av.overridePythonAttrs rec {
    version = "13.1.0";
    src = fetchFromGitHub {
      owner = "PyAV-Org";
      repo = "PyAV";
      tag = "v${version}";
      hash = "sha256-x2a9SC4uRplC6p0cD7fZcepFpRidbr6JJEEOaGSWl60=";
    };
  };
in
buildPythonPackage rec {
  pname = "manim";
@@ -216,7 +206,7 @@ buildPythonPackage rec {
  buildInputs = [ cairo ];

  dependencies = [
    av_13_1
    av
    beautifulsoup4
    click
    cloup
@@ -278,6 +268,8 @@ buildPythonPackage rec {
  pythonImportsCheck = [ "manim" ];

  meta = {
    # https://github.com/ManimCommunity/manim/pull/4037
    broken = lib.versionAtLeast av.version "14";
    description = "Animation engine for explanatory math videos - Community version";
    longDescription = ''
      Manim is an animation engine for explanatory math videos. It's used to
Loading