Skip to content

Commit 7d6c502

Browse files
committed
fix(opencv): Ninja generator on all platforms (xim:make has no macOS build)
macOS fetch failed before install() because xim:make is linux-only (no macosx build) — so build-dep install aborted, invisibly. Switch to Ninja (xim:ninja is cross-platform: linux/macosx/windows) for ALL platforms, dropping xim:make. Also unpin the compiler (xim:llvm, no version) per review — libc++ ABI is stable. Sets up Windows too (Ninja + clang-cl later).
1 parent b1154ad commit 7d6c502

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎pkgs/c/compat.opencv.lua‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ package = {
5555
-- deps on scode:linux-headers), so build_dep("linux-headers") off the
5656
-- wrapper yields no include/ — declare the real one so glibc's
5757
-- <linux/limits.h> resolves host-free.
58-
deps = { "xim:cmake@4.0.2", "xim:make@latest", "xim:gcc@16.1.0",
58+
deps = { "xim:cmake@4.0.2", "xim:ninja@1.12.1", "xim:gcc@16.1.0",
5959
"xim:glibc@2.39", "scode:linux-headers@5.11.1" },
6060
["4.13.0"] = {
6161
-- Plain-string GLOBAL url (no CN mirror table): this session lacks
@@ -69,7 +69,9 @@ package = {
6969
macosx = {
7070
-- clang/libc++ (xim:llvm) to match the macOS default consumer's ABI;
7171
-- gcc/libstdc++ would ABI-clash. clang finds the system SDK itself.
72-
deps = { "xim:cmake@4.0.2", "xim:make@latest", "xim:llvm@20.1.7" },
72+
-- Ninja (not xim:make — it has no macOS build) + clang (xim:llvm,
73+
-- unpinned: compiler version needn't be fixed; libc++ ABI is stable).
74+
deps = { "xim:cmake@4.0.2", "xim:ninja@1.12.1", "xim:llvm" },
7375
["4.13.0"] = {
7476
-- Plain-string GLOBAL url (no CN mirror table): this session lacks
7577
-- mcpp-res write access. Per the add-package skill, CN users fall
@@ -194,7 +196,9 @@ local function _install_impl()
194196
-- building OpenCV with gcc there would produce a libstdc++ .a that ABI-clashes
195197
-- with a libc++ consumer.
196198
local isMac = (os.host() == "macosx")
197-
local cmake, make = "cmake", "make"
199+
-- Ninja generator on ALL platforms (cross-platform via xim:ninja; xim:make has
200+
-- no macOS build). `cmake --build` drives it uniformly.
201+
local cmake, make = "cmake", "ninja"
198202
local gcc = isMac and "clang" or "gcc"
199203
local gxx = isMac and "clang++" or "g++"
200204

@@ -278,7 +282,7 @@ local function _install_impl()
278282
-- tools. CMAKE_POLICY_VERSION_MINIMUM=3.5 lets CMake 4.x parse OpenCV's (and
279283
-- its 3rdparty's) old cmake_minimum_required.
280284
local dflags = table.concat({
281-
"-G", sh_quote("Unix Makefiles"),
285+
"-G", sh_quote("Ninja"),
282286
"-DCMAKE_MAKE_PROGRAM=" .. sh_quote(make),
283287
"-DCMAKE_C_COMPILER=" .. sh_quote(gcc),
284288
"-DCMAKE_CXX_COMPILER=" .. sh_quote(gxx),

0 commit comments

Comments
 (0)