From d91f0b4823286338f1c57b4fa74403f97e796814 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 7 Dec 2024 17:56:56 +0000 Subject: [PATCH] mesa: fix dependencies and always prefer LLVM subproject Make sure build dependency to mesa/host is set for x86 and x86/64 builds, add missing dependency on Python ply and make sure to always prefer LLVM subproject to avoid picking up LLVM from the build host (which may not match SPIR-V converter tool version). Signed-off-by: Daniel Golle --- libs/mesa/Makefile | 17 +++---- libs/mesa/host-pip-requirements.txt | 3 +- .../100-use-llvm-subproject-vars.patch | 44 ++++++++++++++++++- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/libs/mesa/Makefile b/libs/mesa/Makefile index a5b2379..af5936a 100644 --- a/libs/mesa/Makefile +++ b/libs/mesa/Makefile @@ -12,8 +12,12 @@ PKG_MAINTAINER:=Daniel Golle PKG_LICENSE:=BSD-3-Clause PKG_INSTALL:=1 -PKG_BUILD_DEPENDS:=glslang/host python3/host libva -HOST_BUILD_DEPENDS:=python3/host spirv-tools/host + +# arc, powerpc and powerpc64 LLVM builds are currently broken, but powerpc{,64} would support JIT in theory +LLVM_SUPPORTED:=(aarch64||arm||i386||i686||loongarch64||mips||mipsel||mips64||mips64el||riscv64||x86_64) + +PKG_BUILD_DEPENDS:=glslang/host python3/host libva (x86_64||i386||i686):mesa/host $(LLVM_SUPPORTED):llvm +HOST_BUILD_DEPENDS:=python3/host spirv-tools/host llvm PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_libosmesa \ @@ -30,21 +34,12 @@ PYTHON3_PKG_BUILD:=0 MESON_USE_STAGING_PYTHON:=1 HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:=./host-pip-requirements.txt -LLVM_SUPPORTED:=(aarch64||arm||i386||i686||loongarch64||mips||mipsel||mips64||mips64el||riscv64||x86_64) -# arc, powerpc and powerpc64 LLVM builds are currently broken, but powerpc{,64} would support JIT in theory - ifneq ($(CONFIG_aarch64)$(CONFIG_arm)$(CONFIG_i386)$(CONFIG_i686)$(CONFIG_loongarch64)$(CONFIG_mips)$(CONFIG_mipsel)$(CONFIG_mips64)$(CONFIG_mips64el)$(CONFIG_riscv64)$(CONFIG_x86_64),) -PKG_BUILD_DEPENDS+=llvm -HOST_BUILD_DEPENDS+=llvm MESA_USE_LLVM:=1 else MESA_USE_LLVM:= endif -ifneq ($(CONFIG_x86_64)$(CONFIG_i386)$(CONFIG_i686),) -PKG_BUILD_DEPENDS+=mesa/host -endif - include $(TOPDIR)/feeds/packages/lang/rust/rust-values.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk diff --git a/libs/mesa/host-pip-requirements.txt b/libs/mesa/host-pip-requirements.txt index b4b00f5..4eb26d8 100644 --- a/libs/mesa/host-pip-requirements.txt +++ b/libs/mesa/host-pip-requirements.txt @@ -1,4 +1,5 @@ Mako==1.2.0 --hash=sha256:9a7c7e922b87db3686210cf49d5d767033a41d4010b284e747682c92bddd8b39 MarkupSafe==2.1.1 --hash=sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b -PyYAML==6.0.1 --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 +ply==3.11 --hash=sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 pycparser==2.21 --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 +PyYAML==6.0.1 --hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 diff --git a/libs/mesa/patches/100-use-llvm-subproject-vars.patch b/libs/mesa/patches/100-use-llvm-subproject-vars.patch index 644d581..4cd6ec8 100644 --- a/libs/mesa/patches/100-use-llvm-subproject-vars.patch +++ b/libs/mesa/patches/100-use-llvm-subproject-vars.patch @@ -1,6 +1,48 @@ --- a/meson.build +++ b/meson.build -@@ -1856,7 +1856,11 @@ endif +@@ -1743,21 +1743,26 @@ _llvm = get_option('llvm') + dep_llvm = null_dep + with_llvm = false + if _llvm.allowed() +- dep_llvm = dependency( +- 'llvm', +- method : host_machine.system() == 'windows' ? 'auto' : 'config-tool', +- version : _llvm_version, +- modules : llvm_modules, +- optional_modules : llvm_optional_modules, +- required : ( +- with_amd_vk or with_gallium_radeonsi or with_gallium_clover or with_clc +- or _llvm.enabled() +- ), +- static : not _shared_llvm, +- fallback : ['llvm', 'dep_llvm'], +- include_type : 'system', +- ) +- with_llvm = dep_llvm.found() ++ llvm_proj = subproject('llvm') ++ if llvm_proj.found() ++ dep_llvm = llvm_proj.get_variable('dep_llvm') ++ with_llvm = true ++ else ++ dep_llvm = dependency( ++ 'llvm', ++ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool', ++ version : _llvm_version, ++ modules : llvm_modules, ++ optional_modules : llvm_optional_modules, ++ required : ( ++ with_amd_vk or with_gallium_radeonsi or with_gallium_clover or with_clc ++ or _llvm.enabled() ++ ), ++ static : not _shared_llvm, ++ fallback : ['llvm', 'dep_llvm'], ++ include_type : 'system', ++ ) ++ endif + endif + if with_llvm + pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version()) +@@ -1856,7 +1861,11 @@ endif dep_clang = null_dep if with_clc or with_gallium_clover -- 2.30.2