From bb7244d361eae877687042ce1ef45005ad1887c5 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 16 May 2021 09:33:04 +0200 Subject: [PATCH] vapoursynthPlugins.acsuite: init at 6.0.0 --- default.nix | 1 + plugins/acsuite/default.nix | 48 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 plugins/acsuite/default.nix diff --git a/default.nix b/default.nix index 687b053..c4a9266 100644 --- a/default.nix +++ b/default.nix @@ -45,6 +45,7 @@ in wwxd = super.callPackage ./plugins/wwxd { }; znedi3 = super.callPackage ./plugins/znedi3 { }; + acsuite = callPythonPackage ./plugins/acsuite { }; adjust = callPythonPackage ./plugins/adjust { }; edi_rpow2 = callPythonPackage ./plugins/edi_rpow2 { }; mt_lutspa = callPythonPackage ./plugins/mt_lutspa { }; diff --git a/plugins/acsuite/default.nix b/plugins/acsuite/default.nix new file mode 100644 index 0000000..34fa654 --- /dev/null +++ b/plugins/acsuite/default.nix @@ -0,0 +1,48 @@ +{ lib, buildPythonPackage, fetchFromGitHub, ffmpeg, vapoursynth }: + +buildPythonPackage rec { + pname = "acsuite"; + version = "6.0.0"; + + src = fetchFromGitHub { + owner = "OrangeChannel"; + repo = pname; + rev = "v${version}"; + sha256 = "0m7xfg2jifq7hz7vaxvb15hgq4abna7b2zgjahjgscxjk2r4lg46"; + }; + + postPatch = '' + # Sets the default ffmpeg executable to nixpkgs’ ffmpeg. This still allows + # overriding the executable by passing ffmpeg_path. + substituteInPlace acsuite/__init__.py \ + --replace 'raise FileNotFoundError("concat: ffmpeg executable not found in PATH")' 'ffmpeg_path = "${ffmpeg}/bin/ffmpeg"' + + # This does not depend on vapoursynth (since this is used from within + # vapoursynth). + substituteInPlace requirements.txt \ + --replace "VapourSynth" "" + ''; + + checkInputs = [ + ffmpeg # the test depdends on ffmpeg from PATH + vapoursynth + ]; + checkPhase = '' + runHook preCheck + + pushd tests + python3 test_acsuite.py + popd + + runHook postCheck + ''; + pythonImportsCheck = [ "acsuite" ]; + + meta = with lib; { + description = "An audiocutter.py replacement for VapourSynth using FFmpeg"; + homepage = "https://github.com/OrangeChannel/acsuite"; + license = licenses.unlicense; + maintainers = with maintainers; [ sbruder ]; + platforms = platforms.all; + }; +}