Skip to contentSkip to conversation

package/mesa3d: switch build system to meson

RFC PATCH Superseded Bernd Kuhls 3 participants 3 messages Apr 11, 2019 – Apr 13, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 package/mesa3d: switch build system to meson

Remove all patches related to autotools.

---
This patch is only slightly tested, expect breakages ;)

 ...vert-order-for-wayland-scanner-check.patch |  51 ---------
 .../mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch   |  37 ------
 package/mesa3d/Config.in                      |   3 -
 package/mesa3d/mesa3d.mk                      | 108 ++++++++----------
 4 files changed, 48 insertions(+), 151 deletions(-)
 delete mode 100644 package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch
 delete mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch deleted +0 -51
deleted file mode 100644
index 5135528795..0000000000
@@ -1,51 +0,0 @@
-From ef96bac7cbbb11b98606864ead0f731dd5b71d5a Mon Sep 17 00:00:00 2001
-From: Gustavo Zacarias <[email protected]>
-Date: Thu, 17 Nov 2016 15:36:54 -0300
-Subject: [PATCH] configure.ac: invert order for wayland-scanner check
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-Try searching the PATH first, and if that fails fall back into
-pkg-config.
-
-[Vincent: tweak patch for 17.1.1 version]
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
-Signed-off-by: Vicente Olivert Riera <[email protected]>
-[Romain: rebase on 18.1]
-Signed-off-by: Romain Naour <[email protected]>
-[Bernd rebase on 18.3]
-Signed-off-by: Bernd Kuhls <[email protected]>
----
- configure.ac | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index f1fbdcc6c7..dcf87e7dd6 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1841,17 +1841,16 @@
-         fi
-         WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
- 
--        PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
-+        AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
-+        if test "x$WAYLAND_SCANNER" = x; then
-+                PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
-                           WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
-                           WAYLAND_SCANNER='')
-+        fi
-         PKG_CHECK_EXISTS([wayland-scanner >= 1.15],
-                           AC_SUBST(SCANNER_ARG, 'private-code'),
-                           AC_SUBST(SCANNER_ARG, 'code'))
- 
--        if test "x$WAYLAND_SCANNER" = x; then
--            AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
--        fi
--
-         if test "x$WAYLAND_SCANNER" = "x:"; then
-                 AC_MSG_ERROR([wayland-scanner is needed to compile the wayland platform])
-         fi
--- 
-2.14.3
package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch deleted +0 -37
deleted file mode 100644
index 42ae826a36..0000000000
@@ -1,37 +0,0 @@
-From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
-From: Valentin Korenblit <[email protected]>
-Date: Sat, 20 Oct 2018 10:56:23 +0200
-Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
-
-LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
-will look for OpenCL "headers" on the target, when building the OpenCL
-kernels.
-
-The value returned by pkg-config for includedir is relevant when
-cross-compiling, on the build machine. But in this specific case, we
-really need a value that is valid on the target.
-
-Those headers are installed by the libclc package in /usr/share so
-that they are not removed by Buildroot target-finalize logic.
-
-Signed-off-by: Valentin Korenblit <[email protected]>
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 864dcae..cc2390b 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2429,7 +2429,7 @@ if test "x$enable_opencl" = xyes; then
-                     PKG_CONFIG_PATH environment variable.
-                     By default libclc.pc is installed to /usr/local/share/pkgconfig/])
-     else
--        LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc`
-+        LIBCLC_INCLUDEDIR="/usr/share"
-         LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc`
-         AC_SUBST([LIBCLC_INCLUDEDIR])
-         AC_SUBST([LIBCLC_LIBEXECDIR])
--- 
-2.7.4
-
package/mesa3d/Config.in +0 -3
index 3f44e94229..6070e5e039 100644
@@ -129,7 +129,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
 	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon R600/R700/HD5000/HD6000 GPUs.
 
@@ -151,7 +150,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 	select BR2_PACKAGE_LLVM_AMDGPU
 	select BR2_PACKAGE_ELFUTILS
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.
 
