2018-07-16 20:45:36 +02: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)
|
2013-07-20 05:24:59 +02:00
|
|
|
|
2015-03-08 11:05:33 +01:00
|
|
|
PKG_NAME="mesa"
|
2025-05-21 11:04:46 +00:00
|
|
|
PKG_VERSION="25.1.1"
|
|
|
|
|
PKG_SHA256="cf942a18b7b9e9b88524dcbf0b31fed3cde18e6d52b3375b0ab6587a14415bce"
|
2013-07-20 05:24:59 +02:00
|
|
|
PKG_LICENSE="OSS"
|
|
|
|
|
PKG_SITE="http://www.mesa3d.org/"
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_URL="https://mesa.freedesktop.org/archive/mesa-${PKG_VERSION}.tar.xz"
|
2024-07-20 03:05:45 +00:00
|
|
|
PKG_DEPENDS_HOST="toolchain:host expat:host libclc:host libdrm:host Mako:host pyyaml:host spirv-tools:host"
|
|
|
|
|
PKG_DEPENDS_TARGET="toolchain expat libdrm Mako:host pyyaml:host"
|
2018-10-22 15:06:12 +02:00
|
|
|
PKG_LONGDESC="Mesa is a 3-D graphics library with an API."
|
2018-06-01 09:36:31 -07:00
|
|
|
|
|
|
|
|
get_graphicdrivers
|
|
|
|
|
|
2023-10-27 14:17:50 +00:00
|
|
|
if [ "${DEVICE}" = "Dragonboard" ]; then
|
|
|
|
|
PKG_DEPENDS_TARGET+=" libarchive libxml2 lua54"
|
|
|
|
|
fi
|
|
|
|
|
|
2024-05-22 23:28:24 +00:00
|
|
|
PKG_MESON_OPTS_HOST="-Dglvnd=disabled \
|
|
|
|
|
-Dgallium-drivers=iris \
|
|
|
|
|
-Dgallium-vdpau=disabled \
|
|
|
|
|
-Dplatforms= \
|
|
|
|
|
-Dglx=disabled \
|
2025-05-10 07:18:34 +00:00
|
|
|
-Dvulkan-drivers= \
|
2025-05-11 23:24:15 +00:00
|
|
|
-Dshared-llvm=disabled \
|
|
|
|
|
-Dtools=panfrost"
|
2024-05-22 23:28:24 +00:00
|
|
|
|
2023-05-04 12:13:16 +00:00
|
|
|
PKG_MESON_OPTS_TARGET="-Dgallium-drivers=${GALLIUM_DRIVERS// /,} \
|
2018-06-01 09:36:31 -07:00
|
|
|
-Dgallium-extra-hud=false \
|
2024-05-22 23:28:24 +00:00
|
|
|
-Dgallium-rusticl=false \
|
2018-06-01 09:36:31 -07:00
|
|
|
-Dgallium-nine=false \
|
|
|
|
|
-Dgallium-opencl=disabled \
|
2020-03-08 14:41:04 +00:00
|
|
|
-Dshader-cache=enabled \
|
|
|
|
|
-Dshared-glapi=enabled \
|
2018-06-01 09:36:31 -07:00
|
|
|
-Dopengl=true \
|
2020-03-08 14:41:04 +00:00
|
|
|
-Dgbm=enabled \
|
|
|
|
|
-Degl=enabled \
|
|
|
|
|
-Dvalgrind=disabled \
|
|
|
|
|
-Dlibunwind=disabled \
|
|
|
|
|
-Dlmsensors=disabled \
|
2018-06-01 09:36:31 -07:00
|
|
|
-Dbuild-tests=false \
|
2023-04-13 11:34:44 +00:00
|
|
|
-Ddraw-use-llvm=false \
|
2024-05-22 23:28:24 +00:00
|
|
|
-Dmicrosoft-clc=disabled \
|
2021-03-25 02:28:51 +01:00
|
|
|
-Dosmesa=false"
|
2013-07-20 05:24:59 +02:00
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if [ "${DISPLAYSERVER}" = "x11" ]; then
|
2022-12-15 15:40:16 +01:00
|
|
|
PKG_DEPENDS_TARGET+=" xorgproto libXext libXdamage libXfixes libXxf86vm libxcb libX11 libxshmfence libXrandr"
|
2017-05-19 08:26:52 -07:00
|
|
|
export X11_INCLUDES=
|
2022-12-15 15:40:16 +01:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dplatforms=x11 \
|
|
|
|
|
-Dglx=dri"
|
2021-11-24 17:25:54 +01:00
|
|
|
elif [ "${DISPLAYSERVER}" = "wl" ]; then
|
2022-12-15 15:40:16 +01:00
|
|
|
PKG_DEPENDS_TARGET+=" wayland wayland-protocols"
|
|
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dplatforms=wayland \
|
|
|
|
|
-Dglx=disabled"
|
2017-05-19 08:26:52 -07:00
|
|
|
else
|
2022-12-15 15:40:16 +01:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dplatforms="" \
|
|
|
|
|
-Dglx=disabled"
|
|
|
|
|
fi
|
|
|
|
|
|
2024-05-22 23:28:24 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "etnaviv"; then
|
|
|
|
|
PKG_DEPENDS_TARGET+=" pycparser:host"
|
|
|
|
|
fi
|
|
|
|
|
|
2025-05-11 23:24:15 +00:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "(iris|panfrost)"; then
|
2024-05-22 23:28:24 +00:00
|
|
|
PKG_DEPENDS_TARGET+=" mesa:host"
|
2025-05-11 23:24:15 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dmesa-clc=system -Dprecomp-compiler=system"
|
2025-05-08 16:41:18 +00:00
|
|
|
fi
|
|
|
|
|
|
2025-04-05 08:28:15 +03:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "(nvidia|nvidia-ng)" ||
|
2025-05-21 17:46:19 +02:00
|
|
|
[ "${OPENGL_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" != "x11" ]; then
|
2022-12-15 15:40:16 +01:00
|
|
|
PKG_DEPENDS_TARGET+=" libglvnd"
|
2024-05-22 23:28:24 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dglvnd=enabled"
|
2022-12-15 15:40:16 +01:00
|
|
|
else
|
2024-05-22 23:28:24 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dglvnd=disabled"
|
2017-05-19 08:26:52 -07:00
|
|
|
fi
|
|
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if [ "${LLVM_SUPPORT}" = "yes" ]; then
|
|
|
|
|
PKG_DEPENDS_TARGET+=" elfutils llvm"
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dllvm=enabled"
|
2013-07-20 05:24:59 +02:00
|
|
|
else
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dllvm=disabled"
|
2013-07-20 05:24:59 +02:00
|
|
|
fi
|
|
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if [ "${VDPAU_SUPPORT}" = "yes" -a "${DISPLAYSERVER}" = "x11" ]; then
|
|
|
|
|
PKG_DEPENDS_TARGET+=" libvdpau"
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=enabled"
|
2013-07-20 05:24:59 +02:00
|
|
|
else
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-vdpau=disabled"
|
2013-07-20 05:24:59 +02:00
|
|
|
fi
|
|
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if [ "${VAAPI_SUPPORT}" = "yes" ] && listcontains "${GRAPHIC_DRIVERS}" "(r600|radeonsi)"; then
|
|
|
|
|
PKG_DEPENDS_TARGET+=" libva"
|
2022-12-22 15:47:42 +01:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=enabled \
|
2025-04-08 09:59:46 +00:00
|
|
|
-Dvideo-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec"
|
2018-01-08 15:40:16 -08:00
|
|
|
else
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-va=disabled"
|
2018-01-08 15:40:16 -08:00
|
|
|
fi
|
|
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if listcontains "${GRAPHIC_DRIVERS}" "vmware"; then
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=enabled"
|
2018-06-01 09:36:31 -07:00
|
|
|
else
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgallium-xa=disabled"
|
2018-06-01 09:36:31 -07:00
|
|
|
fi
|
2016-01-15 23:30:54 +01:00
|
|
|
|
2019-09-02 23:40:04 +02:00
|
|
|
if [ "${OPENGLES_SUPPORT}" = "yes" ]; then
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgles1=disabled -Dgles2=enabled"
|
2016-04-11 16:00:48 +02:00
|
|
|
else
|
2020-03-08 14:41:04 +00:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dgles1=disabled -Dgles2=disabled"
|
2016-04-11 16:00:48 +02:00
|
|
|
fi
|
2017-05-19 08:26:52 -07:00
|
|
|
|
2021-11-17 14:42:39 +01:00
|
|
|
if [ "${VULKAN_SUPPORT}" = "yes" ]; then
|
2025-01-29 20:06:19 +01:00
|
|
|
PKG_DEPENDS_TARGET+=" ${VULKAN} vulkan-tools ply:host"
|
2021-11-17 14:42:39 +01:00
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dvulkan-drivers=${VULKAN_DRIVERS_MESA// /,}"
|
|
|
|
|
else
|
|
|
|
|
PKG_MESON_OPTS_TARGET+=" -Dvulkan-drivers="
|
|
|
|
|
fi
|
2024-05-22 23:28:24 +00:00
|
|
|
|
|
|
|
|
makeinstall_host() {
|
2025-05-11 23:24:15 +00:00
|
|
|
host_files="src/compiler/clc/mesa_clc src/compiler/spirv/vtn_bindgen2 src/panfrost/clc/panfrost_compile"
|
2025-05-08 16:41:18 +00:00
|
|
|
|
2025-05-11 05:49:56 +00:00
|
|
|
if listcontains "${BUILD_REUSABLE}" "(all|mesa:host)"; then
|
|
|
|
|
# Build the reusable mesa:host for both local and to be added to a GitHub release
|
|
|
|
|
strip ${host_files}
|
|
|
|
|
upx --lzma ${host_files}
|
|
|
|
|
|
|
|
|
|
REUSABLE_SOURCES="${SOURCES}/mesa-reusable"
|
|
|
|
|
MESA_HOST="mesa-reusable-${OS_VERSION}-${PKG_VERSION}"
|
|
|
|
|
REUSABLE_SOURCE_NAME=${MESA_HOST}-${MACHINE_HARDWARE_NAME}.tar
|
|
|
|
|
|
|
|
|
|
mkdir -p "${TARGET_IMG}"
|
|
|
|
|
|
|
|
|
|
tar cf ${TARGET_IMG}/${REUSABLE_SOURCE_NAME} --transform='s|.*/||' ${host_files}
|
|
|
|
|
sha256sum ${TARGET_IMG}/${REUSABLE_SOURCE_NAME} | \
|
|
|
|
|
cut -d" " -f1 >${TARGET_IMG}/${REUSABLE_SOURCE_NAME}.sha256
|
|
|
|
|
|
|
|
|
|
if listcontains "${BUILD_REUSABLE}" "save-local"; then
|
|
|
|
|
mkdir -p "${REUSABLE_SOURCES}"
|
|
|
|
|
cp -p ${TARGET_IMG}/${REUSABLE_SOURCE_NAME} ${REUSABLE_SOURCES}
|
|
|
|
|
cp -p ${TARGET_IMG}/${REUSABLE_SOURCE_NAME}.sha256 ${REUSABLE_SOURCES}
|
|
|
|
|
echo "save-local" >${REUSABLE_SOURCES}/${REUSABLE_SOURCE_NAME}.url
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2025-05-11 23:24:15 +00:00
|
|
|
mkdir -p "${TOOLCHAIN}/bin"
|
|
|
|
|
cp -a ${host_files} "${TOOLCHAIN}/bin"
|
2024-05-22 23:28:24 +00:00
|
|
|
}
|