mesa: aid users needing libglvnd

This does a simple check during build time for libglvnd and
enables it if present. This prevents users from having to fork
the package to add GL support.

I want to /eventually/ add some kind of "optional" dependency
feature to the package manager so we can be rid of these hacks
once and for all.
This commit is contained in:
Dylan Araps 2021-07-10 23:31:20 +03:00
parent 721c26f30b
commit c509e468c0
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

View File

@ -33,6 +33,11 @@ export CFLAGS="$CFLAGS -DGLX_X86_READONLY_TEXT"
sed "/pre_args += '-DUSE_ELF_TLS'/d" meson.build > _
mv -f _ meson.build
# To prevent the need for users to fork the mesa package to add
# libglvnd support, the below code checks for its availability
# and enables it if present. ie: install glvnd, rebuild mesa.
! kiss l libglvnd >/dev/null 2>&1 || glvnd_enabled=true
meson \
--prefix=/usr \
--sysconfdir=/etc \
@ -42,6 +47,7 @@ meson \
-Dplatforms=wayland \
-Dglx=disabled \
-Dzstd=false \
-Dglvnd="${glvnd_enabled:-false}"
. output
ninja -C output