Skip to contentSkip to conversation

package/mesa3d: Remove libGL headers/pkgconfig when OpenGL is disabled

PATCH New Bernd Kuhls 3 participants 3 messages Jun 7, 2015 – Jul 10, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/mesa3d: Remove libGL headers/pkgconfig when OpenGL is disabled

mesa3d defaults to --enable-opengl due to its weird configure.ac:
http://git.buildroot.net/buildroot/commit/package/mesa3d/mesa3d.mk?id=384d601d4ea2c41bb7928f756bfe88af4d38b38b

This leads to include/GL/*.h and lib/pkgconfig/gl.pc being installed to STAGING_DIR. These files are enough for other packages to wrongly assume that libGL.so is present, like vlc.

Fixes
http://autobuild.buildroot.net/results/e63/e639dabfb260006acb8a204851b96f9275ce53a7/

---
v2: Instead of fixing vlc?s libGL detection let?s remove the superfluous
files installed by mesa3d (Yann)

 package/mesa3d/mesa3d.mk |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
package/mesa3d/mesa3d.mk +9 -1
index 4a419de..669eada 100644
@@ -77,9 +77,16 @@ MESA3D_CONF_OPTS += \
 	--with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y))
 endif
 
+define MESA3D_REMOVE_OPENGL_PC
+	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/dri.pc
+	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/gl.pc
+	rm -rf $(STAGING_DIR)/usr/include/GL/
+endef
+
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
 	--without-dri-drivers --without-dri --disable-dri3
+MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_PC
 else
 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
 MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
@@ -102,7 +109,8 @@ endif
 
 # Always enable OpenGL:
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
-#   - but if no DRI driver is enabled, then libgl is not built
+#   - but if no DRI driver is enabled, then libgl is not built,
+#     remove dri.pc and gl.pc in this case (MESA3D_REMOVE_OPENGL_PC)
 MESA3D_CONF_OPTS += --enable-opengl
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 package/mesa3d: Remove libGL headers/pkgconfig when OpenGL is disabled

Bernd, All,

On 2015-06-07 23:11 +0200, Bernd Kuhls spake thusly:

Quoted 11 lines

mesa3d defaults to --enable-opengl due to its weird configure.ac:
http://git.buildroot.net/buildroot/commit/package/mesa3d/mesa3d.mk?id=384d601d4ea2c41bb7928f756bfe88af4d38b38b

This leads to include/GL/*.h and lib/pkgconfig/gl.pc being installed to STAGING_DIR. These files are enough for other packages to wrongly assume that libGL.so is present, like vlc.

Fixes
http://autobuild.buildroot.net/results/e63/e639dabfb260006acb8a204851b96f9275ce53a7/

Regards,
Yann E. MORIN.

Quoted 45 lines

---
v2: Instead of fixing vlc?s libGL detection let?s remove the superfluous
files installed by mesa3d (Yann)

 package/mesa3d/mesa3d.mk |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
package/mesa3d/mesa3d.mk +9 -1
index 4a419de..669eada 100644
@@ -77,9 +77,16 @@ MESA3D_CONF_OPTS += \
 	--with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y))
 endif
 
+define MESA3D_REMOVE_OPENGL_PC
+	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/dri.pc
+	rm -f $(STAGING_DIR)/usr/lib/pkgconfig/gl.pc
+	rm -rf $(STAGING_DIR)/usr/include/GL/
+endef
+
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
 	--without-dri-drivers --without-dri --disable-dri3
+MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_PC
 else
 ifeq ($(BR2_PACKAGE_XPROTO_DRI3PROTO),y)
 MESA3D_DEPENDENCIES += xlib_libxshmfence xproto_dri3proto xproto_presentproto
@@ -102,7 +109,8 @@ endif
 
 # Always enable OpenGL:
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
-#   - but if no DRI driver is enabled, then libgl is not built
+#   - but if no DRI driver is enabled, then libgl is not built,
+#     remove dri.pc and gl.pc in this case (MESA3D_REMOVE_OPENGL_PC)
 MESA3D_CONF_OPTS += --enable-opengl
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
Signature · 6 lines
1.7.10.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v2 1/1 package/mesa3d: Remove libGL headers/pkgconfig when OpenGL is disabled

In reply to Bernd Kuhls

Dear Bernd Kuhls,

Quoted 7 lines · Bernd Kuhls

mesa3d defaults to --enable-opengl due to its weird configure.ac:
http://git.buildroot.net/buildroot/commit/package/mesa3d/mesa3d.mk?id=384d601d4ea2c41bb7928f756bfe88af4d38b38b

This leads to include/GL/*.h and lib/pkgconfig/gl.pc being installed to STAGING_DIR. These files are enough for other packages to wrongly assume that libGL.so is present, like vlc.

Quoted 7 lines

Fixes
http://autobuild.buildroot.net/results/e63/e639dabfb260006acb8a204851b96f9275ce53a7/

---
v2: Instead of fixing vlc?s libGL detection let?s remove the superfluous
files installed by mesa3d (Yann)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com