123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- ################################################################################
- #
- # mesa3d
- #
- ################################################################################
- # When updating the version, please also update mesa3d-headers
- MESA3D_VERSION = 25.1.6
- MESA3D_SOURCE = mesa-$(MESA3D_VERSION).tar.xz
- MESA3D_SITE = https://archive.mesa3d.org
- MESA3D_LICENSE = MIT, SGI, Khronos
- MESA3D_LICENSE_FILES = \
- docs/license.rst \
- licenses/MIT \
- licenses/SGI-B-2.0
- MESA3D_CPE_ID_VENDOR = mesa3d
- MESA3D_CPE_ID_PRODUCT = mesa
- MESA3D_INSTALL_STAGING = YES
- MESA3D_PROVIDES =
- MESA3D_DEPENDENCIES = \
- host-bison \
- host-flex \
- host-python-mako \
- host-python-pyyaml \
- expat \
- libdrm \
- zlib
- MESA3D_CONF_OPTS = \
- -Dmicrosoft-clc=disabled
- ifeq ($(BR2_PACKAGE_MESA3D_DRIVER)$(BR2_PACKAGE_XORG7),yy)
- MESA3D_DEPENDENCIES += xlib_libxshmfence
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_LLVM),y)
- MESA3D_DEPENDENCIES += host-llvm llvm
- MESA3D_MESON_EXTRA_BINARIES += llvm-config='$(STAGING_DIR)/usr/bin/llvm-config'
- MESA3D_CONF_OPTS += -Dllvm=enabled
- ifeq ($(BR2_PACKAGE_LLVM_RTTI),y)
- MESA3D_CONF_OPTS += -Dcpp_rtti=true
- else
- MESA3D_CONF_OPTS += -Dcpp_rtti=false
- endif
- else
- # Avoid automatic search of llvm-config
- MESA3D_CONF_OPTS += -Dllvm=disabled
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
- MESA3D_PROVIDES += libopencl
- MESA3D_DEPENDENCIES += clang libclc
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_RUSTICL),y)
- MESA3D_DEPENDENCIES += \
- host-rustc \
- host-rust-bindgen \
- spirv-tools \
- spirv-llvm-translator \
- opencl-icd-loader
- # rust_std is defined here to workaround a known meson bug. See:
- # https://docs.mesa3d.org/rusticl.html#known-issues
- # https://github.com/mesonbuild/meson/issues/10664
- MESA3D_CONF_OPTS += \
- -Dgallium-rusticl=true \
- -Drust_std=2021 \
- -Dmesa-clc-bundle-headers=enabled
- MESA3D_MESON_EXTRA_BINARIES += \
- rust=['$(HOST_DIR)/bin/rustc','--target=$(RUSTC_TARGET_NAME)'] \
- rust_ld='$(TARGET_CROSS)gcc'
- else
- MESA3D_CONF_OPTS += -Dgallium-rusticl=false
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y)
- MESA3D_DEPENDENCIES += elfutils
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y)
- # Disable-mangling not yet supported by meson build system.
- # glx:
- # dri : dri based GLX requires at least one DRI driver
- # xlib : xlib conflicts with any dri driver
- # Always enable glx-direct; without it, many GLX applications don't work.
- MESA3D_CONF_OPTS += \
- -Dglx=dri \
- -Dglx-direct=true
- ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_XA),y)
- MESA3D_CONF_OPTS += -Dgallium-xa=enabled
- else
- MESA3D_CONF_OPTS += -Dgallium-xa=disabled
- endif
- else
- MESA3D_CONF_OPTS += \
- -Dglx=disabled \
- -Dgallium-xa=disabled
- endif
- ifeq ($(BR2_ARM_CPU_HAS_NEON),y)
- MESA3D_CONF_OPTS += -Dgallium-vc4-neon=auto
- else
- MESA3D_CONF_OPTS += -Dgallium-vc4-neon=disabled
- endif
- # Drivers
- #Gallium Drivers
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_CROCUS) += crocus
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV) += etnaviv
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_FREEDRENO) += freedreno
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_I915) += i915
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS) += iris
- HOST_MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_IRIS) += iris
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LIMA) += lima
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_LLVMPIPE) += llvmpipe
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU) += nouveau
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST) += panfrost
- HOST_MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST) += panfrost
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R300) += r300
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600) += r600
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_RADEONSI) += radeonsi
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA) += svga
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE) += softpipe
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_TEGRA) += tegra
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D) += v3d
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4) += vc4
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL) += virgl
- MESA3D_GALLIUM_DRIVERS-$(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ZINK) += zink
- # Vulkan Drivers
- MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_BROADCOM) += broadcom
- MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_IMAGINATION) += imagination-experimental
- MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL) += intel
- MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_SWRAST) += swrast
- MESA3D_VULKAN_DRIVERS-$(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_VIRTIO) += virtio
- ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER),)
- MESA3D_CONF_OPTS += \
- -Dgallium-drivers= \
- -Dgallium-extra-hud=false
- else
- MESA3D_CONF_OPTS += \
- -Dgallium-drivers=$(subst $(space),$(comma),$(MESA3D_GALLIUM_DRIVERS-y)) \
- -Dgallium-extra-hud=true
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_ETNAVIV),y)
- MESA3D_DEPENDENCIES += host-python-pycparser
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER_INTEL),y)
- MESA3D_DEPENDENCIES += host-python-ply
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_PRECOMP_COMPILER),y)
- MESA3D_CONF_OPTS += -Dmesa-clc=system -Dprecomp-compiler=system
- MESA3D_DEPENDENCIES += host-mesa3d spirv-llvm-translator spirv-tools
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),)
- MESA3D_CONF_OPTS += \
- -Dvulkan-drivers=
- else
- MESA3D_DEPENDENCIES += host-python-glslang
- MESA3D_CONF_OPTS += \
- -Dvulkan-drivers=$(subst $(space),$(comma),$(MESA3D_VULKAN_DRIVERS-y))
- endif
- # APIs
- # Always enable OpenGL:
- # - Building OpenGL ES without OpenGL is not supported, so always keep opengl enabled.
- MESA3D_CONF_OPTS += -Dopengl=true
- # libva and mesa3d have a circular dependency
- # we do not need libva support in mesa3d, therefore disable this option
- MESA3D_CONF_OPTS += -Dgallium-va=disabled
- # libGL is only provided for a full xorg stack, without libglvnd
- ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y)
- MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libgl)
- else
- define MESA3D_REMOVE_OPENGL_HEADERS
- rm -rf $(STAGING_DIR)/usr/include/GL/
- endef
- MESA3D_POST_INSTALL_STAGING_HOOKS += MESA3D_REMOVE_OPENGL_HEADERS
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_X11),y)
- MESA3D_DEPENDENCIES += \
- xlib_libX11 \
- xlib_libXext \
- xlib_libXdamage \
- xlib_libXfixes \
- xlib_libXrandr \
- xlib_libXxf86vm \
- xorgproto \
- libxcb
- MESA3D_PLATFORMS += x11
- endif
- ifeq ($(BR2_PACKAGE_WAYLAND),y)
- MESA3D_DEPENDENCIES += wayland wayland-protocols
- MESA3D_PLATFORMS += wayland
- endif
- MESA3D_CONF_OPTS += \
- -Dplatforms=$(subst $(space),$(comma),$(MESA3D_PLATFORMS))
- ifeq ($(BR2_PACKAGE_MESA3D_GBM),y)
- MESA3D_CONF_OPTS += \
- -Dgbm=enabled
- else
- MESA3D_CONF_OPTS += \
- -Dgbm=disabled
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
- MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libegl)
- MESA3D_CONF_OPTS += \
- -Degl=enabled
- else
- MESA3D_CONF_OPTS += \
- -Degl=disabled
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_ES),y)
- MESA3D_PROVIDES += $(if $(BR2_PACKAGE_LIBGLVND),,libgles)
- MESA3D_CONF_OPTS += -Dgles1=enabled -Dgles2=enabled
- else
- MESA3D_CONF_OPTS += -Dgles1=disabled -Dgles2=disabled
- endif
- ifeq ($(BR2_PACKAGE_VALGRIND),y)
- MESA3D_CONF_OPTS += -Dvalgrind=enabled
- MESA3D_DEPENDENCIES += valgrind
- else
- MESA3D_CONF_OPTS += -Dvalgrind=disabled
- endif
- ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
- MESA3D_CONF_OPTS += -Dlibunwind=enabled
- MESA3D_DEPENDENCIES += libunwind
- else
- MESA3D_CONF_OPTS += -Dlibunwind=disabled
- endif
- ifeq ($(BR2_PACKAGE_MESA3D_VDPAU),y)
- MESA3D_DEPENDENCIES += libvdpau
- MESA3D_CONF_OPTS += -Dgallium-vdpau=enabled
- else
- MESA3D_CONF_OPTS += -Dgallium-vdpau=disabled
- endif
- ifeq ($(BR2_PACKAGE_LM_SENSORS),y)
- MESA3D_CONF_OPTS += -Dlmsensors=enabled
- MESA3D_DEPENDENCIES += lm-sensors
- else
- MESA3D_CONF_OPTS += -Dlmsensors=disabled
- endif
- ifeq ($(BR2_PACKAGE_ZSTD),y)
- MESA3D_CONF_OPTS += -Dzstd=enabled
- MESA3D_DEPENDENCIES += zstd
- else
- MESA3D_CONF_OPTS += -Dzstd=disabled
- endif
- MESA3D_CFLAGS = $(TARGET_CFLAGS)
- # m68k needs 32-bit offsets in switch tables to build
- ifeq ($(BR2_m68k),y)
- MESA3D_CFLAGS += -mlong-jump-table-offsets
- endif
- ifeq ($(BR2_PACKAGE_LIBGLVND),y)
- ifneq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX)$(BR2_PACKAGE_MESA3D_OPENGL_EGL),)
- MESA3D_DEPENDENCIES += libglvnd
- MESA3D_CONF_OPTS += -Dglvnd=enabled
- else
- MESA3D_CONF_OPTS += -Dglvnd=disabled
- endif
- else
- MESA3D_CONF_OPTS += -Dglvnd=disabled
- endif
- HOST_MESA3D_CONF_OPTS = \
- -Dglvnd=disabled \
- -Dgallium-drivers=$(subst $(space),$(comma),$(HOST_MESA3D_GALLIUM_DRIVERS-y)) \
- -Dgallium-vdpau=disabled \
- -Dinstall-mesa-clc=true \
- -Dmesa-clc=enabled \
- -Dplatforms= \
- -Dprecomp-compiler=enabled \
- -Dglx=disabled \
- -Dvulkan-drivers=""
- ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST),y)
- HOST_MESA3D_CONF_OPTS += -Dtools=panfrost
- endif
- HOST_MESA3D_DEPENDENCIES = \
- host-libclc \
- host-libdrm \
- host-python-mako \
- host-python-pyyaml \
- host-spirv-tools
- ifeq ($(BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST),y)
- HOST_MESA3D_INSTALL_PANFROST_COMPILE = \
- $(INSTALL) -D -m 0755 $(@D)/buildroot-build/src/panfrost/clc/panfrost_compile $(HOST_DIR)/bin/panfrost_compile
- endif
- define HOST_MESA3D_INSTALL_CMDS
- $(INSTALL) -D -m 0755 $(@D)/buildroot-build/src/compiler/clc/mesa_clc $(HOST_DIR)/bin/mesa_clc
- $(INSTALL) -D -m 0755 $(@D)/buildroot-build/src/compiler/spirv/vtn_bindgen2 $(HOST_DIR)/bin/vtn_bindgen2
- $(HOST_MESA3D_INSTALL_PANFROST_COMPILE)
- endef
- $(eval $(meson-package))
- $(eval $(host-meson-package))
|