@@ -184,7 +182,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
 	select BR2_PACKAGE_LIBDRM_VC4
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
 	  Driver for Broadcom VC4 (rpi2/3) GPUs.
package/mesa3d/mesa3d.mk +48 -60

221 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

RFC PATCH 1/1 package/mesa3d: switch build system to meson

Quoted 1 line · Bernd Kuhls

Remove all patches related to autotools.

Good that you do that, however...

Quoted 19 lines

---
This patch is only slightly tested, expect breakages ;)

 ...vert-order-for-wayland-scanner-check.patch |  51 ---------
 .../mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch   |  37 ------
 package/mesa3d/Config.in                      |   3 -
 package/mesa3d/mesa3d.mk                      | 108 ++++++++----------
 4 files changed, 48 insertions(+), 151 deletions(-)
 delete mode 100644 package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch
 delete mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch deleted +0 -0
deleted file mode 100644
index 5135528795..0000000000

package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch line 10

Quoted 10 lines
package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch deleted +0 -10
@@ -1,51 +0,0 @@
-From ef96bac7cbbb11b98606864ead0f731dd5b71d5a Mon Sep 17 00:00:00 2001
-From: Gustavo Zacarias <[email protected]>
-Date: Thu, 17 Nov 2016 15:36:54 -0300
-Subject: [PATCH] configure.ac: invert order for wayland-scanner check
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-Try searching the PATH first, and if that fails fall back into
-pkg-config.

AFAICS meson *only* looks at pkg-config for wayland-scanner. It does use

dep_wl_scanner = dependency('wayland-scanner', native: true)

so in theory it should look for the host wayland-scanner rather than the target one, but I'm not sure if we set up meson in a way that it would be able to make that distinction.

[snip]

Quoted 8 lines
package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch deleted +0 -5
@@ -1,37 +0,0 @@
-From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
-From: Valentin Korenblit <[email protected]>
-Date: Sat, 20 Oct 2018 10:56:23 +0200
-Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
-

package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch line 15

Quoted 10 lines
package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch deleted +0 -10
-LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
-will look for OpenCL "headers" on the target, when building the OpenCL
-kernels.
-
-The value returned by pkg-config for includedir is relevant when
-cross-compiling, on the build machine. But in this specific case, we
-really need a value that is valid on the target.
-
-Those headers are installed by the libclc package in /usr/share so
-that they are not removed by Buildroot target-finalize logic.

The meson infrastructure uses

'-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir'))

which I expect will give no joy either.

[snip]

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 · line 132

Quoted 9 lines
package/mesa3d/Config.in +0 -1
index 3f44e94229..6070e5e039 100644
@@ -129,7 +129,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
 	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
-	select BR2_PACKAGE_MESA3D_NEEDS_XA

Why does this get removed?

Quoted 24 lines
package/mesa3d/Config.in +0 -2
 	help
 	  Driver for ATI/AMD Radeon R600/R700/HD5000/HD6000 GPUs.
 
@@ -151,7 +150,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 	select BR2_PACKAGE_LLVM_AMDGPU
 	select BR2_PACKAGE_ELFUTILS
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.
 
@@ -184,7 +182,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
 	select BR2_PACKAGE_LIBDRM_VC4
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
 	  Driver for Broadcom VC4 (rpi2/3) GPUs.
package/mesa3d/mesa3d.mk +0 -0
index 02c8a8a57a..67edab89af 100644

package/mesa3d/mesa3d.mk MESA3D_PROVIDES = · line 24

Quoted 4 lines
package/mesa3d/mesa3d.mk +1 -0
@@ -21,31 +21,22 @@ MESA3D_PROVIDES =
 MESA3D_DEPENDENCIES = \
 	host-bison \
 	host-flex \
+	host-python3-mako \

Why does this get added?

Quoted 8 lines
package/mesa3d/mesa3d.mk +0 -4
 	expat \
 	libdrm \
 	zlib
 
