Commit cd4081b4 authored by utopiatopia's avatar utopiatopia
Browse files

auto-editor: 28.0.2 -> 29.2.0

parent 8a93389f
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
{
  "depends": [
    {
      "method": "fetchzip",
      "path": "/nix/store/w556rbsnv2fxb229av2iq180ri9x0d9j-source",
      "rev": "77469f58916369bc3863194cabb05238577fb257",
      "sha256": "18wjz5yqzr1dz6286p2w02fk2xjr54l477g90bz4pskjcqrqnjbv",
      "url": "https://github.com/khchen/tinyre/archive/77469f58916369bc3863194cabb05238577fb257.tar.gz",
      "ref": "1.6.0",
      "packages": [
        "tinyre"
      ],
      "srcDir": ""
    },
    {
      "method": "fetchzip",
      "path": "/nix/store/6aph9sfwcws7pd2725fwjnibdfrv7qmw-source",
      "rev": "f8f6bd34bfa3fe12c64b919059ad856a96efcba0",
      "sha256": "11m1rb6rzk70kvskppf97ddzgf5fnh9crjziqc6hib0jgsm5d615",
      "url": "https://github.com/nim-lang/checksums/archive/f8f6bd34bfa3fe12c64b919059ad856a96efcba0.tar.gz",
      "ref": "v0.2.1",
      "packages": [
        "checksums"
      ],
      "srcDir": "src"
    }
  ]
}
+79 −18
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  buildNimPackage,
  fetchFromGitHub,

  withHEVC ? true,
  withWhisper ? false,

  ffmpeg,
  yt-dlp,
  lame,
  libopus,
  libvpx,
  x264,
  x265,
  dav1d,
  svt-av1,
  whisper-cpp,

  python3,
  python3Packages,
  nimble,
  nim,
}:

python3Packages.buildPythonApplication rec {
buildNimPackage rec {
  pname = "auto-editor";
  version = "28.0.2";
  pyproject = true;
  version = "29.2.0";

  src = fetchFromGitHub {
    owner = "WyattBlue";
    repo = "auto-editor";
    tag = version;
    hash = "sha256-ozw5ZPvKP7aTBBItQKNx85hZ1T4IxX9NYCcNHC5UuuM=";
    hash = "sha256-2EpdrFGkeISiCnwtBMFikfWOzEdHO/ut2NbVbIAutdk=";
  };

  lockFile = ./lock.json;

  buildInputs = [
    ffmpeg
    lame
    libopus
    libvpx
    x264
    dav1d
    svt-av1
  ]
  ++ lib.optionals withHEVC [
    x265
  ]
  ++ lib.optionals withWhisper [
    whisper-cpp
  ];

  nimFlags = [
    "--passc:-Wno-incompatible-pointer-types"
  ]
  ++ lib.optionals withHEVC [
    "-d:enable_hevc"
  ]
  ++ lib.optionals withWhisper [
    "-d:enable_whisper"
  ];

  postPatch = ''
    substituteInPlace auto_editor/__main__.py \
    substituteInPlace src/log.nim \
      --replace-fail '"yt-dlp"' '"${lib.getExe yt-dlp}"'
  '';

  build-system = with python3Packages; [ setuptools ];
    # buildNimPackage hack
    substituteInPlace ae.nimble \
      --replace-fail '"main=auto-editor"' '"main"'
  '';

  dependencies = with python3Packages; [
    basswood-av
    numpy
  # TODO: Fix checks
  /*
    nativeCheckInputs = [
      python3Packages.av
      python3
    ];

    checkPhase = ''
      runHook preCheck

    $out/bin/auto-editor test all
      nim c \
      ${if withHEVC then "-d:enable_hevc" else ""} \
      ${if withWhisper then "-d:enable_whisper" else ""} \
      -r $src/src/rationals

      python3 $src/tests/test.py

      runHook postCheck
    '';
  */

  pythonImportsCheck = [ "auto_editor" ];
  postInstall = ''
    mv $out/bin/main $out/bin/auto-editor
  '';

  meta = {
    changelog = "https://github.com/WyattBlue/auto-editor/releases/tag/${src.tag}";
@@ -45,6 +102,10 @@ python3Packages.buildPythonApplication rec {
    homepage = "https://auto-editor.com/";
    license = lib.licenses.unlicense;
    mainProgram = "auto-editor";
    maintainers = with lib.maintainers; [ tomasajt ];
    maintainers = with lib.maintainers; [
      tomasajt
      utopiatopia
    ];
    platforms = lib.platforms.unix;
  };
}