From a6939762f1829c238ff659fe817b80a977b62e70 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 23 Jan 2021 19:55:21 +0100 Subject: [PATCH] vapoursynthPlugins.kagefunc: init at unstable-2021-01-21 --- default.nix | 1 + plugins/kagefunc/default.nix | 56 ++++++++++++++++++++++++++ plugins/kagefunc/skip-opencl-test.diff | 12 ++++++ 3 files changed, 69 insertions(+) create mode 100644 plugins/kagefunc/default.nix create mode 100644 plugins/kagefunc/skip-opencl-test.diff diff --git a/default.nix b/default.nix index 7b371d9..687b053 100644 --- a/default.nix +++ b/default.nix @@ -55,6 +55,7 @@ in fvsfunc = callPythonPackage ./plugins/fvsfunc { }; havsfunc = callPythonPackage ./plugins/havsfunc { }; + kagefunc = callPythonPackage ./plugins/kagefunc { }; muvsfunc = callPythonPackage ./plugins/muvsfunc { }; mvsfunc = callPythonPackage ./plugins/mvsfunc { }; }; diff --git a/plugins/kagefunc/default.nix b/plugins/kagefunc/default.nix new file mode 100644 index 0000000..e58cf08 --- /dev/null +++ b/plugins/kagefunc/default.nix @@ -0,0 +1,56 @@ +{ lib, vapoursynthPlugins, buildPythonPackage, fetchFromGitHub, python3, vapoursynth }: +let + propagatedBinaryPlugins = with vapoursynthPlugins; [ + adaptivegrain + addgrain + bm3d + descale + fmtconv + knlmeanscl + retinex + tcanny + wwxd + ]; +in +buildPythonPackage rec { + pname = "kagefunc"; + version = "unstable-2021-01-21"; + + src = fetchFromGitHub { + owner = "Irrational-Encoding-Wizardry"; + repo = pname; + rev = "a1e89b1dd591bafec3b9f95e0087b096b9b6f9b1"; + sha256 = "0j7n7iz0ksqydjm3jzk2l71a77l9ljm71wg414amdqjcbm5dmsw5"; + }; + + patches = [ + ./skip-opencl-test.diff + ]; + + propagatedBuildInputs = (with vapoursynthPlugins; [ + fvsfunc + mvsfunc + vsutil + ]) ++ propagatedBinaryPlugins; + + format = "other"; + + installPhase = '' + install -D kagefunc.py $out/${python3.sitePackages}/kagefunc.py + ''; + + checkInputs = [ (vapoursynth.withPlugins propagatedBinaryPlugins) ]; + checkPhase = '' + PYTHONPATH=$out/${python3.sitePackages}:$PYTHONPATH + python3 tests.py + ''; + pythonImportsCheck = [ "kagefunc" ]; + + meta = with lib; { + description = "A collection of Vapoursynth functions."; + homepage = "https://github.com/Irrational-Encoding-Wizardry/kagefunc"; + license = licenses.mit; + maintainers = with maintainers; [ sbruder ]; + platforms = platforms.all; + }; +} diff --git a/plugins/kagefunc/skip-opencl-test.diff b/plugins/kagefunc/skip-opencl-test.diff new file mode 100644 index 0000000..ba40f14 --- /dev/null +++ b/plugins/kagefunc/skip-opencl-test.diff @@ -0,0 +1,12 @@ +diff --git a/tests.py b/tests.py +index 2a64cb9..ab2d2af 100644 +--- a/tests.py ++++ b/tests.py +@@ -22,6 +22,7 @@ class KagefuncTests(unittest.TestCase): + # request a frame to see if that errors + mask.get_frame(0) + ++ @unittest.skip("no OpenCL support in nix build sandbox") + def test_inverse_scale(self): + src = self.BLACK_SAMPLE_CLIP + resized = kgf.inverse_scale(self.GREYSCALE_SAMPLE_CLIP, height=90)