-# Disable assembly usage.
-MESA3D_CONF_OPTS = --disable-asm
-
-# autotools are deprecated in favour of meson, for now force autotools

package/mesa3d/mesa3d.mk MESA3D_PROVIDES = · line 31

Quoted 10 lines
package/mesa3d/mesa3d.mk +3 -7
-MESA3D_CONF_OPTS += --enable-autotools
-
-# Disable static, otherwise configure will fail with: "Cannot enable both static
-# and shared."
-ifeq ($(BR2_SHARED_STATIC_LIBS),y)
-MESA3D_CONF_OPTS += --disable-static
-endif
+MESA3D_CONF_OPTS = \
+	-Dasm=false \
+	-Dgallium-omx=disabled

Why does this get added?

Quoted 17 lines
package/mesa3d/mesa3d.mk +3 -5
 ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y)
 MESA3D_DEPENDENCIES += host-llvm llvm
-MESA3D_CONF_OPTS += \
-	--with-llvm-prefix=$(STAGING_DIR)/usr \
-	--enable-llvm-shared-libs \
-	--enable-llvm
+MESA3D_CONF_ENV += LLVM_CONFIG=$(STAGING_DIR)/usr/bin/llvm-config
+MESA3D_CONF_OPTS += -Dllvm=true
 else
 # Avoid automatic search of llvm-config
-MESA3D_CONF_OPTS += --disable-llvm
+MESA3D_CONF_OPTS += -Dllvm=false
 endif
 
 # Disable opencl-icd: OpenCL lib will be named libOpenCL instead of

package/mesa3d/mesa3d.mk endif · line 57

Quoted 5 lines
package/mesa3d/mesa3d.mk +0 -2
@@ -53,11 +44,9 @@ endif
 ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
 MESA3D_PROVIDES += libopencl
 MESA3D_DEPENDENCIES += clang libclc
-MESA3D_CONF_OPTS += --enable-opencl \
-	--disable-opencl-icd \

No equivalent of this is needed?

package/mesa3d/mesa3d.mk endif · line 47

Quoted 2 lines
package/mesa3d/mesa3d.mk +1 -1
-	--with-clang-libdir=$(STAGING_DIR)/usr/lib
+MESA3D_CONF_OPTS += -Dgallium-opencl=standalone

Can you explain what are the options, and why standalone is chosen?

Quoted 30 lines
package/mesa3d/mesa3d.mk +6 -6
 else
-MESA3D_CONF_OPTS += --disable-opencl
+MESA3D_CONF_OPTS += -Dgallium-opencl=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y)
@@ -82,17 +71,17 @@ MESA3D_DEPENDENCIES += \
 	xlib_libXxf86vm \
 	xorgproto \
 	libxcb
-MESA3D_CONF_OPTS += --enable-glx --disable-mangling
+MESA3D_CONF_OPTS += -Dglx=auto
 # quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
-MESA3D_CONF_OPTS += --enable-xa
+MESA3D_CONF_OPTS += -Dgallium-xa=true
 else
-MESA3D_CONF_OPTS += --disable-xa
+MESA3D_CONF_OPTS += -Dgallium-xa=false
 endif
 else
 MESA3D_CONF_OPTS += \
-	--disable-glx \
-	--disable-xa
+	-Dglx=disabled \
+	-Dgallium-xa=false
 endif
 
 # Drivers

package/mesa3d/mesa3d.mk MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast · line 104

Quoted 5 lines
package/mesa3d/mesa3d.mk +1 -1
@@ -112,63 +101,62 @@ MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915)   += i915
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965)   += i965
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_NOUVEAU) += nouveau
-MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
+MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += r100

Please explain this in the commit message.

Quoted 26 lines
package/mesa3d/mesa3d.mk +6 -6
 # Vulkan Drivers
 MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL)   += intel
 
 ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-gallium-drivers \
-	--disable-gallium-extra-hud
+	-Dgallium-drivers= \
+	-Dgallium-extra-hud=false
 else
 MESA3D_CONF_OPTS += \
