This has caused a lot of issues because when preloaded the vulkan hooks
will still initialize even tho it's an OpenGL application.
This will subsequently crash the application.
The solution is to split the vulkan and opengl parts into two separate
shared libraries.
Currently we have ld_libdir_abs which defaults to false. In that case,
both the mangohud shell wrapper, as well as the json files, reference
the DSOs directly without any path component.
This means that at run-time the dynamic linker, vulkan loader as well as
pressure-vessel will need to jump through hoops and figure out the
bitness of the DSO, whether one wants the 32 or 64bit one and even then
there will be confusing messages like:
fatal: /usr/lib/libMangoHud.so: wrong ELF class: ELFCLASS32
When set to true, as seen in the in-tree build.sh we'll append empty
path to LD_LIBRARY_PATH (bad), the full path with the $LIB token will be
used with LD_PRELOAD (good) and json files (bad).
Since we are generating separate json files, we can use the actual path
(while $LIB currently works, it's not really strict json nor documented
as supported). We can also drop the dubious LD_LIBRARY_PATH manipulation
This basically reinstates the prepend_libdir_vk=true option that was
dropped earlier.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
This will allow us to remove the $LIB from the json files and simplify
the related lib handling.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
The option defaults to false in-tree and across all distributions. The
only alleged use-case is the build.sh/build-srt.sh scripts. Although the
output of those scripts is absolutely identical with or w/o the flag.
Remove it.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Currently the CI jobs only builds on releases, which catches some of the
fallout.
We might get a proper CI at some point in the future.
v2: pass the -Dwerror=true directly into build.sh
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Use ID/ID_LIKE instead of NAME which will allow less popular forks of
distros to work properly, for example archlabs, whose ID_LIKE will be
arch. And due to the simpler format this should be more
future-compatible.
It appears that some distros don't have ID_LIKE so it also includes ID
in the DISTRO variable.
There are a few downsides to this approach, notably:
- The OpenSUSE message won't be able to detect whether the user is on
leap or tumbleweed, so I made it print the command for both.
- This requires some more globbing since the ID field will be before
the ID_LIKE field, and the ID_LIKE field can include multiple
distros.
https://freedesktop.org/software/systemd/man/os-release.html
PR #420
Running `sudo ninja install` isn't ideal but for convenience do it anyway.
Re-run `build` before install to somewhat mitigate files getting "chowned" by root.