distribution/packages/graphics/mesa/package.mk

97 lines
3.3 KiB
Makefile
Raw Normal View History

2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="mesa"
PKG_LICENSE="OSS"
PKG_DEPENDS_TARGET="toolchain expat libdrm Mako:host"
PKG_LONGDESC="Mesa is a 3-D graphics library with an API."
2022-06-30 10:28:25 +00:00
PKG_TOOLCHAIN="meson"
2023-01-09 06:26:27 +00:00
case ${DEVICE} in
RK35*)
2023-01-09 06:26:27 +00:00
PKG_VERSION="120202c675749c5ef81ae4c8cdc30019b4de08f4"
PKG_SITE="https://gitlab.com/panfork/mesa"
PKG_URL="${PKG_SITE}.git"
PKG_GIT_CLONE_BRANCH="csf"
;;
*)
2023-02-23 20:23:29 +00:00
PKG_VERSION="22.3.6"
PKG_SHA256="4ec8ec65dbdb1ee9444dba72970890128a19543a58cf05931bd6f54f124e117f"
2023-02-10 15:52:46 +00:00
PKG_SITE="http://www.mesa3d.org/"
PKG_URL="https://mesa.freedesktop.org/archive/mesa-${PKG_VERSION}.tar.xz"
2023-01-09 06:26:27 +00:00
;;
esac
2022-02-05 14:23:32 +00:00
get_graphicdrivers
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET="-Ddri-drivers= \
2022-02-05 14:23:32 +00:00
-Dgallium-drivers=${GALLIUM_DRIVERS// /,} \
-Dgallium-extra-hud=false \
-Dgallium-omx=disabled \
-Dgallium-nine=false \
-Dgallium-opencl=disabled \
2022-06-30 10:28:25 +00:00
-Dshader-cache=enabled \
-Dshared-glapi=enabled \
2022-02-05 14:23:32 +00:00
-Dopengl=true \
2022-06-30 10:28:25 +00:00
-Dgbm=enabled \
-Degl=enabled \
-Dlibunwind=disabled \
-Dlmsensors=disabled \
2022-02-05 14:23:32 +00:00
-Dbuild-tests=false \
-Dselinux=false \
2022-06-30 10:28:25 +00:00
-Dosmesa=false"
2022-02-05 14:23:32 +00:00
2022-06-30 10:28:25 +00:00
if [ "${DISPLAYSERVER}" = "x11" ]; then
PKG_DEPENDS_TARGET+=" xorgproto libXext libXdamage libXfixes libXxf86vm libxcb libX11 libxshmfence libXrandr libglvnd glfw"
2022-02-05 14:23:32 +00:00
export X11_INCLUDES=
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dplatforms=x11 -Ddri3=enabled -Dglx=dri -Dglvnd=true"
elif [ "${DISPLAYSERVER}" = "wl" ]; then
2022-09-13 14:00:07 +00:00
PKG_DEPENDS_TARGET+=" wayland wayland-protocols libglvnd glfw"
2022-09-03 00:15:55 +00:00
PKG_MESON_OPTS_TARGET+=" -Dplatforms=wayland,x11 -Ddri3=enabled -Dglx=dri -Dglvnd=true"
PKG_DEPENDS_TARGET+=" xorgproto libXext libXdamage libXfixes libXxf86vm libxcb libX11 libxshmfence libXrandr libglvnd"
2022-09-03 00:15:55 +00:00
export X11_INCLUDES=
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dplatforms="" -Ddri3=disabled -Dglx=disabled -Dglvnd=false"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if [ "${LLVM_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" elfutils llvm"
PKG_MESON_OPTS_TARGET+=" -Dllvm=enabled"
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dllvm=disabled"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if [ "${VDPAU_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" = "x11" ]; then
PKG_DEPENDS_TARGET+=" libvdpau"
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=enabled"
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=disabled"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if [ "${VAAPI_SUPPORT}" = "yes" ] && listcontains "${GRAPHIC_DRIVERS}" "(r600|radeonsi)"; then
PKG_DEPENDS_TARGET+=" libva"
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=enabled"
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=disabled"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if listcontains "${GRAPHIC_DRIVERS}" "vmware"; then
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=enabled"
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=disabled"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if [ "${OPENGLES_SUPPORT}" = "yes" ]; then
2022-09-01 00:32:15 +00:00
PKG_MESON_OPTS_TARGET+=" -Dgles1=enabled -Dgles2=enabled"
2022-02-05 14:23:32 +00:00
else
2022-06-30 10:28:25 +00:00
PKG_MESON_OPTS_TARGET+=" -Dgles1=disabled -Dgles2=disabled"
2022-02-05 14:23:32 +00:00
fi
2022-06-30 10:28:25 +00:00
if [ "${VULKAN_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET+=" ${VULKAN} vulkan-tools"
PKG_MESON_OPTS_TARGET+=" -Dvulkan-drivers=${VULKAN_DRIVERS_MESA// /,}"
else
PKG_MESON_OPTS_TARGET+=" -Dvulkan-drivers="
fi