-	--enable-shared-glapi \
-	--with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
-	--enable-gallium-extra-hud
+	-Dshared-glapi=true \
+	-Dgallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
+	-Dgallium-extra-hud=true
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-dri-drivers --disable-dri3
+	-Ddri-drivers= -Ddri3=false
 else
 ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE),y)
 MESA3D_DEPENDENCIES += xlib_libxshmfence

package/mesa3d/mesa3d.mk MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast · line 143

Quoted 10 lines
package/mesa3d/mesa3d.mk +2 -5
-MESA3D_CONF_OPTS += --enable-dri3
+MESA3D_CONF_OPTS += -Ddri3=true
 else
-MESA3D_CONF_OPTS += --disable-dri3
+MESA3D_CONF_OPTS += -Ddri3=false
 endif
 MESA3D_CONF_OPTS += \
-	--enable-shared-glapi \
-	--enable-driglx-direct \
-	--with-dri-driverdir=/usr/lib/dri \

No need to specify this anymore?

Regards,
Arnout

Quoted 109 lines
package/mesa3d/mesa3d.mk +25 -23
-	--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
+	-Dshared-glapi=true \
+	-Dglx-direct=true \
+	-Ddri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-vulkan-drivers
+	-Dvulkan-drivers=
 else
 MESA3D_DEPENDENCIES += xlib_libxshmfence
 MESA3D_CONF_OPTS += \
-	--enable-dri3 \
-	--with-vulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
+	-Ddri3=true \
+	-Dvulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
 endif
 
 # APIs
 
 ifeq ($(BR2_PACKAGE_MESA3D_OSMESA),y)
-MESA3D_CONF_OPTS += --enable-osmesa
+MESA3D_CONF_OPTS += -Dosmesa=classic
 else
-MESA3D_CONF_OPTS += --disable-osmesa
+MESA3D_CONF_OPTS += -Dosmesa=none
 endif
 
 # Always enable OpenGL:
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
-MESA3D_CONF_OPTS += --enable-opengl --enable-dri
+MESA3D_CONF_OPTS += -Dopengl=true -Dglx=dri
 
 # libva and mesa3d have a circular dependency
 # we do not need libva support in mesa3d, therefore disable this option
-MESA3D_CONF_OPTS += --disable-va
+MESA3D_CONF_OPTS += -Dgallium-va=false
 
 # libGL is only provided for a full xorg stack
 ifeq ($(BR2_PACKAGE_XORG7),y)
@@ -201,51 +189,51 @@ MESA3D_PLATFORMS += x11
 endif
 
 MESA3D_CONF_OPTS += \
-	--with-platforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
+	-Dplatforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 MESA3D_PROVIDES += libegl
 MESA3D_CONF_OPTS += \
-	--enable-gbm \
-	--enable-egl
+	-Dgbm=true \
+	-Degl=true
 else
 MESA3D_CONF_OPTS += \
-	--disable-egl
+	-Degl=true=false
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
 MESA3D_PROVIDES += libgles
-MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
+MESA3D_CONF_OPTS += -Dgles1=true -Dgles2=true
 else
-MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
+MESA3D_CONF_OPTS += -Dgles1=false -Dgles2=false
 endif
 
 ifeq ($(BR2_PACKAGE_XLIB_LIBXVMC),y)
 MESA3D_DEPENDENCIES += xlib_libXvMC
-MESA3D_CONF_OPTS += --enable-xvmc
+MESA3D_CONF_OPTS += -Dgallium-xvmc=true
 else
-MESA3D_CONF_OPTS += --disable-xvmc
+MESA3D_CONF_OPTS += -Dgallium-xvmc=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
-MESA3D_CONF_OPTS += --enable-libunwind
+MESA3D_CONF_OPTS += -Dlibunwind=true
 MESA3D_DEPENDENCIES += libunwind
 else
-MESA3D_CONF_OPTS += --disable-libunwind
+MESA3D_CONF_OPTS += -Dlibunwind=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
 MESA3D_DEPENDENCIES += libvdpau
