feat(pkg): compat.opencv5 5.0.0 — 全源码直编 + build.mcpp 消费端合成(新形态)#76
Merged
Conversation
OpenCV 5.0.0 (core/imgproc/imgcodecs/highgui/videoio + flann/geometry 闭包),
mcpp 直编 457 TU(含 27 NASM .asm),SIMD runtime dispatch 保留(per-ISA glob
flags)。小 config 快照(59KB/171 文件)内联;大生成物(字体 hex 头、OpenCL
kernel 内嵌、转发 TU 层)由包内嵌 build.mcpp 在消费端合成 —— CMake 逻辑逐字节
忠实移植(与参考构建 diff 8/8 IDENTICAL)。官方 tarball + CN 镜像
(mcpp-res/opencv@5.0.0,sha256 双端核验)。
转发 TU 层同时解决 mcpp#233(对象路径折叠冲突)、libjpeg-turbo BITS_IN_JSAMPLE
同源三编、mcpp#234(defines 含空格)。端到端验证(mcpp 0.0.96):零 override
消费工程冷构建 33s 全绿;workspace 成员 tests/examples/opencv5 (cfg(linux))。
工具链:tools/compat-opencv5/{fetch_upstream.sh,gen_config.sh,gen_descriptor.py,
build_mcpp_template.cpp};gen_descriptor 对全部参考编译命令做精确重构断言。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
新增
compat.opencv55.0.0 —— OpenCV 5 全源码直编包,并确立第五种包形态:全源码直编 +build.mcpp消费端合成。构建期零 CMake:mcpp 直编 457 TU(含 27 个 libjpeg-turbo NASM
.asm),SIMD runtime dispatch 完整保留(per-ISA glob flags),冷构建 ~33s/32 核。为什么是新形态
OpenCV 构建期生成物达 17MB(内置字体 hex 头 + OpenCL kernel 内嵌 + 逐 TU 转发 stub),无法走 compat.ffmpeg 的纯内联路线。本包:
build.mcpp(0.0.95 依赖包 build.mcpp 执行 +mcpp:generated=+ OUT_DIR 契约的首个 index 实战)在构建时从官方 tarball 合成字体头(blob2hdr)、OpenCL kernel 内嵌(cl2cpp + MD5)、457 个转发 TU —— 全部为 CMake 逻辑逐字节忠实移植(与参考构建 diff 8/8 IDENTICAL)转发 TU 层一石三鸟:mcpp#233(对象路径按父目录名折叠,
modules/*/src/同名源冲突)、libjpeg-turbo BITS_IN_JSAMPLE=8/12/16 同源三编、mcpp#234(defines 含空格被拆散 → 注入 stub 顶部#define)。#233/#234 修复后可退役。Profile(linux-x86_64,v0.1)
BUILD_LIST=core,imgproc,imgcodecs,highgui,videoio(+ flann/geometry 闭包);hermetic(外部探测全 OFF、vendored zlib/libpng/libjpeg-turbo);headless highgui;V4L2 videoio;WITH_UNIFONT=OFF(configure 期额外下载,破坏单源封闭;将来 feature)。language = "c++23"(上游 c++17;457 TU 已在 gcc16 c++23 下全绿)。镜像与验证
mcpp-res/opencvrelease5.0.0,与 GitHub tag tarball 逐字节一致(sha256b0528f5a…3095双端核验)mcpp xpkg parse(0.0.95/0.0.96)✓;端到端消费工程(mcpp 0.0.96,零 override)构建+运行断言全绿 ✓;workspace 成员tests/examples/opencv5(cfg(linux) 门控,off-Linux no-op)mcpp test✓生成流水线
tools/compat-opencv5/:fetch_upstream.sh(官方 tarball 钉版)→ gen_config.sh(CMake 冻结 profile + 参考构建 +ninja -t commands)→ gen_descriptor.py(flag 面「基础∪目录组∪ISA∪逐文件」分解 + 全命令精确重构断言 + lua 发射)。升级 SOP 见.agents/docs/2026-07-18-add-compat-opencv5-plan.md。关联
import opencv.cv;)的 compat 底座;模块层将按 ffmpeg 先例(feat(pkgs): add public ffmpeg module package 0.0.1 (Form A) + house compat.ffmpeg pipeline #75)后续登记pkgs/o/opencv.lua。