distribution/packages/graphics/mesa/package.mk

102 lines
3.6 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-03-21 16:54:21 +00:00
PKG_PATCH_DIRS+=" ${DEVICE}"
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"
;;
RK3399) #Upstream Mesa appears to be broken on the RK3399 build currently
PKG_VERSION="22.3.7"
PKG_SHA256="894ce2f4a1c2e76177cdd2284620192d0da3066b243eec2fbb1d7cf37f13042c"
PKG_URL="https://mesa.freedesktop.org/archive/mesa-${PKG_VERSION}.tar.xz"
;;
2023-01-09 06:26:27 +00:00
*)
2023-08-18 12:43:56 +00:00
PKG_VERSION="23.1.6"
PKG_SHA256="f4c7fd8e7b472a88da7d83e9a48f6f3bd17d4ea2cc4386f7231b796f3964157a"
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
PKG_MESON_OPTS_TARGET="-Dgallium-drivers=${GALLIUM_DRIVERS// /,} \
2022-02-05 14:23:32 +00:00
-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