mesa: host: enable build of reusable tools

strip the tools and apply upx
create a tar file of the reusable mesa:host tools
This commit is contained in:
Rudi Heitbaum 2025-05-11 05:49:56 +00:00
parent fe32a44be5
commit 5b2ceba7f2
2 changed files with 31 additions and 0 deletions

View File

@ -270,3 +270,11 @@
# for a list of additional drivers see packages/linux-driver-addons # for a list of additional drivers see packages/linux-driver-addons
# Space separated list is supported, # Space separated list is supported,
DRIVER_ADDONS="crazycat digital_devices dvb-latest" 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=""

View File

@ -120,6 +120,29 @@ fi
makeinstall_host() { makeinstall_host() {
host_files="src/compiler/clc/mesa_clc src/compiler/spirv/vtn_bindgen2 src/panfrost/clc/panfrost_compile" 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" mkdir -p "${TOOLCHAIN}/bin"
cp -a ${host_files} "${TOOLCHAIN}/bin" cp -a ${host_files} "${TOOLCHAIN}/bin"
} }