Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs-studio-plugins.obs-backgroundremoval: 0.5.16 -> 1.1.13 #230775

Merged
merged 3 commits into from Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,44 +2,52 @@
, stdenv
, fetchFromGitHub
, cmake
, ninja
, obs-studio
, onnxruntime
, opencv
, qt6
, curl
}:

stdenv.mkDerivation rec {
pname = "obs-backgroundremoval";
version = "0.5.16";
version = "1.1.13";

src = fetchFromGitHub {
owner = "royshil";
owner = "occ-ai";
repo = "obs-backgroundremoval";
rev = "v${version}";
hash = "sha256-E+pm/Ma6dZTYlX3DpB49ynTETsRS2TBqgHSCijl/Txc=";
rev = version;
hash = "sha256-QoC9/HkwOXMoFNvcOxQkGCLLAJmsja801LKCNT9O9T0=";
};

nativeBuildInputs = [ cmake ];
buildInputs = [ obs-studio onnxruntime opencv ];
nativeBuildInputs = [ cmake ninja ];
buildInputs = [ obs-studio onnxruntime opencv qt6.qtbase curl ];

dontWrapQtApps = true;

cmakeFlags = [
"--preset linux-x86_64"
"-DCMAKE_MODULE_PATH:PATH=${src}/cmake"
"-DUSE_SYSTEM_ONNXRUNTIME=ON"
"-DUSE_SYSTEM_OPENCV=ON"
"-DDISABLE_ONNXRUNTIME_GPU=ON"
];

postInstall = ''
mkdir $out/lib $out/share
mv $out/obs-plugins/64bit $out/lib/obs-plugins
rm -rf $out/obs-plugins
mv $out/data $out/share/obs
buildPhase = ''
cd ..
cmake --build build_x86_64 --parallel
'';

installPhase = ''
cmake --install build_x86_64 --prefix "$out"
'';
Comment on lines +37 to 44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use cmakeFlags and the normal phases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmakeFlags will apply to the normal buildPhase, right?
How to specify flags for installPhase?
Where is the documentation about this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the project is using pretty new cmake stuff we don't have explicit support for.


cmakeFlags will apply to the normal buildPhase, right?

It applies to the configure phase

if [ -z "${dontUseCmakeConfigure-}" -a -z "${configurePhase-}" ]; then
setOutputFlags=
configurePhase=cmakeConfigurePhase
fi

How to specify flags for installPhase?

Apparently there is no hook for that.

Where is the documentation about this?

https://github.com/NixOS/nixpkgs/blob/master/doc/hooks/cmake.section.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok


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; [ zahrun ];
license = licenses.mit;
platforms = [ "x86_64-linux" "i686-linux" ];
platforms = [ "x86_64-linux" ];
};
}