-MESA3D_CONF_OPTS += --enable-vdpau
+MESA3D_CONF_OPTS += -Dgallium-vdpau=true
 else
-MESA3D_CONF_OPTS += --disable-vdpau
+MESA3D_CONF_OPTS += -Dgallium-vdpau=false
 endif
 
 ifeq ($(BR2_PACKAGE_LM_SENSORS),y)
-MESA3D_CONF_OPTS += --enable-lmsensors
+MESA3D_CONF_OPTS += -Dlmsensors=true
 MESA3D_DEPENDENCIES += lm-sensors
 else
-MESA3D_CONF_OPTS += --disable-lmsensors
+MESA3D_CONF_OPTS += -Dlmsensors=false
 endif
 
-$(eval $(autotools-package))
+$(eval $(meson-package))
#2 lore raw

RFC PATCH 1/1 package/mesa3d: switch build system to meson

Hi Arnout, Bernd, All,

Le 13/04/2019 ? 14:50, Arnout Vandecappelle a ?crit?:

Quoted 6 lines · Bernd Kuhls
Quoted 1 line

Remove all patches related to autotools.

Good that you do that, however...

I asked Bernd if he was working on a patch switching to meson build system [1]. He sent to the mailing list this patch which is a preliminary version. I guess the commit log was not ready ;-)

I'm looking at it and I found already some issues.

[1] http://lists.busybox.net/pipermail/buildroot/2019-April/247587.html

Best regards,
Romain

Quoted 355 lines
Quoted 20 lines

---
This patch is only slightly tested, expect breakages ;)

 ...vert-order-for-wayland-scanner-check.patch |  51 ---------
 .../mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch   |  37 ------
 package/mesa3d/Config.in                      |   3 -
 package/mesa3d/mesa3d.mk                      | 108 ++++++++----------
 4 files changed, 48 insertions(+), 151 deletions(-)
 delete mode 100644 package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch
 delete mode 100644 package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch
package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch deleted +0 -0
deleted file mode 100644
index 5135528795..0000000000

package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch line 10

Quoted 10 lines
package/mesa3d/0002-configure.ac-invert-order-for-wayland-scanner-check.patch deleted +0 -10
@@ -1,51 +0,0 @@
-From ef96bac7cbbb11b98606864ead0f731dd5b71d5a Mon Sep 17 00:00:00 2001
-From: Gustavo Zacarias <[email protected]>
-Date: Thu, 17 Nov 2016 15:36:54 -0300
-Subject: [PATCH] configure.ac: invert order for wayland-scanner check
-
-When cross-compiling the .pc file might point to the wrong
-wayland-scanner binary (target rather than host) resulting in a
-non-executable and wrong scanner.
-Try searching the PATH first, and if that fails fall back into
-pkg-config.

AFAICS meson *only* looks at pkg-config for wayland-scanner. It does use

dep_wl_scanner = dependency('wayland-scanner', native: true)

so in theory it should look for the host wayland-scanner rather than the target one, but I'm not sure if we set up meson in a way that it would be able to make that distinction.

[snip]

Quoted 8 lines
package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch deleted +0 -5
@@ -1,37 +0,0 @@
-From 94bceeb621e36f3188c6246a763def8695526578 Mon Sep 17 00:00:00 2001
-From: Valentin Korenblit <[email protected]>
-Date: Sat, 20 Oct 2018 10:56:23 +0200
-Subject: [PATCH] Set proper value for LIBCLC_INCLUDEDIR
-

package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch line 15

Quoted 10 lines
package/mesa3d/0003-set-LIBCLC_INCLUDEDIR.patch deleted +0 -10
-LIBCLC_INCLUDEDIR is the location where mesa3d OpenCL implementation
-will look for OpenCL "headers" on the target, when building the OpenCL
-kernels.
-
-The value returned by pkg-config for includedir is relevant when
-cross-compiling, on the build machine. But in this specific case, we
-really need a value that is valid on the target.
-
-Those headers are installed by the libclc package in /usr/share so
-that they are not removed by Buildroot target-finalize logic.

