depot/third_party/nixpkgs/pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

45 lines
1.1 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, obs-studio
, onnxruntime
, opencv
}:
stdenv.mkDerivation rec {
pname = "obs-backgroundremoval";
version = "0.4.0";
src = fetchFromGitHub {
owner = "royshil";
repo = "obs-backgroundremoval";
rev = "v${version}";
sha256 = "sha256-TI1FlhE0+JL50gAZCSsI+g8savX8GRQkH3jYli/66hQ=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ obs-studio onnxruntime opencv ];
dontWrapQtApps = true;
cmakeFlags = [
"-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs"
"-DOnnxruntime_INCLUDE_DIRS=${onnxruntime.dev}/include/onnxruntime/core/session"
];
patches = [ ./obs-backgroundremoval-includes.patch ];
prePatch = ''
sed -i 's/version_from_git()/set(VERSION "${version}")/' CMakeLists.txt
'';
meta = with lib; {
description = "OBS plugin to replace the background in portrait images and video";
homepage = "https://github.com/royshil/obs-backgroundremoval";
maintainers = with maintainers; [ puffnfresh ];
license = licenses.mit;
platforms = [ "x86_64-linux" "i686-linux" ];
};
}