obsproject / obs-plugintemplate

GNU General Public License v2.0
307 stars 141 forks source link

Set LINUX_PORTABLE to off on CI #39

Closed cg2121 closed 2 years ago

cg2121 commented 2 years ago

Description

This matches what is default in OBS Studio. Most developers won't know to change this, as the deb file will install to the wrong place, causing the plugin not to load.

Motivation and Context

Got frustrated when installing the deb file, and the plugin wouldn't load. Found out LINUX_PORTABLE was set to ON.

How Has This Been Tested?

Installed via deb and the plugin loaded successfully.

Types of changes

Checklist:

tytan652 commented 2 years ago

You'll need to add -DLINUX_PORTABLE=ON in the build script since it builds tarball for user install which requires it to ON.

norihiro commented 2 years ago

Got frustrated when installing the deb file, and the plugin wouldn't load. Found out LINUX_PORTABLE was set to ON.

In addition to this PR, how about disabling deb-package setup when LINUX_PORTABLE is ON?

PatTheMav commented 2 years ago

Got frustrated when installing the deb file, and the plugin wouldn't load. Found out LINUX_PORTABLE was set to ON.

In addition to this PR, how about disabling deb-package setup when LINUX_PORTABLE is ON?

I think that'd be the correct solution, also that'd would mirror how obs-studio does it iirc.

cg2121 commented 2 years ago

Updated to just turn it off only on the workflow.

PatTheMav commented 2 years ago

You'll need to add -DLINUX_PORTABLE=ON in the build script since it builds tarball for user install which requires it to ON.

I think we need to take another dive into this - if LINUX_PORTABLE is set to on, OBS expects a different directory structure:

BASE
 └ data
    └ obs-plugins
        └ PLUGIN
 └ obs-plugins
    └ ARCH

Non-portable builds have a different directory structure:

BASE
  └ libs
    └ obs-plugins
  └ share
    └ obs
      └ obs-plugins

This leads to two main issues:

  1. The directory structure of the tarball is different for a plugin used in a portable build of OBS vs. a build distributed via package managers (which usually use the non-portable structure)
  2. Assumptions plugins make about the internal directory structure might fail if a plugin is used in the "wrong" OBS variant - for better or worse OBS uses relative paths to resolve locations, which are hardcoded at compile time and differ between portable and non-portable builds (because for portable builds you have to take the additional 64bit/32bit subdirectories into account).

This is an architectural issue that we need to fix on Linux, because as-is there is no interoperability between those build variants.

PatTheMav commented 2 years ago

This matches what is default in OBS Studio

I think this is a good enough reason to merge this, as the expectation would be that plugins use the same setup and directory structure as main OBS releases.