[rebase] split off gps and cava modules into run-time loaded shared libraries#4735
[rebase] split off gps and cava modules into run-time loaded shared libraries#4735qbe wants to merge 9 commits intoAlexays:masterfrom
Conversation
* fixed typo in meson.build: eproxy -> epoxy * refactored cava_frontend.hpp into cava_frontend.cpp
|
As to why this rebase was necessary, turns out using the wrong clang-format version caused a lot of noise, while at the same time some changes regarding cava were merged. |
lots of conflicts, almost all of them from the reap_mtx/reap params
|
@Alexays I am trying to resolve the merge conflicts (again), but I am struggling with the problem of having to pass reap_mtx / reap pairs to the handleGtkMenuEvent function (src/ALabel.cpp:193) which it now needs because it calls forkExec and that function needs the reap list. Before I take a deep dive into this, can you please take a look at my PR so far ? I have by now sunken quite a lot of time into this series, which would be worth it if you see the value in this PR in general, but if you are generally against splitting of modules and dynamically loading them then I can go do |
compiles, but allocates a 3-pointer struct which might not be deleted cleanly.
rebase of #4667 , a (proposed) fix for #4276
justification for this PR is discussed in the issue, dynamically loading modules allows a waybar build with cava and gps capabilities to be packaged in a way that allows for libgps, libcava and epoxy to be optional dependencies.
Another goal of this PR was to include as few modifications to module code as necessary. For this reason I decided to split off the cava and gps modules into shared libraries, and to load them in factory.cpp using dlopen() / dlsym() .
The first 4 commits deal with the fact that reap_mtx / reap were previously an "extern" reference deep within include/util/command.hpp , which is included in every module and thus prevents the split up. Passing reap_mtx / reap to the module constructors rectifies this, but necessarily touches lots of constructors. I recommend looking at a word-diff of these commits.