Use the version from the VERSION file to determine the libgallium file
name. Fall back to using MESALIB_VERSION if the sources are not present.

When building from git, the VERSION file may contain a version in the
form 24.3.0-devel, which is likely different from MESALIB_VERSION. The
build system determines the libgallium file name from the VERSION file,
so we should do the same.

This fixes targetinstall for git builds, e.g. when using local-src. For
release tarballs, the VERSION file content and MESALIB_VERSION are
identical.

Signed-off-by: Philipp Zabel <[email protected]>
---
 rules/mesalib.make | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rules/mesalib.make b/rules/mesalib.make
index c62a0802f0a0..ca1fc6b992b8 100644
--- a/rules/mesalib.make
+++ b/rules/mesalib.make
@@ -267,6 +267,10 @@ $(STATEDIR)/mesalib.compile:
 # Target-Install
 # ----------------------------------------------------------------------------
 
+# read libgallium version from file, fall back to package version
+MESALIB_LIBGALLIUM_VERSION := \
+       $(if $(wildcard $(MESALIB_DIR)/VERSION),$(file 
<$(MESALIB_DIR)/VERSION),$(MESALIB_VERSION))
+
 $(STATEDIR)/mesalib.targetinstall:
        @$(call targetinfo)
 
@@ -277,7 +281,8 @@ $(STATEDIR)/mesalib.targetinstall:
        @$(call install_fixup, mesalib,DESCRIPTION,missing)
 
 ifneq ($(strip $(MESALIB_DRI_GALLIUM_LIBS-y)),)
-       @$(call install_copy, mesalib, 0, 0, 0644, -, 
/usr/lib/libgallium-$(MESALIB_VERSION).so)
+       @$(call install_copy, mesalib, 0, 0, 0644, -, \
+               /usr/lib/libgallium-$(MESALIB_LIBGALLIUM_VERSION).so)
 ifdef PTXCONF_MESALIB_EGL_X11
        @$(call install_copy, mesalib, 0, 0, 0644, -, 
/usr/lib/dri/libdril_dri.so)
 
-- 
2.39.2


Reply via email to