nixos-config/pkgs/obs-backgroundremoval/default.nix

37 lines
959 B
Nix
Raw Normal View History

{ fetchFromGitHub
, stdenv
, cmake
, obs-studio
, opencv
, onnx-runtime
2022-03-01 22:19:03 +01:00
}:
2023-04-03 09:45:35 +02:00
stdenv.mkDerivation {
2021-12-18 16:23:14 +01:00
pname = "obs-backgroundremoval";
2023-04-03 09:45:35 +02:00
version = "0.5.14";
2021-12-18 16:23:14 +01:00
src = fetchFromGitHub {
owner = "royshil";
repo = "obs-backgroundremoval";
2023-04-03 09:45:35 +02:00
rev = "a42c888ed578e026b31813fc5103ebfe48befebb";
sha256 = "wCuvWn8BCzi/OrQnfXeUO2oJbw/wH1SUz1d2E/m8u9c=";
2021-12-18 16:23:14 +01:00
};
2023-04-03 09:45:35 +02:00
# cmakeFlags = [ "-DGIT_TAG=v${version}" ];
cmakeFlags = [
"-DUSE_SYSTEM_ONNXRUNTIME=ON"
"-DUSE_SYSTEM_OPENCV=ON"
];
patches = [ ./cmake_fix_opencv_link.patch ];
2021-12-18 16:23:14 +01:00
2023-04-03 09:45:35 +02:00
installPhase = ''
mkdir -p $out/lib/obs-plugins
cp rundir/Release/obs-plugins/64bit/obs-backgroundremoval.so $out/lib/obs-plugins/
mkdir -p $out/share/obs/obs-plugins/obs-backgroundremoval
cp -r rundir/Release/data/obs-plugins/obs-backgroundremoval/data/* $out/share/obs/obs-plugins/obs-backgroundremoval/
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ opencv onnx-runtime obs-studio ];
2021-12-18 16:23:14 +01:00
}