mpv: Move all wrappings to a single wrapper Nix function#88620
mpv: Move all wrappings to a single wrapper Nix function#88620AndersonTorres merged 1 commit intoNixOS:masterfrom
Conversation
|
@GrahamcOfBorg build mpv-unwrapped @GrahamcOfBorg build mpv |
|
Is it me or do these build commands don't work? :/ |
|
They only work if you're a whitelisted user. |
Inspired by `wrapNeovim`, write a wrapMpv Nix function that creates a derivation that has all of the environment that was added if needed at the unwrapped version. Add derivations to all-packages.nix in an almost compatible way and make `mpv-with-scripts` throw a message implying to switch to `wrapMpv` which has an incompatible signature. Add to vapoursynth a new passthru attribute `python3` that is used in passed down to the wrapper to ensure ABI compatibility with `PYTHONPATH`.
AndersonTorres
left a comment
There was a problem hiding this comment.
Just looking from above, feels good to me, and way more organized.
Pushing out the wrap logic is a great improvement.
teto
left a comment
There was a problem hiding this comment.
It's more inline with current nixpkgs' approach.
|
It would be great if symbols like Since this is a breaking change, this requires an entry in the release notes cc @doronbehar @AndersonTorres |
|
You are correct. It was on my mind, I wanted to get some feedback before adding to the PR the changes to rl-2009 but I forgot about it after a while. See: #89208 |
The latter has been removed from Nixpkgs. See: - <NixOS/nixpkgs#88620> - <NixOS/nixpkgs#89208> PR #1295
The latter has been removed from Nixpkgs. See: - <NixOS/nixpkgs#88620> - <NixOS/nixpkgs#89208> PR nix-community#1295
The latter has been removed from Nixpkgs. See: - <NixOS/nixpkgs#88620> - <NixOS/nixpkgs#89208> PR nix-community#1295
The latter has been removed from Nixpkgs. See: - <NixOS/nixpkgs#88620> - <NixOS/nixpkgs#89208> PR nix-community#1295
Motivation for this change
In #88136 I concluded that mpv's wrapping was done purely - both the "unwrapped" build had done some wrappings to the two executables in
$out/bin/, while we already had an external wrapper derivation calledmpv-with-scripts. This was bad because:mpv-with-scriptshad their executable wrapped twice.youtubeSupportcaused mpv to be wrapped twice while it was a mere change of includingyoutube-dlin the wrapper's$PATHor not.youtubeSupportenabled, but say you had an override for an updatedyoutube-dl, it was impossible to make mpv use your youtube-dl without recompiling it.Things done
This PR is a rewrite of what was called
mpv-with-scripts- it's now calledwrapMpv(inspired by Neovim'swrapNeovimNix function) and it's possible with it to satisfy both "deterministics" which want everything to be configured exactly as they want via Nix while it enables everyone to tweak what's possible via an external wrapper which doesn't trigger a rebuild of mpv.I tested
wrapMpvwith:mpv-unwrappedwas compiled with and withoutvapoursynthSupportenabled - checked that the wrapper got the same environment but:youtubeSupportworks (of course it works as the exectuable has the same environment).Besides that, as always:
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)cc @pstch @AndersonTorres @jtojnar