mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #10049 from heitbaum/mesa-host
Allow build of compiled mesa reusable host tools
This commit is contained in:
commit
485fb56d5e
@ -270,3 +270,14 @@
|
||||
# for a list of additional drivers see packages/linux-driver-addons
|
||||
# Space separated list is supported,
|
||||
DRIVER_ADDONS="crazycat digital_devices dvb-latest"
|
||||
|
||||
# should reusable host tools be built:
|
||||
# Space separated list is supported,
|
||||
# list of options are:
|
||||
# - all (for all host tools to be built)
|
||||
# - mesa:host
|
||||
# - save-local (saves a copy in sources/reusable/<package>
|
||||
BUILD_REUSABLE=""
|
||||
|
||||
# should reusable host tools be used (yes / no)
|
||||
USE_REUSABLE="no"
|
||||
|
20
packages/graphics/mesa-reusable/package.mk
Normal file
20
packages/graphics/mesa-reusable/package.mk
Normal file
@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
# Copyright (C) 2025-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="mesa-reusable"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_SITE="http://www.mesa3d.org/"
|
||||
PKG_DEPENDS_HOST="toolchain:host"
|
||||
PKG_LONGDESC="Mesa is a 3-D graphics library with an API."
|
||||
PKG_TOOLCHAIN="manual"
|
||||
|
||||
MESA_VERSION=$(get_pkg_version mesa)
|
||||
PKG_VERSION="${OS_VERSION}-${MESA_VERSION}"
|
||||
PKG_SOURCE_NAME="${PKG_NAME}-${PKG_VERSION}-${MACHINE_HARDWARE_NAME}.tar"
|
||||
PKG_URL="https://github.com/LibreELEC/mesa-reusable/releases/download/${PKG_VERSION}/${PKG_SOURCE_NAME}"
|
||||
PKG_SHA256="$(curl --fail --connect-timeout 30 --retry 3 --location --max-redirs 5 ${PKG_URL}.sha256)"
|
||||
|
||||
unpack() {
|
||||
mkdir -p ${TOOLCHAIN}/bin
|
||||
tar -xf ${SOURCES}/${PKG_NAME}/${PKG_SOURCE_NAME} -C ${TOOLCHAIN}/bin
|
||||
}
|
@ -64,7 +64,11 @@ if listcontains "${GRAPHIC_DRIVERS}" "etnaviv"; then
|
||||
fi
|
||||
|
||||
if listcontains "${GRAPHIC_DRIVERS}" "(iris|panfrost)"; then
|
||||
PKG_DEPENDS_TARGET+=" mesa:host"
|
||||
if [ "${USE_REUSABLE}" = "yes" ]; then
|
||||
PKG_DEPENDS_TARGET+=" mesa-reusable"
|
||||
else
|
||||
PKG_DEPENDS_TARGET+=" mesa:host"
|
||||
fi
|
||||
PKG_MESON_OPTS_TARGET+=" -Dmesa-clc=system -Dprecomp-compiler=system"
|
||||
fi
|
||||
|
||||
@ -120,6 +124,29 @@ fi
|
||||
makeinstall_host() {
|
||||
host_files="src/compiler/clc/mesa_clc src/compiler/spirv/vtn_bindgen2 src/panfrost/clc/panfrost_compile"
|
||||
|
||||
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
|
||||
|
||||
mkdir -p "${TOOLCHAIN}/bin"
|
||||
cp -a ${host_files} "${TOOLCHAIN}/bin"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user