The meson infrastructure uses

'-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_pkgconfig_variable('includedir'))

which I expect will give no joy either.

[snip]

package/mesa3d/Config.in config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600 · line 132

Quoted 9 lines
package/mesa3d/Config.in +0 -1
index 3f44e94229..6070e5e039 100644
@@ -129,7 +129,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
 	select BR2_PACKAGE_LLVM_AMDGPU if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS if BR2_PACKAGE_MESA3D_LLVM
-	select BR2_PACKAGE_MESA3D_NEEDS_XA

Why does this get removed?

Quoted 24 lines
package/mesa3d/Config.in +0 -2
 	help
 	  Driver for ATI/AMD Radeon R600/R700/HD5000/HD6000 GPUs.
 
@@ -151,7 +150,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI
 	select BR2_PACKAGE_LLVM_AMDGPU
 	select BR2_PACKAGE_ELFUTILS
 	select BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	help
 	  Driver for ATI/AMD Radeon HD7000/HD8000/Rx200 GPUs.
 
@@ -184,7 +182,6 @@ config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4
 	select BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
 	select BR2_PACKAGE_MESA3D_GALLIUM_KMSRO
 	select BR2_PACKAGE_LIBDRM_VC4
-	select BR2_PACKAGE_MESA3D_NEEDS_XA
 	select BR2_PACKAGE_MESA3D_OPENGL_EGL
 	help
 	  Driver for Broadcom VC4 (rpi2/3) GPUs.
package/mesa3d/mesa3d.mk +0 -0
index 02c8a8a57a..67edab89af 100644

package/mesa3d/mesa3d.mk MESA3D_PROVIDES = · line 24

Quoted 4 lines
package/mesa3d/mesa3d.mk +1 -0
@@ -21,31 +21,22 @@ MESA3D_PROVIDES =
 MESA3D_DEPENDENCIES = \
 	host-bison \
 	host-flex \
+	host-python3-mako \

Why does this get added?

Quoted 8 lines
package/mesa3d/mesa3d.mk +0 -4
 	expat \
 	libdrm \
 	zlib
 
-# Disable assembly usage.
-MESA3D_CONF_OPTS = --disable-asm
-
-# autotools are deprecated in favour of meson, for now force autotools

package/mesa3d/mesa3d.mk MESA3D_PROVIDES = · line 31

Quoted 10 lines
package/mesa3d/mesa3d.mk +3 -7
-MESA3D_CONF_OPTS += --enable-autotools
-
-# Disable static, otherwise configure will fail with: "Cannot enable both static
-# and shared."
-ifeq ($(BR2_SHARED_STATIC_LIBS),y)
-MESA3D_CONF_OPTS += --disable-static
-endif
+MESA3D_CONF_OPTS = \
+	-Dasm=false \
+	-Dgallium-omx=disabled

Why does this get added?

Quoted 17 lines
package/mesa3d/mesa3d.mk +3 -5
 ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y)
 MESA3D_DEPENDENCIES += host-llvm llvm
-MESA3D_CONF_OPTS += \
-	--with-llvm-prefix=$(STAGING_DIR)/usr \
-	--enable-llvm-shared-libs \
-	--enable-llvm
+MESA3D_CONF_ENV += LLVM_CONFIG=$(STAGING_DIR)/usr/bin/llvm-config
+MESA3D_CONF_OPTS += -Dllvm=true
 else
 # Avoid automatic search of llvm-config
-MESA3D_CONF_OPTS += --disable-llvm
+MESA3D_CONF_OPTS += -Dllvm=false
 endif
 
 # Disable opencl-icd: OpenCL lib will be named libOpenCL instead of

package/mesa3d/mesa3d.mk endif · line 57

Quoted 5 lines
package/mesa3d/mesa3d.mk +0 -2
@@ -53,11 +44,9 @@ endif
 ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
 MESA3D_PROVIDES += libopencl
 MESA3D_DEPENDENCIES += clang libclc
