meson: use summary()
I was annoyed by the unaligned lines in the meson configuration summary. Rather than just fixing up all the white space in the lines I thought we should try mesons builtin summary().
Here is the original:
Message: Configuration summary:
prefix: /usr/local
libdir: lib/x86_64-linux-gnu
includedir: include
OpenGL: yes (ES1: yes ES2: yes)
OSMesa: no
DRI platform: drm
DRI drivers: i915 i965 r100 r200 nouveau
DRI driver dir: /usr/local/lib/x86_64-linux-gnu/dri
GLX: DRI-based
EGL: yes
EGL drivers: builtin:egl_dri2 builtin:egl_dri3
EGL/Vulkan/VL platforms: x11 wayland surfaceless drm surfaceless drm
GBM: yes
GBM backends path: /usr/local/lib/x86_64-linux-gnu/gbm
Vulkan drivers: amd intel swrast
Vulkan ICD dir: share/vulkan/icd.d
llvm: yes
llvm-version: 13.0.0
Gallium drivers: r300 r600 radeonsi nouveau virgl svga swrast iris
Gallium st: mesa xa va
HUD lmsensors: no
Shared-glapi: yes
Perfetto: no
Perfetto ds: auto
First I tried a direct conversion but it is not easy to add blank lines meson summary. The output is a bit compact. YES/NO are in capital and colored green/red.
Configuration summary
prefix : /usr/local
libdir : lib/x86_64-linux-gnu
includedir : include
OpenGL : YES
ES1 : YES
ES2 : YES
OSMesa : NO
DRI platform : drm
DRI drivers : i915 i965 r100 r200 nouveau
DRI driver dir : /usr/local/lib/x86_64-linux-gnu/dri
GLX : DRI-based
EGL : YES
EGL drivers : builtin:egl_dri2 builtin:egl_dri3
EGL/Vulkan/VL platforms: x11 wayland surfaceless drm surfaceless drm
GBM : YES
GBM backends path : /usr/local/lib/x86_64-linux-gnu/gbm
Vulkan drivers : amd intel swrast
Vulkan ICD dir : share/vulkan/icd.d
llvm : YES
llvm-version : 13.0.0
Gallium : YES
Gallium drivers : r300 r600 radeonsi nouveau virgl svga swrast iris
Gallium st : mesa xa va
HUD lmsensors : NO
Shared-glapi : YES
Perfetto : NO
Perfetto ds : auto
Lastly in the second commit individual sections are used:
Directories
prefix : /usr/local
libdir : lib/x86_64-linux-gnu
includedir : include
OpenGL
OpenGL : YES
ES1 : YES
ES2 : YES
OSMesa
OSMesa : NO
DRI
Platform : drm
Drivers : i915 i965 r100 r200 nouveau
Driver dir : /usr/local/lib/x86_64-linux-gnu/dri
GLX
GLX : DRI-based
EGL
EGL : YES
Drivers : builtin:egl_dri2 builtin:egl_dri3
EGL/Vulkan/VL platforms: x11 wayland surfaceless drm surfaceless drm
GBM
GBM : YES
Backends path : /usr/local/lib/x86_64-linux-gnu/gbm
Vulkan
Drivers : amd intel swrast
ICD dir : share/vulkan/icd.d
LLVM
llvm : YES
llvm-version : 13.0.0
Gallium
Gallium : YES
Drivers : r300 r600 radeonsi nouveau virgl svga swrast iris
st : mesa xa va
Misc
HUD lmsensors : NO
Shared-glapi : YES
Perfetto
Perfetto : NO
Perfetto ds : auto
With summary() we get the alignment for free and it is easy to work with as it takes bools, lists, etc so we save some manual conversion.
Using the summary does require meson 0.53. Using the list_sep options requires 0.54 but should just produce a warning on 0.53. Without list_sep each value is printed on a separate line which makes a long summary. In versions before 0.57 the keys are right aligned so the output looks different there as well.