CuarzoSoftware / Louvre

C++ library for building Wayland compositors.
MIT License
506 stars 14 forks source link

hardcoded paths #13

Closed jengelh closed 9 months ago

jengelh commented 9 months ago
src/lib/core/private/LCompositorPrivate.cpp:        if (!loadGraphicBackend("/usr/etc/Louvre/backends/libLGraphicBackendDRM.so"))
src/lib/core/private/LCompositorPrivate.cpp:            if (!loadGraphicBackend("/usr/etc/Louvre/backends/libLGraphicBackendX11.so"))
src/lib/core/private/LCompositorPrivate.cpp:        if (!loadInputBackend("/usr/etc/Louvre/backends/libLInputBackendLibinput.so"))
src/meson.build:BACKENDS_PATH = '/usr/etc/Louvre/backends'
src/meson.build:ASSETS_PATH = '/usr/etc/Louvre/assets'

So even if the asset path is changed in meson.build, all the programs still hard-reference /usr.

ehopperdietzel commented 9 months ago

Those paths are not intended to be modified, but if you need to, I will create Meson options so that they can be modified, and perhaps an environment variable to specify the default path for backends.

2xsaiko commented 9 months ago

You should use the already existing options here: https://mesonbuild.com/Builtin-options.html

e.g. get_option('datadir') / 'Louvre/assets' and get_option('libdir') / 'Louvre/backends'.

edit: If additional backends are supposed to be able to be added by others, an environment variable to control where to search for them would be great. For example, NixOS uses QT_PLUGIN_PATH to set a search path for Qt plugins, since each package containing Qt plugins has its own path for them. It depends on the program which path is used, for Konsole it could look like this: QT_PLUGIN_PATH=/nix/store/ay6p1gvayg74pfsvlnyqhrab49ml7a7m-konsole-23.08.2/lib/qt-5.15.10/plugins:/nix/store/z4zlqic8bzn23nmmyzd8ss3gmvmpy1y6-qtmultimedia-5.15.10-bin/lib/qt-5.15.10/plugins:...

ehopperdietzel commented 9 months ago

Fixed! 😉 I added new Meson options.