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
Kdenlive/mlt: enable glaxnimate to add vectorial animations #209941
base: master
Are you sure you want to change the base?
Conversation
This PR adds also a new functionality in KDEnlive to edit vectorial animations. See tutorial here https://www.youtube.com/watch?v=em-km2xzVnw (french, but should be fairly easy to follow) |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/kdenlive-missing-mlt-module-glaxnimate/24486/6 |
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.
Please follow the contributing guide when naming your commits.
Ok so I investigated a bit further: Mlt creates its own library installed in Note that as I understand, because all
So to fix it properly, we would need to patch glaxnimate to install the libraries, and patch MLT to use glaxnimate instead of a submodule… This might be doable, but quite a lot of work compared to simply adding the submodule as I do right now… Note that I filled a bug here to ask glaxnimate to install the library files (they might not want in case their library is not stable enough). If the library is not stable, then I guess it's a good idea to keep the submodule as upgrading glaxnimate might change the version used by MLT and break other stuff. @SuperSandro2000 thanks, I'll follow them better (I didn't know that case was important and used by bots), but since my commit touches two packages, how should I write that? Do I need to write one commit per program? |
So I got an answer by glaxnimate's team: https://gitlab.com/mattbas/glaxnimate/-/issues/545. They say they plan to modify their software to cut it in smaller, reusable libraries, but they had no time to do it so far. So I guess for now it's better to use submodules rather than spending time on writing patches that would eventually be unnecessary. If you are good with that, I can remove |
Yes
If the required work is just installing the so, even if it is done via a cp command and linking against that, then that is preferred. Package collections, like nixpkgs, want to avoid vendoring as much as possible because it makes having a single source for a package with all patches impossible. |
@SuperSandro2000 I understand that Nix tries to limit third party sources, but the software needs the source since glaxnimate provides no library, so I don't think a .so file is even produced (but I did it a while ago so I might remember poorly). I have no idea how to change the whole compilation process in order to avoid this dependency on the source (and I don't have time to spend one week on this), so if you know how to do it feel free to… until then people won't be able to use glaxnimate in KDEnlive. Overall, I think maintaining a clean repo is nice, but IMHO it should not come at the price of not implementing a functionality because a perfect clean solution is not possible to implement. |
The code works (or at least used to work, I've not tested recently), I am just waiting for @SuperSandro2000 to accept the fact that I rely on a git submodule following what is done upstream. Since glaxnimate provides no API/.so library for now (it might come later if they find people with good enough cmake expertise), I see no other solution. Then, I'll properly rebase the commits on the latest nixpkgs version. |
@tobiasBora see https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions for naming conventions for the commits. I think ideally you would split the commit into two, with these names:
|
40d8f96
to
5834e20
Compare
Should be good now. Note that I handle the path to If you don't, you might get a prompt asking for the path to glaxnimate when you start to use the plugin (cf tutorial in second message). |
@ofborg build kdenlive |
There is something wrong with the build:
https://github.com/NixOS/nixpkgs/pull/209941/checks?check_run_id=20524628144 I can reproduce the build error locally. |
It must somehow be related to this part:
But it builds on master. I don't understand what change creates the error. |
@@ -94,7 +100,7 @@ stdenv.mkDerivation rec { | |||
SDL | |||
] ++ lib.optionals enableSDL2 [ | |||
SDL2 | |||
]; | |||
] ++ lib.optionals enableGlaxnimate glaxnimate.buildInputs; |
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.
I think this doesn't quite work as intended anymore. Maybe the issue is that this unconditionally adds qtbase
and other qt packages, but mlt
can only deal with them when qt != null
in the inputs. Maybe throw an error if enableGlaxnimate = true && qt == null
?
Oh interesting… I was also getting this error when compiling mlt alone, but I thought that it was expected since |
Oh, ok, now I get why mlt in kdenlive builds fine: in
so KDEnlive is using the one with Qt, explaining why it is not failing to build. When I have a bit more time, I will try to see if qt is really needed, and if it is needed I will maybe enable glaxnimate only if qt is not null (throwing an error would break the current version, so I'm thinking it might not be the best idea). |
Just as a heads up, this is still the case in the unstable build with Qt6 (kdePackages.kdenlive) |
Ok thanks. I need to take a bit of time to fix this issue. The next month will be rather busy for me, I'll see if I can find some time before but it's definitely in my todo list. |
5834e20
to
59e53e0
Compare
This version should work now (let's wait maybe for the tests to finish first). By just specifying the only actually needed library, we get rid of the mlt error (actually, mlt seems to automatically disable glaxnimate support if qt is disabled, without providing any error). |
Seems like all tests passes, are we good now? |
# Needed to replace @glaxnimate@ by its path | ||
inherit mediainfo glaxnimate; |
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.
Doesn't this need to be done with substituteAll on the patch file?
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.
Sure, but substituteAllInPlace
is already part of Kdenlive's derivation as this file is already patched similarly for other binaries.
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.
Can we make this explicit? Using substituteAllInPlace with ambient variables is kinda surpising.
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.
What do you mean? substituteAllInPlace just expects these variables to be in the environment (whether this is good or not is discussed here, but so far no agreement has been reached), and my goal was just to implement this fix following what kdenlive's package is already doing, as I don't want to risk adding bugs doing some sort of refactoring. Or do you mean to put them in env = {}
to make it somewhat clearer?
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.
I agree, it would be cleaner to use the substituteAll builder on the patch itself. That said, I don't mind either way.
@@ -36,6 +36,9 @@ | |||
, enableSDL2 ? true | |||
, SDL2 | |||
, gitUpdater | |||
, glaxnimate |
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.
, glaxnimate |
Description of changes
Fix #209923
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes@turion @goibhniu