vapoursynthPlugins.znedi3: init at r2

This commit is contained in:
Simon Bruder 2021-01-23 10:28:57 +01:00 committed by Tadeo Kondrak
parent 1031932821
commit 3c6a1242a6
2 changed files with 51 additions and 0 deletions

View file

@ -28,5 +28,6 @@ self: super: {
tcanny = super.callPackage ./plugins/tcanny { };
tnlmeans = super.callPackage ./plugins/tnlmeans { };
wwxd = super.callPackage ./plugins/wwxd { };
znedi3 = super.callPackage ./plugins/znedi3 { };
};
}

View file

@ -0,0 +1,50 @@
{ lib, stdenv, fetchFromGitHub, vapoursynth }:
stdenv.mkDerivation rec {
pname = "znedi3";
version = "r2";
src = fetchFromGitHub {
owner = "sekrit-twc";
repo = pname;
rev = version;
sha256 = "1p6563s1b52qisvvwid047jd376sz737lggwfhanci0sqxxphhrb";
fetchSubmodules = true;
};
postPatch = ''
# use system vapoursynth headers (adapted from AUR PKGBUILD)
rm -rf vsxx/{VapourSynth,VSScript,VSHelper}.h
substituteInPlace vsxx/VapourSynth++.hpp \
--replace '"VapourSynth.h"' '<VapourSynth.h>' \
--replace '"VSHelper.h"' '<VSHelper.h>'
substituteInPlace Makefile \
--replace "VSScript.h" "" \
--replace "VapourSynth.h" "" \
--replace "VSHelper.h" ""
'';
buildInputs = [ vapoursynth ];
makeFlags = (lib.optional stdenv.isx86_64 "X86=1");
CPPFLAGS = lib.concatStringsSep " " [
"-I${vapoursynth}/include/vapoursynth"
"-DNNEDI3_WEIGHTS_PATH=\\\"\"${placeholder "out"}/share/znedi3/nnedi3_weights.bin\"\\\""
];
installPhase = ''
install -D vsznedi3.so $out/lib/vapoursynth/libvsznedi3.so
install -D nnedi3_weights.bin $out/share/znedi3/nnedi3_weights.bin
'';
meta = with lib; {
description = "A CPU optimised nnedi3 filter for VapourSynth";
homepage = "https://github.com/sekrit-twc/znedi3";
license = licenses.gpl2Only;
maintainers = with maintainers; [ sbruder ];
platforms = platforms.all;
};
}