-MESA3D_CONF_OPTS += --enable-opencl \
-	--disable-opencl-icd \

No equivalent of this is needed?

package/mesa3d/mesa3d.mk endif · line 47

Quoted 2 lines
package/mesa3d/mesa3d.mk +1 -1
-	--with-clang-libdir=$(STAGING_DIR)/usr/lib
+MESA3D_CONF_OPTS += -Dgallium-opencl=standalone

Can you explain what are the options, and why standalone is chosen?

Quoted 30 lines
package/mesa3d/mesa3d.mk +6 -6
 else
-MESA3D_CONF_OPTS += --disable-opencl
+MESA3D_CONF_OPTS += -Dgallium-opencl=disabled
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y)
@@ -82,17 +71,17 @@ MESA3D_DEPENDENCIES += \
 	xlib_libXxf86vm \
 	xorgproto \
 	libxcb
-MESA3D_CONF_OPTS += --enable-glx --disable-mangling
+MESA3D_CONF_OPTS += -Dglx=auto
 # quote from mesa3d configure "Building xa requires at least one non swrast gallium driver."
 ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
-MESA3D_CONF_OPTS += --enable-xa
+MESA3D_CONF_OPTS += -Dgallium-xa=true
 else
-MESA3D_CONF_OPTS += --disable-xa
+MESA3D_CONF_OPTS += -Dgallium-xa=false
 endif
 else
 MESA3D_CONF_OPTS += \
-	--disable-glx \
-	--disable-xa
+	-Dglx=disabled \
+	-Dgallium-xa=false
 endif
 
 # Drivers

package/mesa3d/mesa3d.mk MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast · line 104

Quoted 5 lines
package/mesa3d/mesa3d.mk +1 -1
@@ -112,63 +101,62 @@ MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I915)   += i915
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_I965)   += i965
 MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_NOUVEAU) += nouveau
-MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += radeon
+MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON) += r100

Please explain this in the commit message.

Quoted 26 lines
package/mesa3d/mesa3d.mk +6 -6
 # Vulkan Drivers
 MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL)   += intel
 
 ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-gallium-drivers \
-	--disable-gallium-extra-hud
+	-Dgallium-drivers= \
+	-Dgallium-extra-hud=false
 else
 MESA3D_CONF_OPTS += \
-	--enable-shared-glapi \
-	--with-gallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
-	--enable-gallium-extra-hud
+	-Dshared-glapi=true \
+	-Dgallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
+	-Dgallium-extra-hud=true
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-dri-drivers --disable-dri3
+	-Ddri-drivers= -Ddri3=false
 else
 ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE),y)
 MESA3D_DEPENDENCIES += xlib_libxshmfence

package/mesa3d/mesa3d.mk MESA3D_DRI_DRIVERS-$(BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST) += swrast · line 143

Quoted 10 lines
package/mesa3d/mesa3d.mk +2 -5
-MESA3D_CONF_OPTS += --enable-dri3
+MESA3D_CONF_OPTS += -Ddri3=true
 else
-MESA3D_CONF_OPTS += --disable-dri3
+MESA3D_CONF_OPTS += -Ddri3=false
 endif
 MESA3D_CONF_OPTS += \
-	--enable-shared-glapi \
-	--enable-driglx-direct \
-	--with-dri-driverdir=/usr/lib/dri \

No need to specify this anymore?

Regards,
Arnout

Quoted 99 lines
package/mesa3d/mesa3d.mk +22 -20
-	--with-dri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
+	-Dshared-glapi=true \
+	-Dglx-direct=true \
+	-Ddri-drivers=$(subst $(space),$(comma),$(MESA3D_DRI_DRIVERS-y))
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
 MESA3D_CONF_OPTS += \
-	--without-vulkan-drivers
+	-Dvulkan-drivers=
 else
 MESA3D_DEPENDENCIES += xlib_libxshmfence
 MESA3D_CONF_OPTS += \
