-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
improve obs-v4l2sink #85690
improve obs-v4l2sink #85690
Conversation
Related PR: #84153 |
@ofborg eval GitHub seems to be recover(ing/ed). |
The 32-bit derivation can be tested with this: { pkgs ? import ./nixpkgs {}, is32bit ? false }:
with pkgs.lib;
let
deps = pkgs: {
inherit (pkgs)
obs-studio
obs-v4l2sink;
};
depsAttrset = if is32bit
then deps pkgs.pkgsi686Linux.pkgs
else deps pkgs;
in pkgs.stdenv.mkDerivation {
name = "env";
buildInputs = attrValues depsAttrset;
shellHook = ''
echo "obs-studio: ${depsAttrset.obs-studio.outPath}"
echo "obs-v4l2sink: ${depsAttrset.obs-v4l2sink.outPath}"
ln -sfT \
${depsAttrset.obs-v4l2sink}/share/obs/obs-plugins/v4l2sink \
~/.config/obs-studio/plugins/v4l2sink
'';
unpackPhase = ":";
installPhase = "touch $out";
}
|
868bf88
to
7e96a3c
Compare
(Mentioned in IRC, but just for continuity's sake, including here.) I applied this patch which made the directory structure back to what home-manager expects (and what other plugins tend to follow): diff --git a/pkgs/applications/video/obs-studio/v4l2sink.nix b/pkgs/applications/video/obs-studio/v4l2sink.nix
index 29479a33a1b..eddb7928d85 100644
--- a/pkgs/applications/video/obs-studio/v4l2sink.nix
+++ b/pkgs/applications/video/obs-studio/v4l2sink.nix
@@ -35,8 +35,8 @@ stdenv.mkDerivation rec {
}.${stdenv.targetPlatform.system} or (throw "Unsupported system: ${stdenv.targetPlatform.system}");
postInstall = ''
- mkdir -p $out/$pluginPath
- ln -s $out/lib/obs-plugins/v4l2sink.so $out/$pluginPath
+ mkdir -p $out/share/obs/obs-plugins/v4l2sink/$pluginPath
+ ln -s $out/lib/obs-plugins/v4l2sink.so $out/share/obs/obs-plugins/v4l2sink/$pluginPath
'';
meta = with lib; {
|
Okay, I can confirm - this doesn't crash on Stop anymore. Thanks, looks good. |
|
||
postInstall = '' | ||
mkdir -p $out/share/obs/obs-plugins/v4l2sink/$pluginPath | ||
ln -s $out/lib/obs-plugins/v4l2sink.so $out/share/obs/obs-plugins/v4l2sink/$pluginPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Could you add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obs-studio seems to expects a specific directory structure for plugins, otherwise it won't find it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that upstream thing or our packaging thing. If the former, why does the project not already do that?
Either way, the comment should be part of the expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an upstream thing. It looks for plugins in $XDG_CONFIG_HOME/obs-studio/plugins
and /usr/share/obs/obs-plugins
.
Comment added.
4b8205f
to
a33cc5c
Compare
fd669a2
to
30fd1ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path shenanigans are weird, looks good otherwise.
The rev was downgraded to the latest released version (0.1.0) because the the changes on master are mostly related to localization and README stuff. The only code-related change is insignificant.
Pulled latest commits as of right now - still works in my HM-managed setup. LGTM thanks! |
Thanks. |
coming back to this PR for instructions on how to "install" the plugin. Gosh, I would so love a |
Yeah that would be a good idea. For now I just have home-manager create a symlink to |
From my nixcfg: home-manager makes it easy:
|
@colemickens Hi, thanks for that example! It helped me a lot. Can I ask how you manage the |
@Algram good question. i got the module loaded and
together with the home-manager from #85690 (comment) it works! It would be nice to have documentation for this! |
Motivation for this change
I started working on my own derivation of obs-v42lsink and realized that it had been added to nixpkgs 4 days ago. So I compared the two derivations and noticed a couple things that were done differently.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)@grahamc @colemickens