From a5d9f76f50b86c69df11e1b178fe3e079dce79b6 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 27 May 2026 13:26:14 +0900 Subject: internal/rosa/cmake: use DESTDIR instead of --prefix Turns out --prefix is deeply broken, and DESTDIR works even when using ninja. Signed-off-by: Ophestra --- cmd/mbf/main.go | 1 - internal/rosa/cmake.go | 2 +- internal/rosa/package/spirv.az | 138 ++++++++++++++++++++ internal/rosa/package/spirv/package.az | 139 --------------------- .../rosa/package/spirv/remove-early-prefix.patch | 21 ---- 5 files changed, 139 insertions(+), 162 deletions(-) create mode 100644 internal/rosa/package/spirv.az delete mode 100644 internal/rosa/package/spirv/package.az delete mode 100644 internal/rosa/package/spirv/remove-early-prefix.patch diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index e5c17ac2..9cde0a94 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -893,7 +893,6 @@ func main() { "with-toolchain", command.BoolFlag(false), "Include the stage2 LLVM toolchain", ) - } c.Command( diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 83acad60..b058b5bf 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -98,6 +98,6 @@ cmake -G ` + generate + ` \ -DCMAKE_INSTALL_PREFIX=/system \ '/usr/src/` + name + `/` + filepath.Join(attr.Append...) + `' cmake --build . --parallel=` + jobsE + ` -cmake --install . --prefix=/work/system +DESTDIR=/work cmake --install . ` + script } diff --git a/internal/rosa/package/spirv.az b/internal/rosa/package/spirv.az new file mode 100644 index 00000000..f60b9239 --- /dev/null +++ b/internal/rosa/package/spirv.az @@ -0,0 +1,138 @@ +package spirv-headers { + description = "machine-readable files for the SPIR-V Registry"; + website = "https://github.com/KhronosGroup/SPIRV-Headers"; + anitya = 230542; + // upstream changed version scheme, anitya incapable of filtering them + latest = anityaFilterSPIRV; + + version# = "1.4.350.0"; + source = remoteGitHub { + suffix = "KhronosGroup/SPIRV-Headers"; + tag = "vulkan-sdk-"+version; + checksum = "wFCZquDVL4HoE-kWbS_BHHb_d71EYR2A2kVp08oDutektpnQzhDP89wo821GgcpG"; + }; + + exec = cmake { + // upstream has no tests + skipTest = true; + }; +} + +package spirv-tools { + description = "an API and commands for processing SPIR-V modules"; + website = "https://github.com/KhronosGroup/SPIRV-Tools"; + anitya = 14894; + latest = anityaFallback; + + version# = "2026.1"; + source = remoteGitHub { + suffix = "KhronosGroup/SPIRV-Tools"; + tag = "v"+version; + checksum = "ZSQPQx8NltCDzQLk4qlaVxyWRWeI_JtsjEpeFt3kezTanl9DTHfLixSUCezMFBjv"; + }; + + exec = cmake { + cache = { + "SPIRV-Headers_SOURCE_DIR": "/system"; + }; + }; + + inputs = [ + python, + + spirv-headers, + ]; + + runtime = [ spirv-headers ]; +} + +package spirv-llvm-translator { + description = "bi-directional translation between SPIR-V and LLVM IR"; + website = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator"; + anitya = 227273; + + version# = "22.1.2"; + source = remoteGitHub { + suffix = "KhronosGroup/SPIRV-LLVM-Translator"; + tag = "v"+version; + checksum = "JZAaV5ewYcm-35YA_U2BM2IcsQouZtX1BLZR0zh2vSlfEXMsT5OCtY4Gh5RJkcGy"; + }; + + // litArgs emits shell syntax + early = "\nexport LIT_OPTS=" + litArgs { + verbose = true; + + skipChecks = arch { + default = [ + // error: line 13: OpTypeCooperativeMatrixKHR Scope is limited to Workgroup and Subgroup + "cooperative_matrix_constant_null.spvasm", + ]; + + arm64 = [ + // error: line 13: OpTypeCooperativeMatrixKHR Scope is limited to Workgroup and Subgroup + "cooperative_matrix_constant_null.spvasm", + + // LLVM ERROR: unsupported calling convention + "DebugInfo/COFF/no-cus.ll", + "DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll", + "DebugInfo/Generic/2009-11-10-CurrentFn.ll", + "DebugInfo/Generic/2010-01-05-DbgScope.ll", + "DebugInfo/Generic/2010-03-12-llc-crash.ll", + "DebugInfo/Generic/2010-03-24-MemberFn.ll", + "DebugInfo/Generic/2010-04-19-FramePtr.ll", + "DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll", + "DebugInfo/Generic/2010-10-01-crash.ll", + "DebugInfo/Generic/PR20038.ll", + "DebugInfo/Generic/constant-pointers.ll", + "DebugInfo/Generic/dead-argument-order.ll", + "DebugInfo/Generic/debug-info-eis-option.ll", + "DebugInfo/Generic/def-line.ll", + "DebugInfo/Generic/discriminator.ll", + "DebugInfo/Generic/dwarf-public-names.ll", + "DebugInfo/Generic/enum.ll", + "DebugInfo/Generic/func-using-decl.ll", + "DebugInfo/Generic/global.ll", + "DebugInfo/Generic/imported-name-inlined.ll", + "DebugInfo/Generic/incorrect-variable-debugloc1.ll", + "DebugInfo/Generic/inline-scopes.ll", + "DebugInfo/Generic/inlined-arguments.ll", + "DebugInfo/Generic/inlined-vars.ll", + "DebugInfo/Generic/linear-dbg-value.ll", + "DebugInfo/Generic/linkage-name-abstract.ll", + "DebugInfo/Generic/member-order.ll", + "DebugInfo/Generic/missing-abstract-variable.ll", + "DebugInfo/Generic/multiline.ll", + "DebugInfo/Generic/namespace_function_definition.ll", + "DebugInfo/Generic/namespace_inline_function_definition.ll", + "DebugInfo/Generic/noscopes.ll", + "DebugInfo/Generic/ptrsize.ll", + "DebugInfo/Generic/restrict.ll", + "DebugInfo/Generic/two-cus-from-same-file.ll", + "DebugInfo/Generic/version.ll", + "DebugInfo/LocalAddressSpace.ll", + "DebugInfo/UnknownBaseType.ll", + "DebugInfo/expr-opcode.ll", + ]; + }; + } + "\n"; + + exec = cmake { + cache = { + "CMAKE_SKIP_BUILD_RPATH": "ON"; + "BUILD_SHARED_LIBS": "ON"; + "LLVM_SPIRV_ENABLE_LIBSPIRV_DIS": "ON"; + "LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR": "/system"; + "LLVM_EXTERNAL_LIT": "/system/bin/lit"; + "LLVM_INCLUDE_TESTS": "ON"; + }; + }; + + inputs = [ + bash, + lit, + + spirv-tools, + ]; + + runtime = [ spirv-tools ]; +} diff --git a/internal/rosa/package/spirv/package.az b/internal/rosa/package/spirv/package.az deleted file mode 100644 index 464db416..00000000 --- a/internal/rosa/package/spirv/package.az +++ /dev/null @@ -1,139 +0,0 @@ -package spirv-headers { - description = "machine-readable files for the SPIR-V Registry"; - website = "https://github.com/KhronosGroup/SPIRV-Headers"; - anitya = 230542; - // upstream changed version scheme, anitya incapable of filtering them - latest = anityaFilterSPIRV; - - version# = "1.4.350.0"; - source = remoteGitHub { - suffix = "KhronosGroup/SPIRV-Headers"; - tag = "vulkan-sdk-"+version; - checksum = "wFCZquDVL4HoE-kWbS_BHHb_d71EYR2A2kVp08oDutektpnQzhDP89wo821GgcpG"; - }; - - exec = cmake { - // upstream has no tests - skipTest = true; - }; -} - -package spirv-tools { - description = "an API and commands for processing SPIR-V modules"; - website = "https://github.com/KhronosGroup/SPIRV-Tools"; - anitya = 14894; - latest = anityaFallback; - - version# = "2026.1"; - source = remoteGitHub { - suffix = "KhronosGroup/SPIRV-Tools"; - tag = "v"+version; - checksum = "ZSQPQx8NltCDzQLk4qlaVxyWRWeI_JtsjEpeFt3kezTanl9DTHfLixSUCezMFBjv"; - }; - - exec = cmake { - cache = { - "SPIRV-Headers_SOURCE_DIR": "/system"; - }; - }; - - inputs = [ - python, - - spirv-headers, - ]; - - runtime = [ spirv-headers ]; -} - -package spirv-llvm-translator { - description = "bi-directional translation between SPIR-V and LLVM IR"; - website = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator"; - anitya = 227273; - - version# = "22.1.2"; - source = remoteGitHub { - suffix = "KhronosGroup/SPIRV-LLVM-Translator"; - tag = "v"+version; - checksum = "JZAaV5ewYcm-35YA_U2BM2IcsQouZtX1BLZR0zh2vSlfEXMsT5OCtY4Gh5RJkcGy"; - }; - patches = [ "remove-early-prefix.patch" ]; - - // litArgs emits shell syntax - early = "\nexport LIT_OPTS=" + litArgs { - verbose = true; - - skipChecks = arch { - default = [ - // error: line 13: OpTypeCooperativeMatrixKHR Scope is limited to Workgroup and Subgroup - "cooperative_matrix_constant_null.spvasm", - ]; - - arm64 = [ - // error: line 13: OpTypeCooperativeMatrixKHR Scope is limited to Workgroup and Subgroup - "cooperative_matrix_constant_null.spvasm", - - // LLVM ERROR: unsupported calling convention - "DebugInfo/COFF/no-cus.ll", - "DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll", - "DebugInfo/Generic/2009-11-10-CurrentFn.ll", - "DebugInfo/Generic/2010-01-05-DbgScope.ll", - "DebugInfo/Generic/2010-03-12-llc-crash.ll", - "DebugInfo/Generic/2010-03-24-MemberFn.ll", - "DebugInfo/Generic/2010-04-19-FramePtr.ll", - "DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll", - "DebugInfo/Generic/2010-10-01-crash.ll", - "DebugInfo/Generic/PR20038.ll", - "DebugInfo/Generic/constant-pointers.ll", - "DebugInfo/Generic/dead-argument-order.ll", - "DebugInfo/Generic/debug-info-eis-option.ll", - "DebugInfo/Generic/def-line.ll", - "DebugInfo/Generic/discriminator.ll", - "DebugInfo/Generic/dwarf-public-names.ll", - "DebugInfo/Generic/enum.ll", - "DebugInfo/Generic/func-using-decl.ll", - "DebugInfo/Generic/global.ll", - "DebugInfo/Generic/imported-name-inlined.ll", - "DebugInfo/Generic/incorrect-variable-debugloc1.ll", - "DebugInfo/Generic/inline-scopes.ll", - "DebugInfo/Generic/inlined-arguments.ll", - "DebugInfo/Generic/inlined-vars.ll", - "DebugInfo/Generic/linear-dbg-value.ll", - "DebugInfo/Generic/linkage-name-abstract.ll", - "DebugInfo/Generic/member-order.ll", - "DebugInfo/Generic/missing-abstract-variable.ll", - "DebugInfo/Generic/multiline.ll", - "DebugInfo/Generic/namespace_function_definition.ll", - "DebugInfo/Generic/namespace_inline_function_definition.ll", - "DebugInfo/Generic/noscopes.ll", - "DebugInfo/Generic/ptrsize.ll", - "DebugInfo/Generic/restrict.ll", - "DebugInfo/Generic/two-cus-from-same-file.ll", - "DebugInfo/Generic/version.ll", - "DebugInfo/LocalAddressSpace.ll", - "DebugInfo/UnknownBaseType.ll", - "DebugInfo/expr-opcode.ll", - ]; - }; - } + "\n"; - - exec = cmake { - cache = { - "CMAKE_SKIP_BUILD_RPATH": "ON"; - "BUILD_SHARED_LIBS": "ON"; - "LLVM_SPIRV_ENABLE_LIBSPIRV_DIS": "ON"; - "LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR": "/system"; - "LLVM_EXTERNAL_LIT": "/system/bin/lit"; - "LLVM_INCLUDE_TESTS": "ON"; - }; - }; - - inputs = [ - bash, - lit, - - spirv-tools, - ]; - - runtime = [ spirv-tools ]; -} diff --git a/internal/rosa/package/spirv/remove-early-prefix.patch b/internal/rosa/package/spirv/remove-early-prefix.patch deleted file mode 100644 index f184ebc7..00000000 --- a/internal/rosa/package/spirv/remove-early-prefix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c000a77e..f18f3fde 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -164,7 +164,7 @@ install( - ${LLVM_SPIRV_INCLUDE_DIRS}/LLVMSPIRVOpts.h - ${LLVM_SPIRV_INCLUDE_DIRS}/LLVMSPIRVExtensions.inc - DESTINATION -- ${CMAKE_INSTALL_PREFIX}/include/LLVMSPIRVLib -+ include/LLVMSPIRVLib - ) - - configure_file(LLVMSPIRVLib.pc.in ${CMAKE_BINARY_DIR}/LLVMSPIRVLib.pc @ONLY) -@@ -172,5 +172,5 @@ install( - FILES - ${CMAKE_BINARY_DIR}/LLVMSPIRVLib.pc - DESTINATION -- ${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/pkgconfig -+ lib${LLVM_LIBDIR_SUFFIX}/pkgconfig - ) -; \ No newline at end of file -- cgit v1.3.1