flathub / com.obsproject.Studio

This repository is no longer used to build OBS. Issues should be reported at https://github.com/obsproject/obs-studio
https://github.com/obsproject/obs-studio
29 stars 21 forks source link

Add generic plugin extension point #96

Closed TiZ-HugLife closed 3 years ago

TiZ-HugLife commented 3 years ago

This branch was named new-plugins because I originally wanted to also add the input-overlay plugin as well. Unfortunately, it's a pain to compile because its CMake files don't let you define where OBS's source is. It expects you to clone the git repo as a subdir inside of OBS's source: https://github.com/univrsal/input-overlay/wiki/Compiling

But I do have obs-websocket compiled and working, so I guess we'll start with just that for now.

flathubbot commented 3 years ago

Started test build 36342

flathubbot commented 3 years ago

Build 36342 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/34974/com.obsproject.Studio.flatpakref
TingPing commented 3 years ago

This should be submitted to flathub as its own package. The only reason a few plugins are in tree are because they have proprietary licenses and can't be packaged normally.

TiZ-HugLife commented 3 years ago

I'd like to do that, but the flatpak manifest doesn't currently have any generic extension points for plugins. You're the one who inferred it should be done this way.

TingPing commented 3 years ago

You can leave the custom extension point here, just the plugin manifest can be its own package. You'll just need to make an appdata file for it.

TiZ-HugLife commented 3 years ago

In that case, maybe the purpose of this pull request should pivot a bit and work on making a generic extension point for plugins so that any new plugins don't need to goof around with modifying the main manifest.

TingPing commented 3 years ago

If you want to invest time into doing so go for it, but I'll accept the extension point as is also.

TiZ-HugLife commented 3 years ago

Okay, so my attempts to make a generic extension point haven't been going very well. It seems to insist that plugin libraries should live in /app/lib/obs-plugins and their data should live in /app/share/obs/obs-plugins. I barely understand flatpak manifests and the build system as-is, and am not sure how I can go about making this work. I've been trying to examine manifests of other apps that have generic plugin extension points, and I have no idea what they're doing or why. "add-ld-path" and "merge-dirs" look like magical black boxes to me.

I tried restructuring the websocket plugin similarly to how you would install it in $XDG_CONFIG_HOME/obs-studio/plugins, but it doesn't see it when I do it that way. I can't tell from OBS's codebase if there's any way to define a directory to search for plugins while building it.

I'm really far out of my depth here and could use some guidance.

flathubbot commented 3 years ago

Started test build 37705

TiZ-HugLife commented 3 years ago

Okay I got something figured out. TingPing, your blog post was a good resource to help me understand the merge-dirs stuff that was really confusing me. OBS seems to be very obstinate about what directories it looks in and there doesn't seem to be a way to tell it where to look other than patching it, so patch it I did.

I'll work on submitting WebSockets as its own package.

flathubbot commented 3 years ago

Build 37705 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/36301/com.obsproject.Studio.flatpakref
flathubbot commented 3 years ago

Started test build 37706

flathubbot commented 3 years ago

Build 37706 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/36302/com.obsproject.Studio.flatpakref
TiZ-HugLife commented 3 years ago

@TingPing, should I wait for this to get merged before I submit plugins, or should I submit plugins as an example of how this pull request is used by them?

TingPing commented 3 years ago

We can merge this first. Can you just rebase it so the original websocket specific commit is not here?

flathubbot commented 3 years ago

Started test build 37865

TiZ-HugLife commented 3 years ago

That request makes sense so I did it. I'm not sure if there was a proper way to do this without force-pushing, but hopefully force-pushing doesn't mess anything up.

TingPing commented 3 years ago

Thanks!

TiZ-HugLife commented 3 years ago

Thank you likewise! :D

flathubbot commented 3 years ago

Build 37865 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/36463/com.obsproject.Studio.flatpakref