-	--enable-dri3 \
-	--with-vulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
+	-Ddri3=true \
+	-Dvulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
 endif
 
 # APIs
 
 ifeq ($(BR2_PACKAGE_MESA3D_OSMESA),y)
-MESA3D_CONF_OPTS += --enable-osmesa
+MESA3D_CONF_OPTS += -Dosmesa=classic
 else
-MESA3D_CONF_OPTS += --disable-osmesa
+MESA3D_CONF_OPTS += -Dosmesa=none
 endif
 
 # Always enable OpenGL:
 #   - it is needed for GLES (mesa3d's ./configure is a bit weird)
-MESA3D_CONF_OPTS += --enable-opengl --enable-dri
+MESA3D_CONF_OPTS += -Dopengl=true -Dglx=dri
 
 # libva and mesa3d have a circular dependency
 # we do not need libva support in mesa3d, therefore disable this option
-MESA3D_CONF_OPTS += --disable-va
+MESA3D_CONF_OPTS += -Dgallium-va=false
 
 # libGL is only provided for a full xorg stack
 ifeq ($(BR2_PACKAGE_XORG7),y)
@@ -201,51 +189,51 @@ MESA3D_PLATFORMS += x11
 endif
 
 MESA3D_CONF_OPTS += \
-	--with-platforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
+	-Dplatforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 MESA3D_PROVIDES += libegl
 MESA3D_CONF_OPTS += \
-	--enable-gbm \
-	--enable-egl
+	-Dgbm=true \
+	-Degl=true
 else
 MESA3D_CONF_OPTS += \
-	--disable-egl
+	-Degl=true=false
 endif
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
 MESA3D_PROVIDES += libgles
-MESA3D_CONF_OPTS += --enable-gles1 --enable-gles2
+MESA3D_CONF_OPTS += -Dgles1=true -Dgles2=true
 else
-MESA3D_CONF_OPTS += --disable-gles1 --disable-gles2
+MESA3D_CONF_OPTS += -Dgles1=false -Dgles2=false
 endif
 
 ifeq ($(BR2_PACKAGE_XLIB_LIBXVMC),y)
 MESA3D_DEPENDENCIES += xlib_libXvMC
-MESA3D_CONF_OPTS += --enable-xvmc
+MESA3D_CONF_OPTS += -Dgallium-xvmc=true
 else
-MESA3D_CONF_OPTS += --disable-xvmc
+MESA3D_CONF_OPTS += -Dgallium-xvmc=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
-MESA3D_CONF_OPTS += --enable-libunwind
+MESA3D_CONF_OPTS += -Dlibunwind=true
 MESA3D_DEPENDENCIES += libunwind
 else
-MESA3D_CONF_OPTS += --disable-libunwind
+MESA3D_CONF_OPTS += -Dlibunwind=false
 endif
 
 ifeq ($(BR2_PACKAGE_LIBVDPAU),y)
 MESA3D_DEPENDENCIES += libvdpau
-MESA3D_CONF_OPTS += --enable-vdpau
+MESA3D_CONF_OPTS += -Dgallium-vdpau=true
 else
-MESA3D_CONF_OPTS += --disable-vdpau
+MESA3D_CONF_OPTS += -Dgallium-vdpau=false
 endif
 
 ifeq ($(BR2_PACKAGE_LM_SENSORS),y)

package/mesa3d/mesa3d.mk MESA3D_PLATFORMS += x11 · line 239

Quoted 10 lines
package/mesa3d/mesa3d.mk +3 -3
-MESA3D_CONF_OPTS += --enable-lmsensors
+MESA3D_CONF_OPTS += -Dlmsensors=true
 MESA3D_DEPENDENCIES += lm-sensors
 else
-MESA3D_CONF_OPTS += --disable-lmsensors
+MESA3D_CONF_OPTS += -Dlmsensors=false
 endif
 
-$(eval $(autotools-package))
+$(eval $(meson-package))

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot