@@ -41,11 +41,12 @@ config BR2_PACKAGE_NVIDIA_DRIVER_OPENCL
config BR2_PACKAGE_NVIDIA_DRIVER_PRIVATE_LIBS
bool "Install private libraries"
help
- Two libraries require special agreement with NVidia to develop code
- linking to those libraries: libnvidia-ifr.so and libnvidia-fbc.so
- (to grab and encode an OpenGL buffer or an X framebuffer.)
+ Two libraries require special agreement with NVidia to
+ develop code linking to those libraries: libnvidia-ifr.so
+ and libnvidia-fbc.so (to grab and encode an OpenGL buffer or
+ an X framebuffer.)
- Say 'y' here if you plan on running a program that uses those
- private libraries.
+ Say 'y' here if you plan on running a program that uses
+ those private libraries.
endif # BR2_PACKAGE_NVIDIA_DRIVER
@@ -13,6 +13,11 @@ NVIDIA_DRIVER_LICENSE_FILES = LICENSE
NVIDIA_DRIVER_REDISTRIBUTE = NO
NVIDIA_DRIVER_INSTALL_STAGING = YES
+# Since nvidia-driver are binary blobs, the below dependencies are not
+# strictly speaking build dependencies of nvidia-driver. However, they
+# are build dependencies of packages that depend on nvidia-driver, so
+# they should be built prior to those packages, and the only simple
+# way to do so is to make nvidia-driver depend on them.
NVIDIA_DRIVER_DEPENDENCIES = mesa3d-headers xlib_libX11 xlib_libXext
NVIDIA_DRIVER_PROVIDES = libgl libegl libgles
@@ -69,22 +74,23 @@ endef
# $1: destination directory (target or staging)
#
# For all libraries that need it, we append the NVidia version string.
-# The for all libraries, we install them and create a symlink using their
-# SONAME, so we can link to them at runtime; we also create the no-version
-# symlink, so we can link to them at build time.
+# Then for all libraries, we install them and create a symlink using
+# their SONAME, so we can link to them at runtime; we also create the
+# no-version symlink, so we can link to them at build time.
define NVIDIA_DRIVER_INSTALL_LIBS
- for lib in $(patsubst %,%.so.$(NVIDIA_DRIVER_VERSION),$(NVIDIA_DRIVER_LIBS)) \
+ for libpath in $(addsuffix .so.$(NVIDIA_DRIVER_VERSION),$(NVIDIA_DRIVER_LIBS)) \
$(NVIDIA_DRIVER_LIBS_NO_VERSION); \
do \
- $(INSTALL) -D -m 0644 $(@D)/$${lib} $(1)/usr/lib/$${lib##*/}; \
- n="$$( $(TARGET_READELF) -d "$(@D)/$${lib}" \
+ libname="$${libpath##*/}"; \
+ $(INSTALL) -D -m 0644 $(@D)/$${libpath} $(1)/usr/lib/$${libname}; \
+ libsoname="$$( $(TARGET_READELF) -d "$(@D)/$${libpath}" \
|sed -r -e '/.*\(SONAME\).*\[(.*)\]$$/!d; s//\1/;' )"; \
- if [ -n "$${n}" -a "$${n}" != "$${lib##*/}" ]; then \
- ln -sf $${lib##*/} $(1)/usr/lib/$${n}; \
+ if [ -n "$${libsoname}" -a "$${libsoname}" != "$${libname}" ]; then \
+ ln -sf $${libname} $(1)/usr/lib/$${libsoname}; \
fi; \
- n="$${lib##*/}"; n="$${n/.so*}.so"; \
- if [ -n "$${n}" -a "$${n}" != "$${lib##*/}" ]; then \
- ln -sf $${lib##*/} $(1)/usr/lib/$${n}; \
+ baseso="$${libname/.so*}.so"; \
+ if [ -n "$${baseso}" -a "$${baseso}" != "$${libname}" ]; then \
+ ln -sf $${libname} $(1)/usr/lib/$${baseso}; \
fi; \
done
endef