Skip to content

Commit 7b911bb

Browse files
committed
feat(pkg): opencv module 0.0.6 → macOS (import opencv.cv via clang forwarding layer)
opencv-m v0.0.6 added the clang static-inline export forwarding layer (26 core names), so clang (macOS) can now compile+link `import opencv.cv;`. Re-point: - pkgs/o/opencv.lua: 0.0.4→0.0.6, +xpm.macosx (OS-neutral module tarball, sha adebd6b1…). - opencv-module + opencv-module-unifont → +cfg(macos); guards __linux__→__linux__||__APPLE__. - opencv-module-dnn stays linux (dnn x86; blocked on mcpp#253 per-OS features). The macOS workspace leg is the definitive clang link+run validation of v0.0.6.
1 parent 7ca733a commit 7b911bb

6 files changed

Lines changed: 27 additions & 10 deletions

File tree

pkgs/o/opencv.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
-- Optional features (0.0.4+, mcpp#243 forwarding): `dnn` adds the
1111
-- import opencv.dnn; interface and forwards compat.opencv/dnn; `unifont`
1212
-- forwards compat.opencv/unifont — `opencv = { features = ["dnn"] }`.
13-
-- Linux-only for now: compat.opencv carries a linux-x86_64 config snapshot.
13+
-- linux + macOS: the module tarball is OS-neutral; compat.opencv is per-OS
14+
-- (linux/macosx full). v0.0.6 added the clang static-inline export forwarding
15+
-- layer so clang (macOS) can import opencv.cv. windows: module needs videoio.
1416
--
1517
package = {
1618
spec = "1",
@@ -23,12 +25,21 @@ package = {
2325

2426
xpm = {
2527
linux = {
26-
["0.0.4"] = {
28+
["0.0.6"] = {
2729
url = {
28-
GLOBAL = "https://github.com/Sunrisepeak/opencv-m/archive/refs/tags/v0.0.4.tar.gz",
29-
CN = "https://gitcode.com/mcpp-res/opencv/releases/download/v0.0.4/opencv-m-0.0.4.tar.gz",
30+
GLOBAL = "https://github.com/Sunrisepeak/opencv-m/archive/refs/tags/v0.0.6.tar.gz",
31+
CN = "https://gitcode.com/mcpp-res/opencv/releases/download/v0.0.6/opencv-m-0.0.6.tar.gz",
3032
},
31-
sha256 = "a2e95e8b22ae66712e3f78809426e058330073c2679a21c2b2d500faa0b4964f",
33+
sha256 = "adebd6b1e7a434bf8d744a6fc191725466467ae13b4d7ee1c01d5a8e21bbf2eb",
34+
},
35+
},
36+
macosx = {
37+
["0.0.6"] = {
38+
url = {
39+
GLOBAL = "https://github.com/Sunrisepeak/opencv-m/archive/refs/tags/v0.0.6.tar.gz",
40+
CN = "https://gitcode.com/mcpp-res/opencv/releases/download/v0.0.6/opencv-m-0.0.6.tar.gz",
41+
},
42+
sha256 = "adebd6b1e7a434bf8d744a6fc191725466467ae13b4d7ee1c01d5a8e21bbf2eb",
3243
},
3344
},
3445
},

tests/examples/opencv-module-dnn/mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ version = "0.1.0"
1212
default = { path = "../../.." }
1313

1414
[target.'cfg(linux)'.dependencies]
15-
opencv = { version = "0.0.4", features = ["dnn"] }
15+
opencv = { version = "0.0.6", features = ["dnn"] }

tests/examples/opencv-module-unifont/mcpp.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ version = "0.1.0"
1111
default = { path = "../../.." }
1212

1313
[target.'cfg(linux)'.dependencies]
14-
opencv = { version = "0.0.4", features = ["unifont"] }
14+
opencv = { version = "0.0.6", features = ["unifont"] }
15+
16+
[target.'cfg(macos)'.dependencies]
17+
opencv = { version = "0.0.6", features = ["unifont"] }

tests/examples/opencv-module-unifont/tests/opencv_unifont_iface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// compat.opencv/unifont — CJK rendering through the module layer must ink.
33
// Linux-only (see mcpp.toml). Import-only (import std + opencv.cv): no textual
44
// headers, matching the ffmpeg-module member convention.
5-
#ifdef __linux__
5+
#if defined(__linux__) || defined(__APPLE__)
66
import std;
77
import opencv.cv;
88

tests/examples/opencv-module/mcpp.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ version = "0.1.0"
1717
default = { path = "../../.." }
1818

1919
[target.'cfg(linux)'.dependencies]
20-
opencv = "0.0.4"
20+
opencv = "0.0.6"
21+
22+
[target.'cfg(macos)'.dependencies]
23+
opencv = "0.0.6"

tests/examples/opencv-module/tests/opencv_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// replacement operator surface: Size comparison via != crosses the module
44
// boundary — the v0.0.1 regression scenario), PNG+JPEG codec roundtrips,
55
// videoio registry. Linux-only (see mcpp.toml).
6-
#ifdef __linux__
6+
#if defined(__linux__) || defined(__APPLE__)
77
import std;
88
import opencv.cv;
99

0 commit comments

Comments
 (0)