-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
vapoursynth: split python module out #58859
Conversation
cc @rnhmjoj (maintainer) |
c7f6f37
to
c331d9f
Compare
I can't seem to get Edit: Thinking about it more, it makes sense that it's in the python output (it evaluates python scripts). Might be a bit unintuitive, but still better than the previous behaviour of it not working |
The only way I've found to load plugins is to create an environment with
I tested my setup for frame interpolation in mpv and looks good. I've never used vspipe directly, so you probably know better than me. |
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec { | |||
sha256 = "09fj4k75cksx1imivqfyr945swlr8k392kkdgzldwc4404qv82s6"; | |||
}; | |||
|
|||
nativeBuildInputs = [ pkgconfig autoreconfHook nasm ]; | |||
nativeBuildInputs = [ pkgconfig autoreconfHook nasm python3 makeWrapper ]; |
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.
You now have two separate python3
executables in $PATH
in the builder. Given the libraries included in the one a couple lines down, I'm assuming that one is actually used during the build process, not this one?
Does vapoursynth's Python module have dependencies on any non-standard modules?
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.
This python3 seems to be needed to get the toPythonPath in the wrapProgram call below to work.
Does vapoursynth's Python module have dependencies on any non-standard modules?
No, the current ones are only used during the build.
moveToOutput lib/${python3.libPrefix} $python | ||
moveToOutput bin/vspipe $python | ||
wrapProgram $python/bin/vspipe \ | ||
--prefix PYTHONPATH : $(toPythonPath $python) |
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.
Use wrapPythonPrograms
from python3.pkgs.wrapPython
, instead.
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.
This doesn't seem to work with binary programs.
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 does work with binary programs (it iterally calls wrapProgram
under the hood), but it relies on $pythonPath
being set in the builder. This happens automatically for buildPythonPackage
, but not for stdenv.mkDerivation
.
You could either set pythonPath
appropriately, or actually use buildPythonPackage
, which would possibly be appropriate given it provides a Python library. I suspect if you do that and specify format = "other";
, it may Just Work (tm) and you can drop the manual wrapping entirely, but I haven't tested it 🤷♂️.
c331d9f
to
d6ca994
Compare
previously, vapoursynth was not a python module in how most python libraries are in nixpkgs. it would only work as part of a library or other program, and not with its included `vspipe` program. this fixes it by adding a new output for its python module and uses toPythonModule to allow it to work standalone, and without conflicting with other python packages in a nix-shell
d6ca994
to
37b5844
Compare
Motivation for this change
Previously, vapoursynth was not a python module in how most python libraries are in nixpkgs. It would only work as part of a library or other program, and its included
vspipe
program was broken.There still isn't a convenient way to load plugins (it relies on a global search path on other distros), which I plan to address in a future PR, probably by adding a
vapoursynth.withPlugins
function.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)vspipe
mpv
with vapoursynth enablednix path-info -S
before and after)