serve-sim 0.1.44-beta.99.3 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +7 -28
- package/Sources/SimNative/build.sh +18 -24
- package/dist/middleware.js +24 -24
- package/dist/native/serve-sim-native.node +0 -0
- package/dist/serve-sim.js +65 -65
- package/dist/simax/serve-sim-ax-settings +0 -0
- package/dist/simcam/libSimCameraInjector.dylib +0 -0
- package/dist/simcam/serve-sim-camera-helper +0 -0
- package/package.json +4 -7
- package/src/middleware.ts +66 -26
- /package/Sources/{SimStreamHelper → SimNative}/AccessibilityBridge.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/FrameCapture.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/H264Encoder.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/HIDInjector.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/SimFrameworks.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/StreamFormat.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/VideoEncoder.swift +0 -0
- /package/Sources/{SimStreamHelper → SimNative}/Xcode.swift +0 -0
package/Package.swift
CHANGED
|
@@ -23,7 +23,7 @@ let package = Package(
|
|
|
23
23
|
.library(
|
|
24
24
|
name: "serve-sim-native",
|
|
25
25
|
type: .dynamic,
|
|
26
|
-
targets: ["
|
|
26
|
+
targets: ["SimNative"]
|
|
27
27
|
),
|
|
28
28
|
],
|
|
29
29
|
dependencies: [
|
|
@@ -31,40 +31,19 @@ let package = Package(
|
|
|
31
31
|
],
|
|
32
32
|
targets: [
|
|
33
33
|
.target(
|
|
34
|
-
name: "
|
|
34
|
+
name: "SimNative",
|
|
35
35
|
dependencies: [
|
|
36
36
|
.product(name: "NodeAPI", package: "node-swift"),
|
|
37
37
|
.product(name: "NodeModuleSupport", package: "node-swift"),
|
|
38
38
|
],
|
|
39
|
-
path: "Sources",
|
|
40
|
-
// Sibling targets built by their own build.sh (Obj-C/ObjC++), not
|
|
41
|
-
// part of this SwiftPM package.
|
|
42
39
|
exclude: [
|
|
43
|
-
"
|
|
44
|
-
"SimCameraHelper",
|
|
45
|
-
"SimAXSettings",
|
|
46
|
-
"SimNative/build.sh",
|
|
47
|
-
],
|
|
48
|
-
sources: [
|
|
49
|
-
"SimNative/sim-module.swift",
|
|
50
|
-
"SimNative/sim-capture.swift",
|
|
51
|
-
"SimStreamHelper/HIDInjector.swift",
|
|
52
|
-
"SimStreamHelper/FrameCapture.swift",
|
|
53
|
-
"SimStreamHelper/VideoEncoder.swift",
|
|
54
|
-
"SimStreamHelper/H264Encoder.swift",
|
|
55
|
-
"SimStreamHelper/StreamFormat.swift",
|
|
56
|
-
"SimStreamHelper/AccessibilityBridge.swift",
|
|
57
|
-
"SimStreamHelper/SimFrameworks.swift",
|
|
58
|
-
"SimStreamHelper/Xcode.swift",
|
|
40
|
+
"build.sh",
|
|
59
41
|
],
|
|
60
42
|
linkerSettings: [
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.linkedFramework("VideoToolbox"),
|
|
66
|
-
.linkedFramework("ImageIO"),
|
|
67
|
-
.linkedFramework("AppKit"),
|
|
43
|
+
.unsafeFlags([
|
|
44
|
+
"-Xlinker", "-undefined",
|
|
45
|
+
"-Xlinker", "dynamic_lookup",
|
|
46
|
+
])
|
|
68
47
|
]
|
|
69
48
|
),
|
|
70
49
|
],
|
|
@@ -3,15 +3,11 @@
|
|
|
3
3
|
# spawned serve-sim-bin helper. The JS bindings are written in Swift with
|
|
4
4
|
# node-swift (see ../../Package.swift and sim-module.swift).
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
# NodeAPIMacros" / "unable to resolve module SwiftSyntax"). Cross-compiling the
|
|
12
|
-
# x86_64 slice would therefore require an x86_64-native toolchain (Rosetta),
|
|
13
|
-
# which isn't available everywhere; serve-sim targets Apple Silicon. napi_* stay
|
|
14
|
-
# undefined and resolve against the host (Node/Bun) at dlopen via
|
|
6
|
+
# We opt into the new `swiftbuild` build system, because it supports building universal
|
|
7
|
+
# binaries with macros, which neither the legacy `native` build system nor the
|
|
8
|
+
# perennially-janky legacy `xcode` build system had support for.
|
|
9
|
+
#
|
|
10
|
+
# napi_* stay undefined and resolve against the host (Node/Bun) at dlopen via
|
|
15
11
|
# `-undefined dynamic_lookup`.
|
|
16
12
|
set -euo pipefail
|
|
17
13
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -26,25 +22,23 @@ if [ ! -d "$PKG/node_modules/node-swift" ]; then
|
|
|
26
22
|
exit 1
|
|
27
23
|
fi
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
-c release
|
|
31
|
-
--product "$PRODUCT"
|
|
32
|
-
--package-path "$PKG"
|
|
33
|
-
--build-path "$BUILD_DIR"
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
DYLIB="$(find "$BUILD_DIR" -name "lib${PRODUCT}.dylib" -type f -not -path '*.dSYM*' -print -quit)"
|
|
41
|
-
if [ -z "$DYLIB" ]; then
|
|
42
|
-
echo "Build succeeded but lib${PRODUCT}.dylib was not found under $BUILD_DIR" >&2
|
|
25
|
+
build_flags=(
|
|
26
|
+
-c release
|
|
27
|
+
--product "$PRODUCT"
|
|
28
|
+
--package-path "$PKG"
|
|
29
|
+
--build-path "$BUILD_DIR"
|
|
30
|
+
--build-system swiftbuild
|
|
31
|
+
)
|
|
32
|
+
swift build "${build_flags[@]}" >&2
|
|
33
|
+
DYLIB="$(swift build --show-bin-path "${build_flags[@]}")/lib${PRODUCT}.dylib"
|
|
34
|
+
if [ ! -f "$DYLIB" ]; then
|
|
35
|
+
echo "Expected build product not found at $DYLIB" >&2
|
|
43
36
|
exit 1
|
|
44
37
|
fi
|
|
45
38
|
|
|
46
39
|
OUT="$OUT_DIR/${PRODUCT}.node"
|
|
47
|
-
cp "$DYLIB" "$OUT"
|
|
40
|
+
cp -a "$DYLIB" "$OUT"
|
|
41
|
+
strip -x "$OUT"
|
|
48
42
|
codesign -s - -f "$OUT" 2>/dev/null || true
|
|
49
43
|
|
|
50
44
|
echo "Built: $OUT"
|